<div dir="ltr">Hi,<br><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
I would say "yes". Let's not rely on linemarkers, unless we can explain why that's a good idea.<br>
<br></blockquote><div><br></div><div>Sounds reasonable to me, specially considering cases like r<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">ename and find-declaration.</span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Where do virtual files come from in the first place?<br>
<br></blockquote><div><br></div><div>From the linemarker: <a href="https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html">https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html</a></div><div><br></div><div>For instance: </div><div><br></div><div><div>$ cat foo.c</div><div><br></div><div>int f(int a);</div><div><br></div><div># 1 "file1.c" 1</div><div>int g(int b);</div></div><div><br></div><div>clang generates:</div><div><br></div><div><div>|-FunctionDecl 0x6866ff0 <foo.c:2:1, col:12> col:5 f 'int (int)'</div><div>| `-ParmVarDecl 0x6866f30 <col:7, col:11> col:11 a 'int'</div><div>`-FunctionDecl 0x6867138 <file1.c:1:1, col:12> col:5 g 'int (int)'</div><div>  `-ParmVarDecl 0x68670b0 <col:7, col:11> col:11 b 'int'</div></div><div><br></div><div>Note that the location of f and g are different, despite being in the same file.</div><div><br></div><div>The preprocessor inserts linemarkers by default:</div><div><br></div><div>$ clang foo.c -E</div><div># 1 "foo.c"</div><div># 1 "<built-in>" 1</div><div># 1 "<built-in>" 3</div><div># 349 "<built-in>" 3</div><div># 1 "<command line>" 1</div><div># 1 "<built-in>" 2</div><div># 1 "foo.c" 2</div><div><br></div><div>int f(int a);</div><div><br></div><div><br></div><div># 1 "file1.c" 1</div><div>int g(int b);</div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">unless you call it with -P:</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><div>$ clang foo.c -E -P</div><div><br></div><div>int f(int a);</div><div><br></div><div><br></div><div>int g(int b);</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px"><br></div></span></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Repository:<br>
  rC Clang<br>
<br>
<a href="https://reviews.llvm.org/D42966" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D42966</a><br>
<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><br></div><div>Mikhail Ramalho.</div></div></div>
</div></div>