diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-02-12 17:28:23 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-12 17:28:23 +0000 |
commit | 17f194f4393a67fd28ad822c06d32b8cb99bad3f (patch) | |
tree | 71021db67f33abb420953cb2925b894ed66009c8 /lib/CodeGen/CodeGenModule.cpp | |
parent | 3dcfe10a6801eb52f4c20f1242bea0a3a98aa146 (diff) |
Support __attribute__(section(<name>))
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 7b939e2970..7192e9db2f 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/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) { |