diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-07-18 00:18:30 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-07-18 00:18:30 +0000 |
commit | e840434755e2165ac20ec55e9d5ff3d2defac2d2 (patch) | |
tree | 546353c849d6137556b5dfb7e90d317a7c37b42c /lib/Analysis/IPA/CallGraph.cpp | |
parent | e0125b678539029091e70695cf4219ec2c297a25 (diff) |
bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14942 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r-- | lib/Analysis/IPA/CallGraph.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp index 70bf2c496b..72b4bdbc52 100644 --- a/lib/Analysis/IPA/CallGraph.cpp +++ b/lib/Analysis/IPA/CallGraph.cpp @@ -73,10 +73,8 @@ void CallGraph::addToCallGraph(Function *F) { getNodeFor(Inst->getParent()->getParent())->addCalledFunction(Node); else isUsedExternally = true; - } else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(*I)) { - // THIS IS A DISGUSTING HACK. Brought to you by the power of - // ConstantPointerRefs! - for (Value::use_iterator I = CPR->use_begin(), E = CPR->use_end(); + } else if (GlobalValue *GV = dyn_cast<GlobalValue>(*I)) { + for (Value::use_iterator I = GV->use_begin(), E = GV->use_end(); I != E; ++I) if (Instruction *Inst = dyn_cast<Instruction>(*I)) { if (isOnlyADirectCall(F, CallSite::get(Inst))) |