<div dir="ltr">I'm attempting to profile a C++ program by building like so:<div><br></div><div>clang++ -pg foo.cc -o foo<br></div><div><br></div><div style>According to the LLVM 3.0 release notes, this is supported:</div>
<div><br></div>"The optimizer and code generator now supports gprof and gcov-style coverage and profiling information, and includes a new llvm-cov tool (but also works with gcov). Clang exposes coverage and profiling through GCC-compatible command line options."<br>
<div><br></div><div style>(see <a href="http://llvm.org/releases/3.0/docs/ReleaseNotes.html">http://llvm.org/releases/3.0/docs/ReleaseNotes.html</a> )</div><div style><br></div><div style>However, running foo does not produce gmon.out. Replacing clang++ with g++ (and changing nothing else) does produce gmon.out with expected contents.</div>
<div style><br></div><div style>$ clang++ --version</div><div style><div>clang version 3.2 (tags/RELEASE_32/final)</div><div>Target: x86_64-pc-linux-gnu</div><div>Thread model: posix</div><div><br></div><div style>This clang++ was built from the release 3.2 source with default configuration.</div>
<div><br></div><div style>Any clues on what might be wrong?</div><div style><br></div><div style>Thanks,</div><div style>Sean</div></div></div>