diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-23 00:21:06 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-23 00:21:06 +0000 |
commit | 9a6779294fec14c6230931c745e2c3f078cead77 (patch) | |
tree | 8b578043890f50d7ee2e5ebfbbde5d4c87319f92 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | c0e2a1f4575520fcf1b202c838250d2623e23cd2 (diff) | |
download | bcm5719-llvm-9a6779294fec14c6230931c745e2c3f078cead77.tar.gz bcm5719-llvm-9a6779294fec14c6230931c745e2c3f078cead77.zip |
Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.
llvm-svn: 173211
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index aab21a2efbc..0d4e0981d0b 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1257,8 +1257,13 @@ CodeGenModule::GetOrCreateLLVMFunction(StringRef MangledName, assert(F->getName() == MangledName && "name was uniqued!"); if (D.getDecl()) SetFunctionAttributes(D, F, IsIncompleteFunction); - if (ExtraAttrs.hasAttributes()) - F->addAttribute(llvm::AttributeSet::FunctionIndex, ExtraAttrs); + if (ExtraAttrs.hasAttributes()) { + llvm::AttrBuilder B(ExtraAttrs); + F->addAttributes(llvm::AttributeSet::FunctionIndex, + llvm::AttributeSet::get(VMContext, + llvm::AttributeSet::FunctionIndex, + B)); + } // This is the first use or definition of a mangled name. If there is a // deferred decl with this name, remember that we need to emit it at the end |