[cfe-commits] [clang-tools-extra] r172066 - /clang-tools-extra/trunk/clang-format/ClangFormat.cpp

Daniel Jasper djasper at google.com
Thu Jan 10 05:09:10 PST 2013


Author: djasper
Date: Thu Jan 10 07:09:09 2013
New Revision: 172066

URL: http://llvm.org/viewvc/llvm-project?rev=172066&view=rev
Log:
Let clang-format binary use same LangOpts as test.

Modified:
    clang-tools-extra/trunk/clang-format/ClangFormat.cpp

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=172066&r1=172065&r2=172066&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-format/ClangFormat.cpp (original)
+++ clang-tools-extra/trunk/clang-format/ClangFormat.cpp Thu Jan 10 07:09:09 2013
@@ -65,12 +65,7 @@
   }
   FileID ID = createInMemoryFile(Code.get(), Sources, Files);
   // FIXME: Pull this out into a common method and use here and in the tests.
-  LangOptions LangOpts;
-  LangOpts.CPlusPlus = 1;
-  LangOpts.CPlusPlus11 = 1;
-  LangOpts.ObjC1 = 1;
-  LangOpts.ObjC2 = 1;
-  Lexer Lex(ID, Sources.getBuffer(ID), Sources, LangOpts);
+  Lexer Lex(ID, Sources.getBuffer(ID), Sources, getFormattingLangOpts());
   SourceLocation Start =
       Sources.getLocForStartOfFile(ID).getLocWithOffset(Offset);
   SourceLocation End = Sources.getLocForEndOfFile(ID);





More information about the cfe-commits mailing list