Implement LLVMGetOrInsertGlobal wrapper
This commit is contained in:
parent
cb4570311b
commit
deb097a1d2
2 changed files with 7 additions and 0 deletions
|
|
@ -912,6 +912,7 @@ extern {
|
|||
AddressSpace: c_uint)
|
||||
-> ValueRef;
|
||||
pub fn LLVMGetNamedGlobal(M: ModuleRef, Name: *const c_char) -> ValueRef;
|
||||
pub fn LLVMGetOrInsertGlobal(M: ModuleRef, Name: *const c_char, T: TypeRef) -> ValueRef;
|
||||
pub fn LLVMGetFirstGlobal(M: ModuleRef) -> ValueRef;
|
||||
pub fn LLVMGetLastGlobal(M: ModuleRef) -> ValueRef;
|
||||
pub fn LLVMGetNextGlobal(GlobalVar: ValueRef) -> ValueRef;
|
||||
|
|
|
|||
|
|
@ -89,6 +89,12 @@ extern "C" LLVMValueRef LLVMGetOrInsertFunction(LLVMModuleRef M,
|
|||
unwrap<FunctionType>(FunctionTy)));
|
||||
}
|
||||
|
||||
extern "C" LLVMValueRef LLVMGetOrInsertGlobal(LLVMModuleRef M,
|
||||
const char* Name,
|
||||
LLVMTypeRef Ty) {
|
||||
return wrap(unwrap(M)->getOrInsertGlobal(Name, unwrap(Ty)));
|
||||
}
|
||||
|
||||
extern "C" LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C) {
|
||||
return wrap(Type::getMetadataTy(*unwrap(C)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue