Thanks for noting! Added in r172434.
On Mon, Jan 14, 2013 at 5:53 PM, David Blaikie <[email protected]> wrote: > > On Jan 14, 2013 5:42 AM, "Alexander Kornienko" <[email protected]> wrote: > > > > Author: alexfh > > Date: Mon Jan 14 07:40:44 2013 > > New Revision: 172405 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=172405&view=rev > > Log: > > Fix: correct file name in diagnostics. > > > > Modified: > > clang-tools-extra/trunk/clang-format/ClangFormat.cpp > > Test case? > > > > > Modified: clang-tools-extra/trunk/clang-format/ClangFormat.cpp > > URL: > http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-format/ClangFormat.cpp?rev=172405&r1=172404&r2=172405&view=diff > > > ============================================================================== > > --- clang-tools-extra/trunk/clang-format/ClangFormat.cpp (original) > > +++ clang-tools-extra/trunk/clang-format/ClangFormat.cpp Mon Jan 14 > 07:40:44 2013 > > @@ -44,10 +44,11 @@ > > namespace clang { > > namespace format { > > > > -static FileID createInMemoryFile(const MemoryBuffer *Source, > > +static FileID createInMemoryFile(StringRef FileName, const MemoryBuffer > *Source, > > SourceManager &Sources, FileManager > &Files) { > > - const FileEntry *Entry = > > - Files.getVirtualFile("<stdio>", Source->getBufferSize(), 0); > > + const FileEntry *Entry = Files.getVirtualFile(FileName == "-" ? > "<stdin>" : > > + FileName, > > + > Source->getBufferSize(), 0); > > Sources.overrideFileContents(Entry, Source, true); > > return Sources.createFileID(Entry, SourceLocation(), SrcMgr::C_User); > > } > > @@ -63,7 +64,7 @@ > > llvm::errs() << ec.message() << "\n"; > > return; > > } > > - FileID ID = createInMemoryFile(Code.get(), Sources, Files); > > + FileID ID = createInMemoryFile(FileName, Code.get(), Sources, Files); > > Lexer Lex(ID, Sources.getBuffer(ID), Sources, > getFormattingLangOpts()); > > SourceLocation Start = > > Sources.getLocForStartOfFile(ID).getLocWithOffset(Offset); > > > > > > _______________________________________________ > > cfe-commits mailing list > > [email protected] > > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > -- Alexander Kornienko | Software Engineer | [email protected] | +49 151 221 77 957 Google Germany GmbH | Dienerstr. 12 | 80331 München
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
