[cfe-commits] r173211 - in /cfe/trunk/lib/CodeGen: CodeGenModule.cpp TargetInfo.cpp
Bill Wendling
isanbard at gmail.com
Tue Jan 22 16:21:06 PST 2013
Author: void
Date: Tue Jan 22 18:21:06 2013
New Revision: 173211
URL: http://llvm.org/viewvc/llvm-project?rev=173211&view=rev
Log:
Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.
Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/CodeGen/TargetInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=173211&r1=173210&r2=173211&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Jan 22 18:21:06 2013
@@ -1257,8 +1257,13 @@
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
Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=173211&r1=173210&r2=173211&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Tue Jan 22 18:21:06 2013
@@ -1019,8 +1019,10 @@
// Now add the 'alignstack' attribute with a value of 16.
llvm::AttrBuilder B;
B.addStackAlignmentAttr(16);
- Fn->addAttribute(llvm::AttributeSet::FunctionIndex,
- llvm::Attribute::get(CGM.getLLVMContext(), B));
+ Fn->addAttributes(llvm::AttributeSet::FunctionIndex,
+ llvm::AttributeSet::get(CGM.getLLVMContext(),
+ llvm::AttributeSet::FunctionIndex,
+ B));
}
}
}
More information about the cfe-commits
mailing list