[cfe-commits] r162798 - /cfe/trunk/lib/Tooling/CommonOptionsParser.cpp

Alexander Kornienko alexfh at google.com
Tue Aug 28 15:15:42 PDT 2012


Author: alexfh
Date: Tue Aug 28 17:15:41 2012
New Revision: 162798

URL: http://llvm.org/viewvc/llvm-project?rev=162798&view=rev
Log:
Only add common tool options when CommonOptionsParser is used.

Summary: Subj.

Reviewers: chandlerc, klimek, djasper

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D29

Modified:
    cfe/trunk/lib/Tooling/CommonOptionsParser.cpp

Modified: cfe/trunk/lib/Tooling/CommonOptionsParser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/CommonOptionsParser.cpp?rev=162798&r1=162797&r2=162798&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/CommonOptionsParser.cpp (original)
+++ cfe/trunk/lib/Tooling/CommonOptionsParser.cpp Tue Aug 28 17:15:41 2012
@@ -53,13 +53,13 @@
     "\tsuffix of a path in the compile command database.\n"
     "\n";
 
-static cl::opt<std::string> BuildPath(
-    "p", cl::desc("Build path"), cl::Optional);
+CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv) {
+  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);
+  static cl::list<std::string> SourcePaths(
+      cl::Positional, cl::desc("<source0> [... <sourceN>]"), cl::OneOrMore);
 
-CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv) {
   Compilations.reset(FixedCompilationDatabase::loadFromCommandLine(argc,
                                                                    argv));
   cl::ParseCommandLineOptions(argc, argv);





More information about the cfe-commits mailing list