From 30d69a5af91f3a558f0fd6edaf569970bb95f135 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sun, 18 Jul 2004 00:18:30 +0000 Subject: bug 122: - Replace ConstantPointerRef usage with GlobalValue usage - Minimize redundant isa usage - Correct isa for GlobalValue subclass llvm-svn: 14942 --- llvm/lib/Analysis/IPA/CallGraph.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Analysis/IPA/CallGraph.cpp') diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index 70bf2c496b0..72b4bdbc520 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/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(*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(*I)) { + for (Value::use_iterator I = GV->use_begin(), E = GV->use_end(); I != E; ++I) if (Instruction *Inst = dyn_cast(*I)) { if (isOnlyADirectCall(F, CallSite::get(Inst))) -- cgit v1.2.3