Make globals with private linkage unnamed. Fixes #50862.
This commit is contained in:
parent
e94df4acb4
commit
02190f397e
12 changed files with 42 additions and 51 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "llvm/IR/DebugInfoMetadata.h"
|
||||
#include "llvm/IR/DiagnosticInfo.h"
|
||||
#include "llvm/IR/DiagnosticPrinter.h"
|
||||
#include "llvm/IR/GlobalVariable.h"
|
||||
#include "llvm/IR/Instructions.h"
|
||||
#include "llvm/Object/Archive.h"
|
||||
#include "llvm/Object/ObjectFile.h"
|
||||
|
@ -116,6 +117,15 @@ LLVMRustGetOrInsertGlobal(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty) {
|
|||
return wrap(unwrap(M)->getOrInsertGlobal(Name, unwrap(Ty)));
|
||||
}
|
||||
|
||||
extern "C" LLVMValueRef
|
||||
LLVMRustInsertPrivateGlobal(LLVMModuleRef M, LLVMTypeRef Ty) {
|
||||
return wrap(new GlobalVariable(*unwrap(M),
|
||||
unwrap(Ty),
|
||||
false,
|
||||
GlobalValue::PrivateLinkage,
|
||||
nullptr));
|
||||
}
|
||||
|
||||
extern "C" LLVMTypeRef LLVMRustMetadataTypeInContext(LLVMContextRef C) {
|
||||
return wrap(Type::getMetadataTy(*unwrap(C)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue