[cfe-commits] r173229 - in /cfe/trunk/lib/CodeGen: CGCall.cpp CodeGenModule.cpp
Bill Wendling
isanbard at gmail.com
Tue Jan 22 22:15:10 PST 2013
Author: void
Date: Wed Jan 23 00:15:10 2013
New Revision: 173229
URL: http://llvm.org/viewvc/llvm-project?rev=173229&view=rev
Log:
Remove the last of uses that use the Attribute object as a collection of attributes.
Collections of attributes are handled via the AttributeSet class now. This
finally frees us up to make significant changes to how attributes are structured.
Modified:
cfe/trunk/lib/CodeGen/CGCall.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=173229&r1=173228&r2=173229&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Wed Jan 23 00:15:10 2013
@@ -1191,8 +1191,9 @@
// Name the struct return argument.
if (CGM.ReturnTypeUsesSRet(FI)) {
AI->setName("agg.result");
- AI->addAttr(llvm::Attribute::get(getLLVMContext(),
- llvm::Attribute::NoAlias));
+ AI->addAttr(llvm::AttributeSet::get(getLLVMContext(),
+ AI->getArgNo() + 1,
+ llvm::Attribute::NoAlias));
++AI;
}
@@ -1263,8 +1264,9 @@
llvm::Value *V = AI;
if (Arg->getType().isRestrictQualified())
- AI->addAttr(llvm::Attribute::get(getLLVMContext(),
- llvm::Attribute::NoAlias));
+ AI->addAttr(llvm::AttributeSet::get(getLLVMContext(),
+ AI->getArgNo() + 1,
+ llvm::Attribute::NoAlias));
// Ensure the argument is the correct type.
if (V->getType() != ArgI.getCoerceToType())
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=173229&r1=173228&r2=173229&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Wed Jan 23 00:15:10 2013
@@ -1965,9 +1965,12 @@
}
// Add any parameter attributes.
- llvm::Attribute pAttrs = oldAttrs.getParamAttributes(argNo + 1);
- if (pAttrs.hasAttributes())
- newAttrs.push_back(llvm::AttributeWithIndex::get(argNo + 1, pAttrs));
+ if (oldAttrs.hasAttributes(argNo + 1))
+ newAttrs.
+ push_back(llvm::AttributeWithIndex::
+ get(newFn->getContext(),
+ argNo + 1,
+ oldAttrs.getParamAttributes(argNo + 1)));
}
if (dontTransform)
continue;
More information about the cfe-commits
mailing list