Closed aneesh-joshi closed 5 years ago
Something like:
for (auto& B : F) { // for each basic block in the Function
for (auto& I : B) { // for each Instruction in the Basic Block
if(isa<CallInst>(&I)) { // if the instruction is a call instruction
ImmutableCallSite CS(&I); // NOTSURE what this does
if (const Function *F = CS.getCalledFunction()) {// NOTSURE
errs() << " |-" << F->getName() << "\n";
}
}
Commit in - dd2f7f739fe17b6960c710f37573de39a2cc5592
It would be great if there was an explanation of what is going on in: https://github.com/chunhualiao/freeCompilerCamp/blob/master/compiler-classroom/_posts/2019-10-20-llvm-pass.markdown
In Section A.3