<div dir="ltr">On Wed, Sep 11, 2013 at 1:07 PM, Yunzhong Gao <span dir="ltr"><<a href="mailto:Yunzhong_Gao@playstation.sony.com" target="_blank">Yunzhong_Gao@playstation.sony.com</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Hi Eli,<br>
Thanks for the hint. Looks like you already fixed #line directive in r189557. So what is left to fix is just the __FILE__ macro. I have updated my patch here.<br>
- Gao.<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D1291" target="_blank">http://llvm-reviews.chandlerc.com/D1291</a><br>
<br>
CHANGE SINCE LAST DIFF<br>
<a href="http://llvm-reviews.chandlerc.com/D1291?vs=3212&id=4207#toc" target="_blank">http://llvm-reviews.chandlerc.com/D1291?vs=3212&id=4207#toc</a><br>
<br>
Files:<br>
lib/Lex/PPMacroExpansion.cpp<br>
test/Preprocessor/line-directive-output.c<br>
<div class="im"><br>
Index: lib/Lex/PPMacroExpansion.cpp<br>
===================================================================<br>
--- lib/Lex/PPMacroExpansion.cpp<br>
+++ lib/Lex/PPMacroExpansion.cpp<br>
</div>@@ -1317,8 +1317,9 @@<br>
<div class="im"> SmallString<128> FN;<br>
if (PLoc.isValid()) {<br>
FN += PLoc.getFilename();<br>
- Lexer::Stringify(FN);<br>
</div>- OS << '"' << FN.str() << '"';<br>
+ OS << '"';<br>
+ OS.write_escaped(FN);<br>
+ OS << '"';<br>
}<br>
Tok.setKind(tok::string_literal);<br>
} else if (II == Ident__DATE__) {<br>
<div class="im">Index: test/Preprocessor/line-directive-output.c<br>
===================================================================<br>
--- test/Preprocessor/line-directive-output.c<br>
+++ test/Preprocessor/line-directive-output.c<br>
</div>@@ -76,3 +76,8 @@<br>
<br>
// CHECK: # 50 "a\n.c"<br>
# 50 "a\012.c"<br>
<div class="im">+<br>
+// CHECK: # 100 "\202\261\202\361\202\311\202\277\202\315.c"<br>
+// CHECK: filename = "\202\261\202\361\202\311\202\277\202\315.c";<br>
+# 100 "\202\261\202\361\202\311\202\277\202\315.c"<br>
+const char *filename = __FILE__;<br>
</div>\ No newline at end of file<br>
</blockquote></div><br></div><div class="gmail_extra">Missing newline?<br><br>Otherwise, LGTM.<br><br>-Eli<br></div></div>