summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDmitry Mikulin <dmitry.mikulin@sony.com>2019-10-17 00:55:38 +0000
committerDmitry Mikulin <dmitry.mikulin@sony.com>2019-10-17 00:55:38 +0000
commit15984457a673eff3969c0755be543e7d572edd47 (patch)
tree634b93a5840f7b20c19bd993d202ae7b68faa2a8 /clang/lib/CodeGen/CodeGenModule.cpp
parenteb1bbcec08d2d22bbcc55be6cb05476b617c96cf (diff)
downloadbcm5719-llvm-15984457a673eff3969c0755be543e7d572edd47.tar.gz
bcm5719-llvm-15984457a673eff3969c0755be543e7d572edd47.zip
Revert Tag CFI-generated data structures with "#pragma clang section" attributes.
This reverts r375022 (git commit e2692b3bc0327606748b6d291b9009d2c845ced5) llvm-svn: 375069
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp27
1 files changed, 5 insertions, 22 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index a4859e7fbbf..8eb2176ca3a 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1699,8 +1699,11 @@ bool CodeGenModule::GetCPUAndFeaturesAttributes(GlobalDecl GD,
return AddedAttr;
}
-void CodeGenModule::setPragmaSectionAttributes(const Decl *D,
- llvm::GlobalObject *GO) {
+void CodeGenModule::setNonAliasAttributes(GlobalDecl GD,
+ llvm::GlobalObject *GO) {
+ const Decl *D = GD.getDecl();
+ SetCommonAttributes(GD, GO);
+
if (D) {
if (auto *GV = dyn_cast<llvm::GlobalVariable>(GO)) {
if (auto *SA = D->getAttr<PragmaClangBSSSectionAttr>())
@@ -1718,26 +1721,6 @@ void CodeGenModule::setPragmaSectionAttributes(const Decl *D,
if (!D->getAttr<SectionAttr>())
F->addFnAttr("implicit-section-name", SA->getName());
- if (auto *SA = D->getAttr<PragmaClangBSSSectionAttr>())
- F->addFnAttr("bss-section", SA->getName());
- if (auto *SA = D->getAttr<PragmaClangDataSectionAttr>())
- F->addFnAttr("data-section", SA->getName());
- if (auto *SA = D->getAttr<PragmaClangRodataSectionAttr>())
- F->addFnAttr("rodata-section", SA->getName());
- if (auto *SA = D->getAttr<PragmaClangRelroSectionAttr>())
- F->addFnAttr("relro-section", SA->getName());
- }
- }
-}
-
-void CodeGenModule::setNonAliasAttributes(GlobalDecl GD,
- llvm::GlobalObject *GO) {
- const Decl *D = GD.getDecl();
- SetCommonAttributes(GD, GO);
- setPragmaSectionAttributes(D, GO);
-
- if (D) {
- if (auto *F = dyn_cast<llvm::Function>(GO)) {
llvm::AttrBuilder Attrs;
if (GetCPUAndFeaturesAttributes(GD, Attrs)) {
// We know that GetCPUAndFeaturesAttributes will always have the
OpenPOWER on IntegriCloud