[llvm-commits] [llvm] r165468 - in /llvm/trunk/lib/Transforms: IPO/PruneEH.cpp Scalar/ObjCARC.cpp
Bill Wendling
isanbard at gmail.com
Mon Oct 8 17:47:36 PDT 2012
Author: void
Date: Mon Oct 8 19:47:36 2012
New Revision: 165468
URL: http://llvm.org/viewvc/llvm-project?rev=165468&view=rev
Log:
Convert to using the Attributes::Builder class to create attributes.
Modified:
llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp
Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=165468&r1=165467&r2=165468&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Mon Oct 8 19:47:36 2012
@@ -137,16 +137,16 @@
// If the SCC doesn't unwind or doesn't throw, note this fact.
if (!SCCMightUnwind || !SCCMightReturn)
for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
- Attributes NewAttributes = Attribute::None;
+ Attributes::Builder NewAttributes;
if (!SCCMightUnwind)
- NewAttributes |= Attribute::NoUnwind;
+ NewAttributes.addNoUnwindAttr();
if (!SCCMightReturn)
- NewAttributes |= Attribute::NoReturn;
+ NewAttributes.addNoReturnAttr();
Function *F = (*I)->getFunction();
const AttrListPtr &PAL = F->getAttributes();
- const AttrListPtr &NPAL = PAL.addAttr(~0, NewAttributes);
+ const AttrListPtr &NPAL = PAL.addAttr(~0, Attributes::get(NewAttributes));
if (PAL != NPAL) {
MadeChange = true;
F->setAttributes(NPAL);
Modified: llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp?rev=165468&r1=165467&r2=165468&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp Mon Oct 8 19:47:36 2012
@@ -1788,7 +1788,9 @@
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
Type *Params[] = { I8X };
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
+ Attributes::Builder B;
+ B.addNoUnwindAttr();
+ AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
RetainRVCallee =
M->getOrInsertFunction("objc_retainAutoreleasedReturnValue", FTy,
Attributes);
@@ -1802,7 +1804,9 @@
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
Type *Params[] = { I8X };
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
+ Attributes::Builder B;
+ B.addNoUnwindAttr();
+ AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
AutoreleaseRVCallee =
M->getOrInsertFunction("objc_autoreleaseReturnValue", FTy,
Attributes);
@@ -1814,7 +1818,9 @@
if (!ReleaseCallee) {
LLVMContext &C = M->getContext();
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
+ Attributes::Builder B;
+ B.addNoUnwindAttr();
+ AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
ReleaseCallee =
M->getOrInsertFunction(
"objc_release",
@@ -1828,7 +1834,9 @@
if (!RetainCallee) {
LLVMContext &C = M->getContext();
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
+ Attributes::Builder B;
+ B.addNoUnwindAttr();
+ AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
RetainCallee =
M->getOrInsertFunction(
"objc_retain",
@@ -1857,7 +1865,9 @@
if (!AutoreleaseCallee) {
LLVMContext &C = M->getContext();
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
+ Attributes::Builder B;
+ B.addNoUnwindAttr();
+ AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
AutoreleaseCallee =
M->getOrInsertFunction(
"objc_autorelease",
@@ -3830,9 +3840,10 @@
Type *I8XX = PointerType::getUnqual(I8X);
Type *Params[] = { I8XX, I8X };
- AttrListPtr Attributes = AttrListPtr()
- .addAttr(~0u, Attribute::NoUnwind)
- .addAttr(1, Attribute::NoCapture);
+ Attributes::Builder B;
+ B.addNoUnwindAttr();
+ B.addNoCaptureAttr();
+ AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
StoreStrongCallee =
M->getOrInsertFunction(
@@ -3849,7 +3860,9 @@
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
Type *Params[] = { I8X };
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
+ Attributes::Builder B;
+ B.addNoUnwindAttr();
+ AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
RetainAutoreleaseCallee =
M->getOrInsertFunction("objc_retainAutorelease", FTy, Attributes);
}
@@ -3862,7 +3875,9 @@
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
Type *Params[] = { I8X };
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
+ Attributes::Builder B;
+ B.addNoUnwindAttr();
+ AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
RetainAutoreleaseRVCallee =
M->getOrInsertFunction("objc_retainAutoreleaseReturnValue", FTy,
Attributes);
More information about the llvm-commits
mailing list