X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FTransforms%2FIPO%2FFunctionAttrs.cpp;h=109ef16872abc1e8cb870b1a0d208ef20ae5354b;hp=cfeedf6d1db999cfeefb66540f01a8f29523882e;hb=848219ca612e5488982f23c37c7459aeedff77e3;hpb=1f97273f8fb2e51080ef2c7a9cd867d0d0ccf8a0 diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp index cfeedf6d1db..109ef16872a 100644 --- a/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/lib/Transforms/IPO/FunctionAttrs.cpp @@ -72,7 +72,6 @@ private: bool AddReadAttrs(const CallGraphSCC &SCC); bool AddArgumentAttrs(const CallGraphSCC &SCC); - bool IsFunctionMallocLike(Function *F, SmallPtrSet &) const; bool AddNoAliasAttrs(const CallGraphSCC &SCC); bool AddNonNullAttrs(const CallGraphSCC &SCC); bool annotateLibraryCalls(const CallGraphSCC &SCC); @@ -682,8 +681,8 @@ bool FunctionAttrs::AddArgumentAttrs(const CallGraphSCC &SCC) { /// /// A function is "malloc-like" if it returns either null or a pointer that /// doesn't alias any other pointer visible to the caller. -bool FunctionAttrs::IsFunctionMallocLike( - Function *F, SmallPtrSet &SCCNodes) const { +static bool isFunctionMallocLike(Function *F, + SmallPtrSet &SCCNodes) { SmallSetVector FlowsToReturn; for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) if (ReturnInst *Ret = dyn_cast(I->getTerminator())) @@ -777,7 +776,7 @@ bool FunctionAttrs::AddNoAliasAttrs(const CallGraphSCC &SCC) { if (!F->getReturnType()->isPointerTy()) continue; - if (!IsFunctionMallocLike(F, SCCNodes)) + if (!isFunctionMallocLike(F, SCCNodes)) return false; }