aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-12 23:32:54 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-12 23:32:54 +0000
commit30510abee628c645285e01cfd4779610d46a822c (patch)
treea147693681e3011d02ca9dca42fcfc6d57ed7f28 /lib/CodeGen/CGDecl.cpp
parent3855b9a8f05d3f6aba14dcd9aff3147eb8ff57bd (diff)
Honor attribute section on static block var decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64411 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r--lib/CodeGen/CGDecl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index dad50fcec4..a32b78dedb 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -126,6 +126,7 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) {
GV = GenerateStaticBlockVarDecl(D, false, ".",
llvm::GlobalValue::InternalLinkage);
+ // FIXME: Merge attribute handling.
if (const AnnotateAttr *AA = D.getAttr<AnnotateAttr>()) {
SourceManager &SM = CGM.getContext().getSourceManager();
llvm::Constant *Ann =
@@ -134,6 +135,9 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) {
CGM.AddAnnotation(Ann);
}
+ if (const SectionAttr *SA = D.getAttr<SectionAttr>())
+ GV->setSection(SA->getName());
+
const llvm::Type *LTy = CGM.getTypes().ConvertTypeForMem(D.getType());
const llvm::Type *LPtrTy =
llvm::PointerType::get(LTy, D.getType().getAddressSpace());