[cfe-commits] [clang-tools-extra] r172405 - /clang-tools-extra/trunk/clang-format/ClangFormat.cpp
Alexander Kornienko
alexfh at google.com
Mon Jan 14 09:02:33 PST 2013
Thanks for noting! Added in r172434.
On Mon, Jan 14, 2013 at 5:53 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
> On Jan 14, 2013 5:42 AM, "Alexander Kornienko" <alexfh at google.com> 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
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
--
Alexander Kornienko | Software Engineer | alexfh at google.com | +49 151 221
77 957
Google Germany GmbH | Dienerstr. 12 | 80331 München
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130114/dc8888ec/attachment.html>
More information about the cfe-commits
mailing list