================ @@ -19,20 +19,38 @@ namespace llvm { // Visitor class that finds all indirect call. struct PGOIndirectCallVisitor : public InstVisitor<PGOIndirectCallVisitor> { std::vector<CallBase *> IndirectCalls; + std::vector<Instruction *> VTableAddrs; PGOIndirectCallVisitor() = default; void visitCallBase(CallBase &Call) { if (Call.isIndirectCall()) - IndirectCalls.push_back(&Call); + if (Call.isIndirectCall()) { + IndirectCalls.push_back(&Call); + + LoadInst *LI = dyn_cast<LoadInst>(Call.getCalledOperand()); ---------------- modiking wrote:
Taking a dependency on `-fwhole-program-vtables` for this does mean instrumentation fails when the flag is not enabled. Might make sense to detect this scenario and warn/message to the user that this is happening. https://github.com/llvm/llvm-project/pull/66825 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits