[cfe-commits] r170229 - in /cfe/trunk: docs/LibASTMatchersTutorial.rst docs/LibTooling.rst include/clang/Tooling/CommonOptionsParser.h lib/Tooling/CommonOptionsParser.cpp tools/clang-check/ClangCheck.cpp
Edwin Vane
edwin.vane at intel.com
Fri Dec 14 10:58:25 PST 2012
Author: revane
Date: Fri Dec 14 12:58:25 2012
New Revision: 170229
URL: http://llvm.org/viewvc/llvm-project?rev=170229&view=rev
Log:
Style and Doc fix for CommonOptionsParser
- 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
Modified:
cfe/trunk/docs/LibASTMatchersTutorial.rst
cfe/trunk/docs/LibTooling.rst
cfe/trunk/include/clang/Tooling/CommonOptionsParser.h
cfe/trunk/lib/Tooling/CommonOptionsParser.cpp
cfe/trunk/tools/clang-check/ClangCheck.cpp
Modified: cfe/trunk/docs/LibASTMatchersTutorial.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LibASTMatchersTutorial.rst?rev=170229&r1=170228&r2=170229&view=diff
==============================================================================
--- cfe/trunk/docs/LibASTMatchersTutorial.rst (original)
+++ cfe/trunk/docs/LibASTMatchersTutorial.rst Fri Dec 14 12:58:25 2012
@@ -145,8 +145,8 @@
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 @@
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;
Modified: cfe/trunk/docs/LibTooling.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LibTooling.rst?rev=170229&r1=170228&r2=170229&view=diff
==============================================================================
--- cfe/trunk/docs/LibTooling.rst (original)
+++ cfe/trunk/docs/LibTooling.rst Fri Dec 14 12:58:25 2012
@@ -68,7 +68,7 @@
// 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 @@
// 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 @@
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>());
}
Modified: cfe/trunk/include/clang/Tooling/CommonOptionsParser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/CommonOptionsParser.h?rev=170229&r1=170228&r2=170229&view=diff
==============================================================================
--- cfe/trunk/include/clang/Tooling/CommonOptionsParser.h (original)
+++ cfe/trunk/include/clang/Tooling/CommonOptionsParser.h Fri Dec 14 12:58:25 2012
@@ -53,8 +53,8 @@
///
/// 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 @@
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;
}
Modified: cfe/trunk/lib/Tooling/CommonOptionsParser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/CommonOptionsParser.cpp?rev=170229&r1=170228&r2=170229&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/CommonOptionsParser.cpp (original)
+++ cfe/trunk/lib/Tooling/CommonOptionsParser.cpp Fri Dec 14 12:58:25 2012
@@ -38,8 +38,8 @@
"\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"
Modified: cfe/trunk/tools/clang-check/ClangCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-check/ClangCheck.cpp?rev=170229&r1=170228&r2=170229&view=diff
==============================================================================
--- cfe/trunk/tools/clang-check/ClangCheck.cpp (original)
+++ cfe/trunk/tools/clang-check/ClangCheck.cpp Fri Dec 14 12:58:25 2012
@@ -143,8 +143,8 @@
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;
More information about the cfe-commits
mailing list