diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2019-06-07 19:10:08 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2019-06-07 19:10:08 +0000 |
| commit | e08e68de213008246cc2dba029cdff0548693b2c (patch) | |
| tree | 33b369e7293406ad72dd326410e4dd1608574747 /clang/lib/CodeGen | |
| parent | ef57e50bd2b8151e06a459432838610c172d0512 (diff) | |
| download | bcm5719-llvm-e08e68de213008246cc2dba029cdff0548693b2c.tar.gz bcm5719-llvm-e08e68de213008246cc2dba029cdff0548693b2c.zip | |
Driver, IRGen: Set partitions on GlobalValues according to -fsymbol-partition flag.
Differential Revision: https://reviews.llvm.org/D62636
llvm-svn: 362829
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 9 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 5 | ||||
| -rw-r--r-- | clang/lib/CodeGen/ItaniumCXXABI.cpp | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index e79eb71b793..bd44a493a28 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -875,19 +875,20 @@ void CodeGenModule::setDLLImportDLLExport(llvm::GlobalValue *GV, void CodeGenModule::setGVProperties(llvm::GlobalValue *GV, GlobalDecl GD) const { setDLLImportDLLExport(GV, GD); - setGlobalVisibilityAndLocal(GV, dyn_cast<NamedDecl>(GD.getDecl())); + setGVPropertiesAux(GV, dyn_cast<NamedDecl>(GD.getDecl())); } void CodeGenModule::setGVProperties(llvm::GlobalValue *GV, const NamedDecl *D) const { setDLLImportDLLExport(GV, D); - setGlobalVisibilityAndLocal(GV, D); + setGVPropertiesAux(GV, D); } -void CodeGenModule::setGlobalVisibilityAndLocal(llvm::GlobalValue *GV, - const NamedDecl *D) const { +void CodeGenModule::setGVPropertiesAux(llvm::GlobalValue *GV, + const NamedDecl *D) const { setGlobalVisibility(GV, D); setDSOLocal(GV); + GV->setPartition(CodeGenOpts.SymbolPartition); } static llvm::GlobalVariable::ThreadLocalMode GetLLVMTLSModel(StringRef S) { diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 6ab454fe6da..8c1bc0777de 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -759,9 +759,6 @@ public: /// Set the visibility for the given LLVM GlobalValue. void setGlobalVisibility(llvm::GlobalValue *GV, const NamedDecl *D) const; - void setGlobalVisibilityAndLocal(llvm::GlobalValue *GV, - const NamedDecl *D) const; - void setDSOLocal(llvm::GlobalValue *GV) const; void setDLLImportDLLExport(llvm::GlobalValue *GV, GlobalDecl D) const; @@ -771,6 +768,8 @@ public: void setGVProperties(llvm::GlobalValue *GV, GlobalDecl GD) const; void setGVProperties(llvm::GlobalValue *GV, const NamedDecl *D) const; + void setGVPropertiesAux(llvm::GlobalValue *GV, const NamedDecl *D) const; + /// Set the TLS mode for the given LLVM GlobalValue for the thread-local /// variable declaration D. void setTLSMode(llvm::GlobalValue *GV, const VarDecl &D) const; diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp index 3fac8d60fd2..bd399b25c3f 100644 --- a/clang/lib/CodeGen/ItaniumCXXABI.cpp +++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp @@ -3420,6 +3420,9 @@ llvm::Constant *ItaniumRTTIBuilder::BuildTypeInfo( TypeName->setDLLStorageClass(DLLStorageClass); GV->setDLLStorageClass(DLLStorageClass); + TypeName->setPartition(CGM.getCodeGenOpts().SymbolPartition); + GV->setPartition(CGM.getCodeGenOpts().SymbolPartition); + return llvm::ConstantExpr::getBitCast(GV, CGM.Int8PtrTy); } |

