I tried to use CallGraph in llvm by adding "AU.addRequired<CallGraph>();" in getAnalysisUsage function.
But it reports an error:
include/llvm/PassAnalysisSupport.h:56:39: error: ‘ID’ is not a member of ‘llvm::CallGraph’
How to use it correctly?
I believe you want to use CallGraphWrapperPass for this, as CallGraph itself isn't a pass. Correct me if I'm wrong.
Software Development Engineer
Oh, you're right. Thank you.
Another question: Given two CallGraphNodes (caller and callee) in CallGraph, How to map the edge in CallGraph to CallInst?