diff options
author | Matt Beaumont-Gay <matthewbg@google.com> | 2012-12-14 17:55:15 +0000 |
---|---|---|
committer | Matt Beaumont-Gay <matthewbg@google.com> | 2012-12-14 17:55:15 +0000 |
commit | 6aed25d93d1cfcde5809a73ffa7dc1b0d6396f66 (patch) | |
tree | 57e2fdf1caf960d8d878e0289f32af6759832b49 /lib/Transforms | |
parent | 7139cfb19b1cc28dfd5e274c07ec68835bc6d6d6 (diff) | |
parent | 1ad9253c9d34ccbce3e7e4ea5d87c266cbf93410 (diff) |
Updating branches/google/stable to r169803
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/google/stable@170212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
110 files changed, 7014 insertions, 3615 deletions
diff --git a/lib/Transforms/Hello/Hello.cpp b/lib/Transforms/Hello/Hello.cpp index b0e22de8d7..d0b146b4e9 100644 --- a/lib/Transforms/Hello/Hello.cpp +++ b/lib/Transforms/Hello/Hello.cpp @@ -13,10 +13,10 @@ //===----------------------------------------------------------------------===// #define DEBUG_TYPE "hello" -#include "llvm/Pass.h" +#include "llvm/ADT/Statistic.h" #include "llvm/Function.h" +#include "llvm/Pass.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/ADT/Statistic.h" using namespace llvm; STATISTIC(HelloCounter, "Counts number of functions greeted"); diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp index 8a0274b5ff..2132e0a5fe 100644 --- a/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -31,21 +31,21 @@ #define DEBUG_TYPE "argpromotion" #include "llvm/Transforms/IPO.h" +#include "llvm/ADT/DepthFirstIterator.h" +#include "llvm/ADT/Statistic.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Analysis/CallGraph.h" +#include "llvm/CallGraphSCCPass.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" -#include "llvm/Module.h" -#include "llvm/CallGraphSCCPass.h" #include "llvm/Instructions.h" #include "llvm/LLVMContext.h" -#include "llvm/Analysis/AliasAnalysis.h" -#include "llvm/Analysis/CallGraph.h" -#include "llvm/Support/CallSite.h" +#include "llvm/Module.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/CallSite.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/ADT/DepthFirstIterator.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/ADT/StringExtras.h" #include <set> using namespace llvm; @@ -515,12 +515,12 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, // that we are *not* promoting. For the ones that we do promote, the parameter // attributes are lost SmallVector<AttributeWithIndex, 8> AttributesVec; - const AttrListPtr &PAL = F->getAttributes(); + const AttributeSet &PAL = F->getAttributes(); // Add any return attributes. Attributes attrs = PAL.getRetAttributes(); if (attrs.hasAttributes()) - AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::ReturnIndex, + AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::ReturnIndex, attrs)); // First, determine the new argument list @@ -593,7 +593,7 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, // Add any function attributes. attrs = PAL.getFnAttributes(); if (attrs.hasAttributes()) - AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::FunctionIndex, + AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex, attrs)); Type *RetTy = FTy->getReturnType(); @@ -611,7 +611,7 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, // Recompute the parameter attributes list based on the new arguments for // the function. - NF->setAttributes(AttrListPtr::get(AttributesVec)); + NF->setAttributes(AttributeSet::get(F->getContext(), AttributesVec)); AttributesVec.clear(); F->getParent()->getFunctionList().insert(F, NF); @@ -636,12 +636,12 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, CallSite CS(F->use_back()); assert(CS.getCalledFunction() == F); Instruction *Call = CS.getInstruction(); - const AttrListPtr &CallPAL = CS.getAttributes(); + const AttributeSet &CallPAL = CS.getAttributes(); // Add any return attributes. Attributes attrs = CallPAL.getRetAttributes(); if (attrs.hasAttributes()) - AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::ReturnIndex, + AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::ReturnIndex, attrs)); // Loop over the operands, inserting GEP and loads in the caller as @@ -723,7 +723,7 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, // Add any function attributes. attrs = CallPAL.getFnAttributes(); if (attrs.hasAttributes()) - AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::FunctionIndex, + AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex, attrs)); Instruction *New; @@ -731,11 +731,13 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F, New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(), Args, "", Call); cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv()); - cast<InvokeInst>(New)->setAttributes(AttrListPtr::get(AttributesVec)); + cast<InvokeInst>(New)->setAttributes(AttributeSet::get(II->getContext() |