]> granicus.if.org Git - clang/commitdiff
Style and Doc fix for CommonOptionsParser
authorEdwin Vane <edwin.vane@intel.com>
Fri, 14 Dec 2012 18:58:25 +0000 (18:58 +0000)
committerEdwin Vane <edwin.vane@intel.com>
Fri, 14 Dec 2012 18:58:25 +0000 (18:58 +0000)
- Renaming GetCompilations() and GetSourcePathList() to follow LLVM
  style.
- Updating docs to reflect name change.
- Also updating help text to not mention clang-check since this class
  can be used by any tool.

Reviewed By: Alexander Kornienko

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170229 91177308-0d34-0410-b5e6-96231b3b80d8

docs/LibASTMatchersTutorial.rst
docs/LibTooling.rst
include/clang/Tooling/CommonOptionsParser.h
lib/Tooling/CommonOptionsParser.cpp
tools/clang-check/ClangCheck.cpp

index 21d26897f359811374f237ab6c776d052b7ea529..3d0af67cb5fd6240496f81376ef14d897658a3e9 100644 (file)
@@ -145,8 +145,8 @@ documentation <LibTooling.html>`_.
 
       int main(int argc, const char **argv) {
         CommonOptionsParser OptionsParser(argc, argv);
-        ClangTool Tool(OptionsParser.GetCompilations(),
-                       OptionsParser.GetSourcePathList());
+        ClangTool Tool(OptionsParser.getCompilations(),
+                       OptionsParser.getSourcePathList());
         return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>());
       }
 
@@ -279,8 +279,8 @@ And change ``main()`` to:
 
       int main(int argc, const char **argv) {
         CommonOptionsParser OptionsParser(argc, argv);
-        ClangTool Tool(OptionsParser.GetCompilations(),
-                       OptionsParser.GetSourcePathList());
+        ClangTool Tool(OptionsParser.getCompilations(),
+                       OptionsParser.getSourcePathList());
 
         LoopPrinter Printer;
         MatchFinder Finder;
index d9c17f681ea1f1ecac5faf91eb288533be970f2f..8c2a126fcc7a749dc31df41c50da5243da688713 100644 (file)
@@ -68,7 +68,7 @@ and automatic location of the compilation database using source files paths.
     // CompilationDatabase.  In case of error it will terminate the program.
     CommonOptionsParser OptionsParser(argc, argv);
 
-    // Use OptionsParser.GetCompilations() and OptionsParser.GetSourcePathList()
+    // Use OptionsParser.getCompilations() and OptionsParser.getSourcePathList()
     // to retrieve CompilationDatabase and the list of input file paths.
   }
 
@@ -88,7 +88,7 @@ our ``FrontendAction`` over some code.  For example, to run the
 
   // We hand the CompilationDatabase we created and the sources to run over into
   // the tool constructor.
-  ClangTool Tool(OptionsParser.GetCompilations(), Sources);
+  ClangTool Tool(OptionsParser.getCompilations(), Sources);
 
   // The ClangTool needs a new FrontendAction for each translation unit we run
   // on.  Thus, it takes a FrontendActionFactory as parameter.  To create a
@@ -125,8 +125,8 @@ tool is also checked into the clang tree at
 
   int main(int argc, const char **argv) {
     CommonOptionsParser OptionsParser(argc, argv);
-    ClangTool Tool(OptionsParser.GetCompilations(),
-    OptionsParser.GetSourcePathList());
+    ClangTool Tool(OptionsParser.getCompilations(),
+    OptionsParser.getSourcePathList());
     return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>());
   }
 
index a1bad1269d80edefde68111ab103cb49dddae431..d313773d3d448a0b78530e988d7dc37b205e3b77 100644 (file)
@@ -53,8 +53,8 @@ namespace tooling {
 ///
 /// int main(int argc, const char **argv) {
 ///   CommonOptionsParser OptionsParser(argc, argv);
-///   ClangTool Tool(OptionsParser.GetCompilations(),
-///                  OptionsParser.GetSourcePathListi());
+///   ClangTool Tool(OptionsParser.getCompilations(),
+///                  OptionsParser.getSourcePathListi());
 ///   return Tool.run(newFrontendActionFactory<clang::SyntaxOnlyAction>());
 /// }
 /// \endcode
@@ -67,12 +67,12 @@ public:
   CommonOptionsParser(int &argc, const char **argv);
 
   /// Returns a reference to the loaded compilations database.
-  CompilationDatabase &GetCompilations() {
+  CompilationDatabase &getCompilations() {
     return *Compilations;
   }
 
   /// Returns a list of source file paths to process.
-  std::vector<std::string> GetSourcePathList() {
+  std::vector<std::string> getSourcePathList() {
     return SourcePathList;
   }
 
index 15091c7e901e044e71721d0e0c7ebb2f64325e0a..99aff9f4e973d6133fd1e56cd5119a84524dabf8 100644 (file)
@@ -38,8 +38,8 @@ const char *const CommonOptionsParser::HelpMessage =
     "\tFor example, it can be a CMake build directory in which a file named\n"
     "\tcompile_commands.json exists (use -DCMAKE_EXPORT_COMPILE_COMMANDS=ON\n"
     "\tCMake option to get this output). When no build path is specified,\n"
-    "\tclang-check will attempt to locate it automatically using all parent\n"
-    "\tpaths of the first input file. See:\n"
+    "\ta search for compile_commands.json will be attempted through all\n"
+    "\tparent paths of the first input file . See:\n"
     "\thttp://clang.llvm.org/docs/HowToSetupToolingForLLVM.html for an\n"
     "\texample of setting up Clang Tooling on a source tree.\n"
     "\n"
index 6c081ac0769e4f0f4a2586d9bc0fabf9c449e991..6f62228ffa8a8a8097386b74efb17eed2dfaaae3 100644 (file)
@@ -143,8 +143,8 @@ public:
 
 int main(int argc, const char **argv) {
   CommonOptionsParser OptionsParser(argc, argv);
-  ClangTool Tool(OptionsParser.GetCompilations(),
-                 OptionsParser.GetSourcePathList());
+  ClangTool Tool(OptionsParser.getCompilations(),
+                 OptionsParser.getSourcePathList());
   if (Fixit)
     return Tool.run(newFrontendActionFactory<FixItAction>());
   clang_check::ClangCheckActionFactory Factory;