aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-15 20:35:56 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-15 20:35:56 +0000
commit702cc91aa1bd41540e8674921ae7ac89a4ff061f (patch)
treeee8a1af757a2e912b5286e98b5dcaf48c7b4861a /lib/Transforms
parent874c0a6ec70edb80d76eafb86c6a35053e7acb48 (diff)
Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/IPO/DeadArgumentElimination.cpp6
-rw-r--r--lib/Transforms/IPO/FunctionAttrs.cpp4
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp2
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp2
-rw-r--r--lib/Transforms/InstCombine/InstCombineCalls.cpp6
-rw-r--r--lib/Transforms/Scalar/CodeGenPrepare.cpp4
-rw-r--r--lib/Transforms/Scalar/ObjCARC.cpp18
-rw-r--r--lib/Transforms/Scalar/SimplifyLibCalls.cpp2
8 files changed, 22 insertions, 22 deletions
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp
index a7ff182dac..fc22548db7 100644
--- a/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -765,10 +765,10 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
// required when new return value attributes are added.
if (NRetTy->isVoidTy())
RAttrs =
- Attributes::get(NRetTy->getContext(), Attributes::Builder(RAttrs).
+ Attributes::get(NRetTy->getContext(), AttrBuilder(RAttrs).
removeAttributes(Attributes::typeIncompatible(NRetTy)));
else
- assert(!Attributes::Builder(RAttrs).
+ assert(!AttrBuilder(RAttrs).
hasAttributes(Attributes::typeIncompatible(NRetTy)) &&
"Return attributes no longer compatible?");
@@ -840,7 +840,7 @@ bool DAE::RemoveDeadStuffFromFunction(Function *F) {
Attributes FnAttrs = CallPAL.getFnAttributes();
// Adjust in case the function was changed to return void.
RAttrs =
- Attributes::get(NF->getContext(), Attributes::Builder(RAttrs).
+ Attributes::get(NF->getContext(), AttrBuilder(RAttrs).
removeAttributes(Attributes::typeIncompatible(NF->getReturnType())));
if (RAttrs.hasAttributes())
AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::ReturnIndex,
diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp
index 9fe42f074a..d8f374c330 100644
--- a/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -212,7 +212,7 @@ bool FunctionAttrs::AddReadAttrs(const CallGraphSCC &SCC) {
MadeChange = true;
// Clear out any existing attributes.
- Attributes::Builder B;
+ AttrBuilder B;
B.addAttribute(Attributes::ReadOnly)
.addAttribute(Attributes::ReadNone);
F->removeAttribute(AttrListPtr::FunctionIndex,
@@ -357,7 +357,7 @@ bool FunctionAttrs::AddNoCaptureAttrs(const CallGraphSCC &SCC) {
ArgumentGraph AG;
- Attributes::Builder B;
+ AttrBuilder B;
B.addAttribute(Attributes::NoCapture);
// Check each function in turn, determining which pointer arguments are not
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index d4eeafa859..6468ff3276 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -2062,7 +2062,7 @@ static void ChangeCalleesToFastCall(Function *F) {
}
static AttrListPtr StripNest(LLVMContext &C, const AttrListPtr &Attrs) {
- Attributes::Builder B;
+ AttrBuilder B;
B.addAttribute(Attributes::Nest);
for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) {
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp
index b5252aac84..fb4ecbfe7b 100644
--- a/lib/Transforms/IPO/PruneEH.cpp
+++ b/lib/Transforms/IPO/PruneEH.cpp
@@ -137,7 +137,7 @@ bool PruneEH::runOnSCC(CallGraphSCC &SCC) {
// 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::Builder NewAttributes;
+ AttrBuilder NewAttributes;
if (!SCCMightUnwind)
NewAttributes.addAttribute(Attributes::NoUnwind);
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 44ddf3be34..5ad6f9111c 100644
--- a/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -1007,7 +1007,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
return false; // Cannot transform this return value.
if (!CallerPAL.isEmpty() && !Caller->use_empty()) {
- Attributes::Builder RAttrs = CallerPAL.getRetAttributes();
+ AttrBuilder RAttrs = CallerPAL.getRetAttributes();
if (RAttrs.hasAttributes(Attributes::typeIncompatible(NewRetTy)))
return false; // Attribute not compatible with transformed value.
}
@@ -1038,7 +1038,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
return false; // Cannot transform this parameter value.
Attributes Attrs = CallerPAL.getParamAttributes(i + 1);
- if (Attributes::Builder(Attrs).
+ if (AttrBuilder(Attrs).
hasAttributes(Attributes::typeIncompatible(ParamTy)))
return false; // Attribute not compatible with transformed value.
@@ -1109,7 +1109,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
attrVec.reserve(NumCommonArgs);
// Get any return attributes.
- Attributes::Builder RAttrs = CallerPAL.getRetAttributes();
+ AttrBuilder RAttrs = CallerPAL.getRetAttributes();
// If the return value is not being used, the type may not be compatible
// with the existing attributes. Wipe out any problematic attributes.
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp
index 665d5b0171..4d8176bc6c 100644
--- a/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -774,9 +774,9 @@ bool CodeGenPrepare::DupRetToEnableTailCallOpts(ReturnInst *RI) {
// Conservatively require the attributes of the call to match those of the
// return. Ignore noalias because it doesn't affect the call sequence.
Attributes CalleeRetAttr = CS.getAttributes().getRetAttributes();
- if (Attributes::Builder(CalleeRetAttr).
+ if (AttrBuilder(CalleeRetAttr).
removeAttribute(Attributes::NoAlias) !=
- Attributes::Builder(CallerRetAttr).
+ AttrBuilder(CallerRetAttr).
removeAttribute(Attributes::NoAlias))
continue;
diff --git a/lib/Transforms/Scalar/ObjCARC.cpp b/lib/Transforms/Scalar/ObjCARC.cpp
index 017df8f1a4..e18208d4a5 100644
--- a/lib/Transforms/Scalar/ObjCARC.cpp
+++ b/lib/Transforms/Scalar/ObjCARC.cpp
@@ -1788,7 +1788,7 @@ Constant *ObjCARCOpt::getRetainRVCallee(Module *M) {
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
Type *Params[] = { I8X };
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
- Attributes::Builder B;
+ AttrBuilder B;
B.addAttribute(Attributes::NoUnwind);
AttrListPtr Attributes =
AttrListPtr().addAttr(M->getContext(), AttrListPtr::FunctionIndex,
@@ -1806,7 +1806,7 @@ Constant *ObjCARCOpt::getAutoreleaseRVCallee(Module *M) {
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
Type *Params[] = { I8X };
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
- Attributes::Builder B;
+ AttrBuilder B;
B.addAttribute(Attributes::NoUnwind);
AttrListPtr Attributes =
AttrListPtr().addAttr(M->getContext(), AttrListPtr::FunctionIndex,
@@ -1822,7 +1822,7 @@ Constant *ObjCARCOpt::getReleaseCallee(Module *M) {
if (!ReleaseCallee) {
LLVMContext &C = M->getContext();
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
- Attributes::Builder B;
+ AttrBuilder B;
B.addAttribute(Attributes::NoUnwind);
AttrListPtr Attributes =
AttrListPtr().addAttr(M->getContext(), AttrListPtr::FunctionIndex,
@@ -1840,7 +1840,7 @@ Constant *ObjCARCOpt::getRetainCallee(Module *M) {
if (!RetainCallee) {
LLVMContext &C = M->getContext();
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
- Attributes::Builder B;
+ AttrBuilder B;
B.addAttribute(Attributes::NoUnwind);
AttrListPtr Attributes =
AttrListPtr().addAttr(M->getContext(), AttrListPtr::FunctionIndex,
@@ -1873,7 +1873,7 @@ Constant *ObjCARCOpt::getAutoreleaseCallee(Module *M) {
if (!AutoreleaseCallee) {
LLVMContext &C = M->getContext();
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
- Attributes::Builder B;
+ AttrBuilder B;
B.addAttribute(Attributes::NoUnwind);
AttrListPtr Attributes =
AttrListPtr().addAttr(M->getContext(), AttrListPtr::FunctionIndex,
@@ -3850,9 +3850,9 @@ Constant *ObjCARCContract::getStoreStrongCallee(Module *M) {
Type *I8XX = PointerType::getUnqual(I8X);
Type *Params[] = { I8XX, I8X };
- Attributes::Builder BNoUnwind;
+ AttrBuilder BNoUnwind;
BNoUnwind.addAttribute(Attributes::NoUnwind);
- Attributes::Builder BNoCapture;
+ AttrBuilder BNoCapture;
BNoCapture.addAttribute(Attributes::NoCapture);
AttrListPtr Attributes = AttrListPtr()
.addAttr(M->getContext(), AttrListPtr::FunctionIndex,
@@ -3874,7 +3874,7 @@ Constant *ObjCARCContract::getRetainAutoreleaseCallee(Module *M) {
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
Type *Params[] = { I8X };
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
- Attributes::Builder B;
+ AttrBuilder B;
B.addAttribute(Attributes::NoUnwind);
AttrListPtr Attributes =
AttrListPtr().addAttr(M->getContext(), AttrListPtr::FunctionIndex,
@@ -3891,7 +3891,7 @@ Constant *ObjCARCContract::getRetainAutoreleaseRVCallee(Module *M) {
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
Type *Params[] = { I8X };
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
- Attributes::Builder B;
+ AttrBuilder B;
B.addAttribute(Attributes::NoUnwind);
AttrListPtr Attributes =
AttrListPtr().addAttr(M->getContext(), AttrListPtr::FunctionIndex,
diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
index e751750986..0223d39ab3 100644
--- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp
+++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
@@ -348,7 +348,7 @@ struct StrToOpt : public LibCallOptimization {
if (isa<ConstantPointerNull>(EndPtr)) {
// With a null EndPtr, this function won't capture the main argument.
// It would be readonly too, except that it still may write to errno.
- Attributes::Builder B;
+ AttrBuilder B;
B.addAttribute(Attributes::NoCapture);
CI->addAttribute(1, Attributes::get(Callee->getContext(), B));
}