mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
Implement LLVMGetOrInsertGlobal wrapper
This commit is contained in:
parent
cb4570311b
commit
deb097a1d2
@ -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…
Reference in New Issue
Block a user