diff options
Diffstat (limited to 'llvm/include/llvm/Analysis/LazyCallGraph.h')
-rw-r--r-- | llvm/include/llvm/Analysis/LazyCallGraph.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/llvm/include/llvm/Analysis/LazyCallGraph.h b/llvm/include/llvm/Analysis/LazyCallGraph.h index 81500905c0f5..148be34aa73b 100644 --- a/llvm/include/llvm/Analysis/LazyCallGraph.h +++ b/llvm/include/llvm/Analysis/LazyCallGraph.h @@ -1098,28 +1098,10 @@ public: continue; } - // The blockaddress constant expression is a weird special case, we can't - // generically walk its operands the way we do for all other constants. - if (BlockAddress *BA = dyn_cast<BlockAddress>(C)) { - // If we've already visited the function referred to by the block - // address, we don't need to revisit it. - if (Visited.count(BA->getFunction())) - continue; - - // If all of the blockaddress' users are instructions within the - // referred to function, we don't need to insert a cycle. - if (llvm::all_of(BA->users(), [&](User *U) { - if (Instruction *I = dyn_cast<Instruction>(U)) - return I->getFunction() == BA->getFunction(); - return false; - })) - continue; - - // Otherwise we should go visit the referred to function. - Visited.insert(BA->getFunction()); - Worklist.push_back(BA->getFunction()); + // blockaddresses are weird and don't participate in the call graph anyway, + // skip them. + if (isa<BlockAddress>(C)) continue; - } for (Value *Op : C->operand_values()) if (Visited.insert(cast<Constant>(Op)).second) |