diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-08-06 00:03:29 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-08-06 00:03:29 +0000 |
commit | a735ad8be5536a1cd3e9817ec27dfeb2a0c1d5ca (patch) | |
tree | d9efb169e1fb1120f263c8dd38fff1ce85f59a42 /lib/Sema/SemaDecl.cpp | |
parent | fd54ebcaaf9a165846fdfafb32362238458e7f2d (diff) |
Implement GNU asm-label extension support in CodeGen. This fixes
scimark2 on Darwin.
- Added Sema support for asm-label on variables, which I forgot before.
- Update CodeGen to use GlobalDeclMap to determine if static Decls
require emission (instead of LLVM module name lookup). Important
since the Decl name and the LLVM module name can differ.
- <rdar://problem/6116729>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54388 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 19a2c28e26..b513dde466 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -808,6 +808,14 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) { // Handle attributes prior to checking for duplicates in MergeVarDecl ProcessDeclAttributes(NewVD, D); + // Handle GNU asm-label extension (encoded as an attribute). + if (Expr *E = (Expr*) D.getAsmLabel()) { + // The parser guarantees this is a string. + StringLiteral *SE = cast<StringLiteral>(E); + NewVD->addAttr(new AsmLabelAttr(std::string(SE->getStrData(), + SE->getByteLength()))); + } + // Emit an error if an address space was applied to decl with local storage. // This includes arrays of objects with address space qualifiers, but not // automatic variables that point to other address spaces. |