Hi:
I’m studying the add an optional argument with cl::opt and encountered a problem. In LLVM source code, there is a lto pass in WholeProgramDevirt.cpp with a cl::opt like below, and i add some codes to verify it.
static cl::opt
PrintSummaryDevirt(“wholeprogramdevirt-print-index-based”, cl::Hidden,
cl::init(false), cl::ZeroOrMore,
cl::desc(“Print index-based devirtualization messages”));
…
#codes for verifying
errs() <<“run\n”;
if (PrintSummaryDevirt) {
errs() <<" get \n";
}
errs() << “end\n”;
Can pass “wholeprogramdevirt-print-index-based” to the pass through clang?
i use command line below and found that PrintSummaryDevirt was not set to true.
…/build/bin/clang -mllvm -wholeprogramdevirt-print-index-based -flto -O3 a.c b.c -o out
…
output:
run
end
But the ideal output would be as follows,which means PrintSummaryDevirt was set to true.
run
get
end
So can i solve it?
Thanks