<div dir="ltr">Ah, sorry I had to run off for a meeting. Yes, I was able to finally fix this. For anyone else who hits it, you can "git reset --hard" back to the CL before the initial change. Then you can "git pull" to move past the issue. Thanks for fixing this.<div><br></div><div>Steve</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 24, 2017 at 4:35 PM, Keane, Erich <span dir="ltr"><<a href="mailto:erich.keane@intel.com" target="_blank">erich.keane@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-2587035792871898659WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Alright, final update.  Thanks to some fantastic help on #llvm, I believe this is fixed.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Stephen: You may have to do some shenanigans to fix your local stuff, but the monorepo and another repo both seem to work.  Sorry for this everyone :/<u></u><u></u></span></p>
<p class="MsoNormal"><a name="m_-2587035792871898659__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></a></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Stephen Hines [mailto:<a href="mailto:srhines@google.com" target="_blank">srhines@google.com</a>]
<br><span class="">
<b>Sent:</b> Thursday, August 24, 2017 3:18 PM<br>
<b>To:</b> Keane, Erich <<a href="mailto:erich.keane@intel.com" target="_blank">erich.keane@intel.com</a>><br>
<b>Cc:</b> cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>><br>
</span><b>Subject:</b> Re: r311683 - [Preprocessor] Correct internal token parsing of newline characters in CRLF<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">This change seems to have broken the git mirrors, as I can no longer check out clang without having a merge conflict as git alters the line endings. Setting core.autocrlf to false doesn't help either. Does anyone have any idea how to fix
 this svn <-> git issue?<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Steve<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Thu, Aug 24, 2017 at 11:36 AM, Erich Keane via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Author: erichkeane<br>
Date: Thu Aug 24 11:36:07 2017<br>
New Revision: 311683<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=311683&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-<wbr>project?rev=311683&view=rev</a><br>
Log:<br>
[Preprocessor] Correct internal token parsing of newline characters in CRLF<br>
<br>
Discovered due to a goofy git setup, the test system-headerline-directive.c<br>
(and a few others) failed because the token-consumption will consume only the<br>
'\r' in CRLF, making the preprocessor's printed value give the wrong line number<br>
when returning from an include. For example:<br>
<br>
(line 1):#include <noline.h>\r\n<br>
<br>
The "file exit" code causes the printer to try to print the 'returned to the<br>
main file' line. It looks up what the current line number is. However, since the<br>
current 'token' is the '\n' (since only the \r was consumed), it will give the<br>
line number as '1", not '2'. This results in a few failed tests, but more<br>
importantly, results in error messages being incorrect when compiling a<br>
previously preprocessed file.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D37079" target="_blank">
https://reviews.llvm.org/<wbr>D37079</a><br>
<br>
Added:<br>
    cfe/trunk/test/Frontend/.<wbr>gitattributes<br>
    cfe/trunk/test/Frontend/<wbr>system-header-line-directive-<wbr>ms-lineendings.c   (with props)<br>
Modified:<br>
    cfe/trunk/lib/Lex/Lexer.cpp<br>
<br>
Modified: cfe/trunk/lib/Lex/Lexer.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Lexer.cpp?rev=311683&r1=311682&r2=311683&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Lex/<wbr>Lexer.cpp?rev=311683&r1=<wbr>311682&r2=311683&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Lex/Lexer.cpp (original)<br>
+++ cfe/trunk/lib/Lex/Lexer.cpp Thu Aug 24 11:36:07 2017<br>
@@ -3073,6 +3073,8 @@ LexNextToken:<br>
<br>
   case '\n':<br>
   case '\r':<br>
+    if (CurPtr[0] != Char && (CurPtr[0] == '\n' || CurPtr[0] == '\r'))<br>
+      Char = getAndAdvanceChar(CurPtr, Result);<br>
     // If we are inside a preprocessor directive and we see the end of line,<br>
     // we know we are done with the directive, so return an EOD token.<br>
     if (ParsingPreprocessorDirective) {<br>
<br>
Added: cfe/trunk/test/Frontend/.<wbr>gitattributes<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/.gitattributes?rev=311683&view=auto" target="_blank">
http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>Frontend/.gitattributes?rev=<wbr>311683&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/Frontend/.<wbr>gitattributes (added)<br>
+++ cfe/trunk/test/Frontend/.<wbr>gitattributes Thu Aug 24 11:36:07 2017<br>
@@ -0,0 +1,2 @@<br>
+# Below test validates crlf line endings, so it should stay crlf.<br>
+system-header-line-directive-<wbr>ms-lineendings.c text eol=crlf<br>
<br>
Added: cfe/trunk/test/Frontend/<wbr>system-header-line-directive-<wbr>ms-lineendings.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/system-header-line-directive-ms-lineendings.c?rev=311683&view=auto" target="_blank">
http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>Frontend/system-header-line-<wbr>directive-ms-lineendings.c?<wbr>rev=311683&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/Frontend/<wbr>system-header-line-directive-<wbr>ms-lineendings.c (added)<br>
+++ cfe/trunk/test/Frontend/<wbr>system-header-line-directive-<wbr>ms-lineendings.c Thu Aug 24 11:36:07 2017<br>
@@ -0,0 +1,21 @@<br>
+// RUN: %clang_cc1 %s -E -o - -I %S/Inputs -isystem %S/Inputs/SystemHeaderPrefix | FileCheck %s<br>
+#include <noline.h><br>
+#include <line-directive-in-system.h><br>
+<br>
+#include "line-directive.h"<br>
+<br>
+// This tests that the line numbers for the current file are correctly outputted<br>
+// for the include-file-completed test case.<br>
+<br>
+// CHECK: # 1 "{{.*}}system-header-line-<wbr>directive-ms-lineendings.c" 2<br>
+// CHECK: # 1 "{{.*}}noline.h" 1 3<br>
+// CHECK: foo();<br>
+// CHECK: # 3 "{{.*}}system-header-line-<wbr>directive-ms-lineendings.c" 2<br>
+// CHECK: # 1 "{{.*}}line-directive-in-<wbr>system.h" 1 3<br>
+//      The "3" below indicates that "foo.h" is considered a system header.<br>
+// CHECK: # 1 "foo.h" 3<br>
+// CHECK: foo();<br>
+// CHECK: # 4 "{{.*}}system-header-line-<wbr>directive-ms-lineendings.c" 2<br>
+// CHECK: # 1 "{{.*}}line-directive.h" 1<br>
+// CHECK: # 10 "foo.h"{{$}}<br>
+// CHECK: # 6 "{{.*}}system-header-line-<wbr>directive-ms-lineendings.c" 2<br>
<br>
Propchange: cfe/trunk/test/Frontend/<wbr>system-header-line-directive-<wbr>ms-lineendings.c<br>
------------------------------<wbr>------------------------------<wbr>------------------<br>
    svn:eol-style = CRLF<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>