[PATCH] Allow Clang tools to display an overview when using the CommonOptionsParser.

Guillaume Papin guillaume.papin at epitech.eu
Fri Jul 19 03:07:24 PDT 2013


Hi klimek, revane,

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

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
@@ -64,7 +64,7 @@
   /// This constructor can change argc and argv contents, e.g. consume
   /// command-line options used for creating FixedCompilationDatabase.
   /// This constructor exits program in case of error.
-  CommonOptionsParser(int &argc, const char **argv);
+  CommonOptionsParser(int &argc, const char **argv, const char *Overview = 0);
 
   /// Returns a reference to the loaded compilations database.
   CompilationDatabase &getCompilations() {
Index: lib/Tooling/CommonOptionsParser.cpp
===================================================================
--- lib/Tooling/CommonOptionsParser.cpp
+++ lib/Tooling/CommonOptionsParser.cpp
@@ -53,16 +53,17 @@
     "\tsuffix of a path in the compile command database.\n"
     "\n";
 
-CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv) {
+CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv,
+                                         const char *Overview) {
   static cl::opt<std::string> BuildPath(
       "p", cl::desc("Build path"), cl::Optional);
 
   static cl::list<std::string> SourcePaths(
       cl::Positional, cl::desc("<source0> [... <sourceN>]"), cl::OneOrMore);
 
   Compilations.reset(FixedCompilationDatabase::loadFromCommandLine(argc,
                                                                    argv));
-  cl::ParseCommandLineOptions(argc, argv);
+  cl::ParseCommandLineOptions(argc, argv, Overview);
   SourcePathList = SourcePaths;
   if (!Compilations) {
     std::string ErrorMessage;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1185.1.patch
Type: text/x-patch
Size: 1730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130719/46671520/attachment.bin>


More information about the cfe-commits mailing list