mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Go bindings: introduce Value.ConstantAsMetadata.
llvm-svn: 224179
This commit is contained in:
parent
bcdc22d6ac
commit
429456643c
@ -50,6 +50,10 @@ void LLVMRemoveFunctionAttr2(LLVMValueRef Fn, uint64_t PA) {
|
||||
Func->setAttributes(PALnew);
|
||||
}
|
||||
|
||||
LLVMMetadataRef LLVMConstantAsMetadata(LLVMValueRef C) {
|
||||
return wrap(ConstantAsMetadata::get(unwrap<Constant>(C)));
|
||||
}
|
||||
|
||||
LLVMMetadataRef LLVMMDString2(LLVMContextRef C, const char *Str, unsigned SLen) {
|
||||
return wrap(MDString::get(*unwrap(C), StringRef(Str, SLen)));
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ void LLVMAddFunctionAttr2(LLVMValueRef Fn, uint64_t PA);
|
||||
uint64_t LLVMGetFunctionAttr2(LLVMValueRef Fn);
|
||||
void LLVMRemoveFunctionAttr2(LLVMValueRef Fn, uint64_t PA);
|
||||
|
||||
LLVMMetadataRef LLVMConstantAsMetadata(LLVMValueRef Val);
|
||||
|
||||
LLVMMetadataRef LLVMMDString2(LLVMContextRef C, const char *Str, unsigned SLen);
|
||||
LLVMMetadataRef LLVMMDNode2(LLVMContextRef C, LLVMMetadataRef *MDs,
|
||||
unsigned Count);
|
||||
|
@ -754,6 +754,10 @@ func (c Context) TemporaryMDNode(mds []Metadata) (md Metadata) {
|
||||
md.C = C.LLVMTemporaryMDNode(c.C, ptr, nvals)
|
||||
return
|
||||
}
|
||||
func (v Value) ConstantAsMetadata() (md Metadata) {
|
||||
md.C = C.LLVMConstantAsMetadata(v.C)
|
||||
return
|
||||
}
|
||||
|
||||
// Operations on scalar constants
|
||||
func ConstInt(t Type, n uint64, signExtend bool) (v Value) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user