aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-14 07:35:59 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-14 07:35:59 +0000
commitc416795feaaa2052f7b46fa7a3f9b6ec3751b1eb (patch)
treea480d12bd585e710db7b7c25f37ec10eac7ce1cd /lib/Transforms
parent432e606cf126e38f3f2a0a9f3348dfac34915bee (diff)
downloadexternal_llvm-c416795feaaa2052f7b46fa7a3f9b6ec3751b1eb.zip
external_llvm-c416795feaaa2052f7b46fa7a3f9b6ec3751b1eb.tar.gz
external_llvm-c416795feaaa2052f7b46fa7a3f9b6ec3751b1eb.tar.bz2
Remove the bitwise assignment OR operator from the Attributes class. Replace it with the equivalent from the builder class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165895 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp3
-rw-r--r--lib/Transforms/Scalar/ObjCARC.cpp25
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp6
3 files changed, 22 insertions, 12 deletions
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp
index 3e598ab..17cecbf 100644
--- a/lib/Transforms/IPO/PruneEH.cpp
+++ b/lib/Transforms/IPO/PruneEH.cpp
@@ -146,7 +146,8 @@ bool PruneEH::runOnSCC(CallGraphSCC &SCC) {
Function *F = (*I)->getFunction();
const AttrListPtr &PAL = F->getAttributes();
- const AttrListPtr &NPAL = PAL.addAttr(~0, Attributes::get(NewAttributes));
+ const AttrListPtr &NPAL = PAL.addAttr(F->getContext(), ~0,
+ Attributes::get(NewAttributes));
if (PAL != NPAL) {
MadeChange = true;
F->setAttributes(NPAL);
diff --git a/lib/Transforms/Scalar/ObjCARC.cpp b/lib/Transforms/Scalar/ObjCARC.cpp
index 629f9d2..ffeee75 100644
--- a/lib/Transforms/Scalar/ObjCARC.cpp
+++ b/lib/Transforms/Scalar/ObjCARC.cpp
@@ -1790,7 +1790,8 @@ Constant *ObjCARCOpt::getRetainRVCallee(Module *M) {
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
Attributes::Builder B;
B.addAttribute(Attributes::NoUnwind);
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
+ AttrListPtr Attributes = AttrListPtr().addAttr(M->getContext(), ~0u,
+ Attributes::get(B));
RetainRVCallee =
M->getOrInsertFunction("objc_retainAutoreleasedReturnValue", FTy,
Attributes);
@@ -1806,7 +1807,8 @@ Constant *ObjCARCOpt::getAutoreleaseRVCallee(Module *M) {
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
Attributes::Builder B;
B.addAttribute(Attributes::NoUnwind);
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
+ AttrListPtr Attributes = AttrListPtr().addAttr(M->getContext(), ~0u,
+ Attributes::get(B));
AutoreleaseRVCallee =
M->getOrInsertFunction("objc_autoreleaseReturnValue", FTy,
Attributes);
@@ -1820,7 +1822,8 @@ Constant *ObjCARCOpt::getReleaseCallee(Module *M) {
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
Attributes::Builder B;
B.addAttribute(Attributes::NoUnwind);
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
+ AttrListPtr Attributes = AttrListPtr().addAttr(M->getContext(), ~0u,
+ Attributes::get(B));
ReleaseCallee =
M->getOrInsertFunction(
"objc_release",
@@ -1836,7 +1839,8 @@ Constant *ObjCARCOpt::getRetainCallee(Module *M) {
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
Attributes::Builder B;
B.addAttribute(Attributes::NoUnwind);
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
+ AttrListPtr Attributes = AttrListPtr().addAttr(M->getContext(), ~0u,
+ Attributes::get(B));
RetainCallee =
M->getOrInsertFunction(
"objc_retain",
@@ -1867,7 +1871,8 @@ Constant *ObjCARCOpt::getAutoreleaseCallee(Module *M) {
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
Attributes::Builder B;
B.addAttribute(Attributes::NoUnwind);
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
+ AttrListPtr Attributes = AttrListPtr().addAttr(M->getContext(), ~0u,
+ Attributes::get(B));
AutoreleaseCallee =
M->getOrInsertFunction(
"objc_autorelease",
@@ -3845,8 +3850,8 @@ Constant *ObjCARCContract::getStoreStrongCallee(Module *M) {
Attributes::Builder BNoCapture;
BNoCapture.addAttribute(Attributes::NoCapture);
AttrListPtr Attributes = AttrListPtr()
- .addAttr(~0u, Attributes::get(BNoUnwind))
- .addAttr(1, Attributes::get(BNoCapture));
+ .addAttr(M->getContext(), ~0u, Attributes::get(BNoUnwind))
+ .addAttr(M->getContext(), 1, Attributes::get(BNoCapture));
StoreStrongCallee =
M->getOrInsertFunction(
@@ -3865,7 +3870,8 @@ Constant *ObjCARCContract::getRetainAutoreleaseCallee(Module *M) {
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
Attributes::Builder B;
B.addAttribute(Attributes::NoUnwind);
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
+ AttrListPtr Attributes = AttrListPtr().addAttr(M->getContext(), ~0u,
+ Attributes::get(B));
RetainAutoreleaseCallee =
M->getOrInsertFunction("objc_retainAutorelease", FTy, Attributes);
}
@@ -3880,7 +3886,8 @@ Constant *ObjCARCContract::getRetainAutoreleaseRVCallee(Module *M) {
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
Attributes::Builder B;
B.addAttribute(Attributes::NoUnwind);
- AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
+ AttrListPtr Attributes = AttrListPtr().addAttr(M->getContext(), ~0u,
+ Attributes::get(B));
RetainAutoreleaseRVCallee =
M->getOrInsertFunction("objc_retainAutoreleaseReturnValue", FTy,
Attributes);
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp
index e293250..831f94a 100644
--- a/lib/Transforms/Utils/CloneFunction.cpp
+++ b/lib/Transforms/Utils/CloneFunction.cpp
@@ -98,10 +98,12 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
Anew->addAttr( OldFunc->getAttributes()
.getParamAttributes(I->getArgNo() + 1));
NewFunc->setAttributes(NewFunc->getAttributes()
- .addAttr(0, OldFunc->getAttributes()
+ .addAttr(NewFunc->getContext(), 0,
+ OldFunc->getAttributes()
.getRetAttributes()));
NewFunc->setAttributes(NewFunc->getAttributes()
- .addAttr(~0, OldFunc->getAttributes()
+ .addAttr(NewFunc->getContext(), ~0,
+ OldFunc->getAttributes()
.getFnAttributes()));
}