<div dir="ltr"><div class="gmail_default" style>Thanks for noting! Added in r172434.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 14, 2013 at 5:53 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><p dir="ltr"><br>
On Jan 14, 2013 5:42 AM, "Alexander Kornienko" <<a href="mailto:alexfh@google.com" target="_blank">alexfh@google.com</a>> wrote:<br>
><br>
> Author: alexfh<br>
> Date: Mon Jan 14 07:40:44 2013<br>
> New Revision: 172405<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=172405&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=172405&view=rev</a><br>
> Log:<br>
> Fix: correct file name in diagnostics.<br>
><br>
> Modified:<br>
> clang-tools-extra/trunk/clang-format/ClangFormat.cpp</p>
</div><p dir="ltr">Test case?</p><div class="HOEnZb"><div class="h5">
<p dir="ltr">><br>
> Modified: clang-tools-extra/trunk/clang-format/ClangFormat.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-format/ClangFormat.cpp?rev=172405&r1=172404&r2=172405&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-format/ClangFormat.cpp?rev=172405&r1=172404&r2=172405&view=diff</a><br>
> ==============================================================================<br>
> --- clang-tools-extra/trunk/clang-format/ClangFormat.cpp (original)<br>
> +++ clang-tools-extra/trunk/clang-format/ClangFormat.cpp Mon Jan 14 07:40:44 2013<br>
> @@ -44,10 +44,11 @@<br>
> namespace clang {<br>
> namespace format {<br>
><br>
> -static FileID createInMemoryFile(const MemoryBuffer *Source,<br>
> +static FileID createInMemoryFile(StringRef FileName, const MemoryBuffer *Source,<br>
> SourceManager &Sources, FileManager &Files) {<br>
> - const FileEntry *Entry =<br>
> - Files.getVirtualFile("<stdio>", Source->getBufferSize(), 0);<br>
> + const FileEntry *Entry = Files.getVirtualFile(FileName == "-" ? "<stdin>" :<br>
> + FileName,<br>
> + Source->getBufferSize(), 0);<br>
> Sources.overrideFileContents(Entry, Source, true);<br>
> return Sources.createFileID(Entry, SourceLocation(), SrcMgr::C_User);<br>
> }<br>
> @@ -63,7 +64,7 @@<br>
> llvm::errs() << ec.message() << "\n";<br>
> return;<br>
> }<br>
> - FileID ID = createInMemoryFile(Code.get(), Sources, Files);<br>
> + FileID ID = createInMemoryFile(FileName, Code.get(), Sources, Files);<br>
> Lexer Lex(ID, Sources.getBuffer(ID), Sources, getFormattingLangOpts());<br>
> SourceLocation Start =<br>
> Sources.getLocForStartOfFile(ID).getLocWithOffset(Offset);<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</p>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div><font color="#666666"><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(213,15,37);border-right-color:rgb(213,15,37);border-bottom-color:rgb(213,15,37);border-left-color:rgb(213,15,37);padding-top:2px;margin-top:2px">Alexander Kornienko |</span><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(51,105,232);border-right-color:rgb(51,105,232);border-bottom-color:rgb(51,105,232);border-left-color:rgb(51,105,232);padding-top:2px;margin-top:2px"> Software Engineer |</span></font><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(0,153,57);border-right-color:rgb(0,153,57);border-bottom-color:rgb(0,153,57);border-left-color:rgb(0,153,57);padding-top:2px;margin-top:2px"><font color="#666666"> </font><a href="mailto:alexfh@google.com" style="color:rgb(17,85,204)" target="_blank">alexfh@google.com</a> |</span><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(238,178,17);border-right-color:rgb(238,178,17);border-bottom-color:rgb(238,178,17);border-left-color:rgb(238,178,17);padding-top:2px;margin-top:2px"> <a value="+35315435283" style="color:rgb(17,85,204)">+49 151 221 77 957</a></span></div>
</div><div><font color="#666666"><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">Google Germany GmbH | </span><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">Dienerstr. 12 | </span><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">80331 München</span></font></div>
</div>