Auto merge of #51007 - AstralSorcerer:master, r=nagisa
Make globals with private linkage unnamed. Fixes #50862. cc @oli-obk @nagisa
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user