<div dir="ltr">I was using spec-run where the command line has the pathless filename.<div><br></div><div>The source in Atam's command-line has the absolute path. </div><div>In meta-data creation, we used Module's getSourceFileName() which has the source name appeared in the command line (in this case, a full patch name).</div><div><br></div><div>While in Clang's setFuncName, it uses CGM.getCodeGenOpts().MainFileName. This string strips the path from the source.</div><div><br></div><div>I can expand function createPGOFuncNameMetadata() to handle this (I mean using the stripped name).</div><div><br></div><div>But I need to point out that stripping the patch may not a good idea as it greatly increases the change name conflicts:</div><div>If we have</div><div>static bar() in dir1/foo.c</div><div>and</div><div>static bar() in dir2/foo.c</div><div><br></div><div>if the user compiler with: </div><div>> clang ... dir1/foo.c </div><div>> clang ... dir2/foo.c</div><div>With Clang's scheme, both functions would have PGOFuncName of foo.c:bar().</div><div>In IR instrumentation, we will have different name in this case:</div><div>dir1/foo.c:bar(), and dir2/foo.c:bar()</div><div><br></div><div>Of course, if the user compiles the code the following way:</div><div>> cd dir1; clang foo.c</div><div>>cd ../dir2; clang foo.c</div><div>we will have conflict for both instrumentation.</div><div>In this case, we can suggestion the user to have the relative path in the build line.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 21, 2016 at 11:23 AM, Adam Nemet <span dir="ltr"><<a href="mailto:anemet@apple.com" target="_blank">anemet@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">anemet added a comment.<br>
<span class=""><br>
> How did you build povray?<br>
<br>
> can you show me your command line in building (for example, csg.cpp) for<br>
<br>
> both--fprofile-instr-use and -fprofile-instr-generate?<br>
<br>
<br>
</span>Sent it in an email.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D18624" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18624</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>