summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/CommonOptionsParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Apply some suggestions from clang-tidy's performance-unnecessary-value-param.Benjamin Kramer2016-06-151-1/+1
| | | | | | No functionality change intended. llvm-svn: 272789
* Print options, if requested.Alexander Kornienko2016-02-231-0/+2
| | | | llvm-svn: 261625
* Add fall-back mode for clang tools.Manuel Klimek2015-12-031-4/+7
| | | | | | | | | Run without flags if we cannot load a compilation database. This matches the behavior of clang itself when simply called with a source file. Based on a patch by Russell Wallace. llvm-svn: 254599
* Make ArgumentAdjuster aware of the current file being processed.Alexander Kornienko2015-11-051-1/+1
| | | | | | | | | | | | | | Summary: This is needed to handle per-project configurations when adding extra arguments in clang-tidy for example. Reviewers: klimek, djasper Subscribers: djasper, cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D14191 llvm-svn: 252134
* [clang-tidy] Make NumOccurrenceFlag for SourcePaths configurable.Alexander Kornienko2015-08-171-4/+7
| | | | | | | | | | | | Added an additional ctor that takes a NumOccurrenceFlag parameter for the SourcePaths option. This frees applications from always having to pass at least one source file, e.g., -list-checks. http://reviews.llvm.org/D12069 Patch by Don Hinton! llvm-svn: 245204
* [tooling] Move ArgumentsAdjustingCompilations into an anonymous namespace.Benjamin Kramer2015-03-231-0/+2
| | | | | | NFC. llvm-svn: 232947
* Adopt new cl::HideUnrelatedOptions API added r226729.Chris Bieneman2015-01-211-9/+1
| | | | | | | | | | | | Summary: cl::HideUnrelatedOptions allows tools to hide all options not part of a specific OptionCategory. This is the common use case for cl::getRegisteredOptions, which should be deprecated in the future because it exposes implementation details of command line parsing. Reviewers: dexonsmith Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D7109 llvm-svn: 226741
* Make ArgumentsAdjuster an std::function.Alexander Kornienko2014-12-031-8/+6
| | | | | | | | | | | | Reviewers: klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6505 llvm-svn: 223248
* [clang-tidy] Move -extra-arg handling to CommonOptionsProviderAlexander Kornienko2014-11-041-0/+57
| | | | | | | | | | | | | | | | | | Summary: Handle -extra-arg and -extra-arg-before options in the CommonOptionsProvider so they can be used in all clang tools. Adjust arguments in a CompilationDatabase wrapper instead of adding ArgumentsAdjuster to the tool. Reviewers: djasper, klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6073 llvm-svn: 221248
* CompilationDatabase: Sure-up ownership of compilation databases using ↵David Blaikie2014-08-081-4/+4
| | | | | | | | | | | | | std::unique_ptr Diving into the memory leaks fixed by r213851 there was one case of a memory leak of a CompilationDatabase due to not properly taking ownership of the result of "CompilationDatabase::autoDetectFromSource". Given that both implementations and callers have been using unique_ptr to own CompilationDatabase objects - make this explicit in the API to reduce the risk of further leaks. llvm-svn: 215215
* Filter-out irrelevant command-line options in CommonOptionsParser.Alexander Kornienko2013-12-121-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Leave only -help, -version and options from the specified category. Updated clang-check and clang-tidy. As clang-tidy is in a separate repository, here's the diff: Index: tools/extra/clang-tidy/tool/ClangTidyMain.cpp =================================================================== --- tools/extra/clang-tidy/tool/ClangTidyMain.cpp (revision 197024) +++ tools/extra/clang-tidy/tool/ClangTidyMain.cpp (working copy) @@ -39,7 +39,7 @@ // FIXME: Add option to list name/description of all checks. int main(int argc, const char **argv) { - CommonOptionsParser OptionsParser(argc, argv); + CommonOptionsParser OptionsParser(argc, argv, ClangTidyCategory); SmallVector<clang::tidy::ClangTidyError, 16> Errors; clang::tidy::runClangTidy(Checks, OptionsParser.getCompilations(), Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits, revane, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2379 llvm-svn: 197139
* Allow clang tools to display an overview when using the CommonOptionsParser.Manuel Klimek2013-07-191-2/+3
| | | | | | Patch by Guillaume Papin. llvm-svn: 186671
* Style and Doc fix for CommonOptionsParserEdwin Vane2012-12-141-2/+2
| | | | | | | | | | | | - 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 llvm-svn: 170229
* Only add common tool options when CommonOptionsParser is used.Alexander Kornienko2012-08-281-5/+5
| | | | | | | | | | | | | | Summary: Subj. Reviewers: chandlerc, klimek, djasper Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D29 llvm-svn: 162798
* Updated LibTooling.html, minor improvements in CommonOptionsParserAlexander Kornienko2012-08-241-1/+1
| | | | llvm-svn: 162521
* Reverted clang-check to fully supported CommandLine Library use-case: globalAlexander Kornienko2012-08-221-0/+79
static variables. llvm-svn: 162391
OpenPOWER on IntegriCloud