diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-31 13:45:49 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-31 13:45:49 +0000 |
commit | b4c9d9c51fcb8a4cad2336b1ad9d225f504bbc4c (patch) | |
tree | 67ecf73ff1ee68f388a77b5960f50c9ad95a62bb /lib/Transforms/IPO | |
parent | e03d9e4ec7037526b94ce91985e7ff82ebc069fa (diff) | |
download | external_llvm-b4c9d9c51fcb8a4cad2336b1ad9d225f504bbc4c.zip external_llvm-b4c9d9c51fcb8a4cad2336b1ad9d225f504bbc4c.tar.gz external_llvm-b4c9d9c51fcb8a4cad2336b1ad9d225f504bbc4c.tar.bz2 |
Replace some instances of UniqueVector with SetVector, which is slightly cheaper.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r-- | lib/Transforms/IPO/FunctionAttrs.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp index d8f374c..18409f7 100644 --- a/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/lib/Transforms/IPO/FunctionAttrs.cpp @@ -28,9 +28,9 @@ #include "llvm/Analysis/CallGraph.h" #include "llvm/Analysis/CaptureTracking.h" #include "llvm/ADT/SCCIterator.h" +#include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/Statistic.h" -#include "llvm/ADT/UniqueVector.h" #include "llvm/Support/InstIterator.h" using namespace llvm; @@ -486,13 +486,13 @@ bool FunctionAttrs::AddNoCaptureAttrs(const CallGraphSCC &SCC) { /// or a pointer that doesn't alias any other pointer visible to the caller. bool FunctionAttrs::IsFunctionMallocLike(Function *F, SmallPtrSet<Function*, 8> &SCCNodes) const { - UniqueVector<Value *> FlowsToReturn; + SmallSetVector<Value *, 8> FlowsToReturn; for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) if (ReturnInst *Ret = dyn_cast<ReturnInst>(I->getTerminator())) FlowsToReturn.insert(Ret->getReturnValue()); for (unsigned i = 0; i != FlowsToReturn.size(); ++i) { - Value *RetVal = FlowsToReturn[i+1]; // UniqueVector[0] is reserved. + Value *RetVal = FlowsToReturn[i]; if (Constant *C = dyn_cast<Constant>(RetVal)) { if (!C->isNullValue() && !isa<UndefValue>(C)) |