Author: nico
Date: Sat May 14 16:20:23 2011
New Revision: 131367

URL: http://llvm.org/viewvc/llvm-project?rev=131367&view=rev
Log:
Let clang-check actually use the Directory entry in the json file.

Modified:
    cfe/trunk/examples/Tooling/ClangCheck.cpp
    cfe/trunk/lib/Tooling/JsonCompileCommandLineDatabase.h

Modified: cfe/trunk/examples/Tooling/ClangCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/Tooling/ClangCheck.cpp?rev=131367&r1=131366&r2=131367&view=diff
==============================================================================
--- cfe/trunk/examples/Tooling/ClangCheck.cpp (original)
+++ cfe/trunk/examples/Tooling/ClangCheck.cpp Sat May 14 16:20:23 2011
@@ -93,6 +93,12 @@
         clang::tooling::FindCompileArgsInJsonDatabase(
             File.str(), JsonDatabase->getBuffer(), ErrorMessage);
     if (!LookupResult.CommandLine.empty()) {
+      if (LookupResult.Directory.size()) {
+        // FIXME: What should happen if CommandLine includes -working-directory
+        // as well?
+        LookupResult.CommandLine.push_back(
+            "-working-directory=" + LookupResult.Directory);
+      }
       if (!clang::tooling::RunToolWithFlags(
                new clang::SyntaxOnlyAction,
                LookupResult.CommandLine.size(),

Modified: cfe/trunk/lib/Tooling/JsonCompileCommandLineDatabase.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/JsonCompileCommandLineDatabase.h?rev=131367&r1=131366&r2=131367&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/JsonCompileCommandLineDatabase.h (original)
+++ cfe/trunk/lib/Tooling/JsonCompileCommandLineDatabase.h Sat May 14 16:20:23 
2011
@@ -78,7 +78,7 @@
                                CompileCommandHandler *CommandHandler);
 
   /// \brief Parses the specified input. Returns true if no parsing errors were
-  /// foudn.
+  /// found.
   bool Parse();
 
   /// \brief Returns an error message if Parse() returned false previously.


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to