summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-12 17:28:23 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-12 17:28:23 +0000
commit648bf78333bac59a3e5106a87324952b9cfa70cb (patch)
treed81ffaac99e5c2efbb877fcaf426e4e467ec551a /clang/lib/CodeGen/CodeGenModule.cpp
parent90880e2598ec267d85e7b8cb90f65a9b42dc3c99 (diff)
downloadbcm5719-llvm-648bf78333bac59a3e5106a87324952b9cfa70cb.tar.gz
bcm5719-llvm-648bf78333bac59a3e5106a87324952b9cfa70cb.zip
Support __attribute__(section(<name>))
llvm-svn: 64380
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 7b939e29706..7192e9db2f2 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -259,6 +259,9 @@ static void SetGlobalValueAttributes(const Decl *D,
// should not be munged.
GV->setName("\01" + ALA->getLabel());
}
+
+ if (const SectionAttr *SA = D->getAttr<SectionAttr>())
+ GV->setSection(SA->getName());
}
void CodeGenModule::SetFunctionAttributes(const Decl *D,
@@ -653,6 +656,9 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
}
}
+ if (const SectionAttr *SA = D->getAttr<SectionAttr>())
+ GV->setSection(SA->getName());
+
// Emit global variable debug information.
CGDebugInfo *DI = getDebugInfo();
if(DI) {
OpenPOWER on IntegriCloud