diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-02-12 23:32:54 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-12 23:32:54 +0000 |
commit | 53bf7412087ad1b7d1f66bb4a35291740738f241 (patch) | |
tree | 25e4acbb5c6c1b23573002952a6e53d789b85bb3 /clang/lib/CodeGen | |
parent | baca6ed65e4dfe10b6685625786790c7015a9fd3 (diff) | |
download | bcm5719-llvm-53bf7412087ad1b7d1f66bb4a35291740738f241.tar.gz bcm5719-llvm-53bf7412087ad1b7d1f66bb4a35291740738f241.zip |
Honor attribute section on static block var decls.
llvm-svn: 64411
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index dad50fcec40..a32b78dedb9 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/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()); |