<div dir="ltr">Nadav, I did not add any additional logic for sys::path in fact. I just used sys::path::is_absolute() method for my lcal purpose:<div><br></div><div><span style="color:rgb(0,0,0);font-family:Menlo,Consolas,Monaco,monospace;font-size:11px;letter-spacing:0.008333399891853333px;line-height:16px;white-space:pre-wrap;background-color:rgb(170,255,170)">if (sys::path::is_absolute(FileName))</span><br>
</div><div><span style="color:rgb(0,0,0);font-family:Menlo,Consolas,Monaco,monospace;font-size:11px;letter-spacing:0.008333399891853333px;line-height:16px;white-space:pre-wrap;background-color:rgb(170,255,170)"><br></span></div>
<div><span style="color:rgb(0,0,0);font-family:Menlo,Consolas,Monaco,monospace;font-size:11px;letter-spacing:0.008333399891853333px;line-height:16px;white-space:pre-wrap;background-color:rgb(170,255,170)">So I don't see anything to add to sys::path.</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-26 1:57 GMT+04:00 Nadav Rotem <span dir="ltr"><<a href="mailto:nrotem@apple.com" target="_blank">nrotem@apple.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I don’t think that the logic for getting the absolute path is not unique to the vectorizer. Can you place it in sys::path ?<br>
<br>
Thanks,<br>
Nadav<br>
<div><div class="h5"><br>
<br>
On Apr 25, 2014, at 9:05 AM, Zinovy Nis <<a href="mailto:zinovy.nis@gmail.com">zinovy.nis@gmail.com</a>> wrote:<br>
<br>
> Hi echristo, nadav,<br>
><br>
> If a loop was defined in a file referenced by an absolute path (for ex. STL header from the system dir), then DEBUG print would print module dir and then that absolute path, which is wrong.<br>
><br>
>  LV: Checking a loop in "Foo" from /home/myhome//usr/lib/gcc/z42_128-greencap-linux/1.2.3/../../../../include/c++/9.8.7/bits/list.tcc:171<br>
><br>
><br>
> The correct behavior is to just print the absolute path and skip module dir.<br>
><br>
>  LV: Checking a loop in "Foo" from /usr/lib/gcc/z42_128-greencap-linux/1.2.3/../../../../include/c++/9.8.7/bits/list.tcc:171<br>
><br>
> <a href="http://reviews.llvm.org/D3513" target="_blank">http://reviews.llvm.org/D3513</a><br>
><br>
> Files:<br>
>  lib/Transforms/Vectorize/LoopVectorize.cpp<br>
><br>
> Index: lib/Transforms/Vectorize/LoopVectorize.cpp<br>
> ===================================================================<br>
> --- lib/Transforms/Vectorize/LoopVectorize.cpp<br>
> +++ lib/Transforms/Vectorize/LoopVectorize.cpp<br>
> @@ -84,6 +84,7 @@<br>
> #include "llvm/Support/CommandLine.h"<br>
> #include "llvm/Support/Debug.h"<br>
> #include "llvm/Support/Format.h"<br>
> +#include "llvm/Support/Path.h"<br>
> #include "llvm/Support/raw_ostream.h"<br>
> #include "llvm/Target/TargetLibraryInfo.h"<br>
> #include "llvm/Transforms/Scalar.h"<br>
> @@ -493,8 +494,12 @@<br>
>   }<br>
>   const DILocation Loc(N);<br>
>   const unsigned LineNo = Loc.getLineNumber();<br>
> -  const char *DirName = Loc.getDirectory().data();<br>
>   const char *FileName = Loc.getFilename().data();<br>
> +  // Absolute path doesn't need DirName.<br>
> +  if (sys::path::is_absolute(FileName))<br>
> +    return format<const char *, const char *, unsigned>("%s%s:%u", "", FileName,<br>
> +                                                        LineNo);<br>
> +  const char *DirName = Loc.getDirectory().data();<br>
>   return format("%s/%s:%u", DirName, FileName, LineNo);<br>
> }<br>
> #endif<br>
</div></div>> <D3513.8849.patch><br>
<br>
</blockquote></div><br></div>