[PATCH] Added function to CommonOptionsParser to verify -- was included in the command line.

Ariel Bernal ariel.j.bernal at intel.com
Wed Aug 7 10:21:43 PDT 2013


Hi revane, tareqsiraj, Sarcasm,

Check if the compilation database was created from FixedCompilationDatabase.
This functionality is needed for checking if -- was used in the command line in the cpp11 migrator.

http://llvm-reviews.chandlerc.com/D1312

Files:
  include/clang/Tooling/CommonOptionsParser.h
  lib/Tooling/CommonOptionsParser.cpp

Index: include/clang/Tooling/CommonOptionsParser.h
===================================================================
--- include/clang/Tooling/CommonOptionsParser.h
+++ include/clang/Tooling/CommonOptionsParser.h
@@ -76,11 +76,16 @@
     return SourcePathList;
   }
 
+  bool fromFixedCompilationDatabase() {
+    return FromFixedCompilationDatabase;
+  }
+
   static const char *const HelpMessage;
 
 private:
   OwningPtr<CompilationDatabase> Compilations;
   std::vector<std::string> SourcePathList;
+  bool FromFixedCompilationDatabase;
 };
 
 }  // namespace tooling
Index: lib/Tooling/CommonOptionsParser.cpp
===================================================================
--- lib/Tooling/CommonOptionsParser.cpp
+++ lib/Tooling/CommonOptionsParser.cpp
@@ -63,6 +63,7 @@
 
   Compilations.reset(FixedCompilationDatabase::loadFromCommandLine(argc,
                                                                    argv));
+  FromFixedCompilationDatabase = Compilations != NULL;
   cl::ParseCommandLineOptions(argc, argv, Overview);
   SourcePathList = SourcePaths;
   if (!Compilations) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1312.1.patch
Type: text/x-patch
Size: 1102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130807/c362080e/attachment.bin>


More information about the cfe-commits mailing list