RefreshCallGraph: ignore 'invoke intrinsic'. IntrinsicInst doesnt not recognize invok...
authorNuno Lopes <nunoplopes@sapo.pt>
Fri, 29 Jun 2012 17:49:32 +0000 (17:49 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Fri, 29 Jun 2012 17:49:32 +0000 (17:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159441 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/IPA/CallGraphSCCPass.cpp

index 963da752343bee0a1914bb0151bf4af450159e1d..449b7ee87b1c4495da9a46a3835d191e4b7417ac 100644 (file)
@@ -246,7 +246,9 @@ bool CGPassManager::RefreshCallGraph(CallGraphSCC &CurSCC,
     for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
       for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
         CallSite CS(cast<Value>(I));
-        if (!CS || isa<IntrinsicInst>(I)) continue;
+        if (!CS) continue;
+        Function *Callee = CS.getCalledFunction();
+        if (Callee && Callee->isIntrinsic()) continue;
         
         // If this call site already existed in the callgraph, just verify it
         // matches up to expectations and remove it from CallSites.