From 9a6779294fec14c6230931c745e2c3f078cead77 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 23 Jan 2013 00:21:06 +0000 Subject: Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind when adding a single attribute to the function. llvm-svn: 173211 --- clang/lib/CodeGen/CodeGenModule.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index aab21a2..0d4e098 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 -- cgit v1.1