Commit Graph

24 Commits

Author SHA1 Message Date
Nico Weber 10bf95d61b Follow-up to r207071: Let newFrontendActionFactory() return a unique_ptr.
This exposed a leak, fix that.

llvm-svn: 207396
2014-04-28 04:57:14 +00:00
Craig Topper 36835568d8 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 204002
2014-03-15 07:47:46 +00:00
Ahmed Charles b89843299a Replace OwningPtr with std::unique_ptr.
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.

llvm-svn: 203279
2014-03-07 20:03:18 +00:00
Craig Topper a798a9db93 Switch all uses of LLVM_OVERRIDE to just use 'override' directly.
llvm-svn: 202625
2014-03-02 09:32:10 +00:00
Chandler Carruth 5553d0d4ca Sort all the #include lines with LLVM's utils/sort_includes.py which
encodes the canonical rules for LLVM's style. I noticed this had drifted
quite a bit when cleaning up LLVM, so wanted to clean up Clang as well.

llvm-svn: 198686
2014-01-07 11:51:46 +00:00
Alexander Kornienko b5e774eb2c Filter-out irrelevant command-line options in CommonOptionsParser.
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
2013-12-12 09:59:42 +00:00
Reid Kleckner 898229ab4b [Driver] Refactor clang driver to use LLVM's Option library
The big changes are:
- Deleting Driver/(Arg|Opt)*
- Rewriting includes to llvm/Option/ and re-sorting
- 'using namespace llvm::opt' in clang::driver
- Fixing the autoconf build by adding option everywhere

As discussed in the review, this change includes using directives in
header files.  I'll make follow up changes to remove those in favor of
name specifiers.

Reviewers: espindola

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

llvm-svn: 183989
2013-06-14 17:17:23 +00:00
Pavel Labath c3282c0b3c Add support for static analysis to clang-check
Summary:
This adds a command line argument '-analyze' to clang-check which runs the
clang static analyzer on the source files.

Reviewers: klimek

CC: cfe-commits, revane

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

llvm-svn: 183399
2013-06-06 12:35:43 +00:00
Pavel Labath 951ad647a0 clang-check: Enable specification of additional compiler arguments
Summary:
This adds two command-line parameters: -extra-arg and -extra-arg-before, which
enable the user to pass additional parameters to the compiler command.

Reviewers: klimek

CC: cfe-commits

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

llvm-svn: 183320
2013-06-05 16:23:30 +00:00
NAKAMURA Takumi 8b517f1076 clang-check: Introduce llvm::sys::PrintStackTraceOnErrorSignal()
llvm-svn: 172818
2013-01-18 13:46:48 +00:00
Edwin Vane 524741fbbd 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

llvm-svn: 170229
2012-12-14 18:58:25 +00:00
Daniel Jasper 30abda1612 As opposed to the clang-fixit tool described on
http://clang.llvm.org/docs/ClangTools.html, this adds -fixit option to
clang-check. Thus, clang-check can become a general-purpose tool to run
clang capitalizing on the info stored in a compilation database.

Review: http://llvm-reviews.chandlerc.com/D51
llvm-svn: 165110
2012-10-03 13:28:43 +00:00
Alexander Kornienko 02f481c42f Workaround for MacOSX build failure with gcc <= 4.4
Summary:
A better solution to http://llvm.org/bugs/show_bug.cgi?id=13777
Named namespace + more unique name to make ODR violations unlikely.

Reviewers: chandlerc, doug.gregor, klimek

Reviewed By: doug.gregor

CC: cfe-commits

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

llvm-svn: 163513
2012-09-10 14:54:38 +00:00
Alexander Kornienko 767cd03bbe Fixed http://llvm.org/bugs/show_bug.cgi?id=13777
llvm-svn: 163429
2012-09-07 22:44:34 +00:00
Alexander Kornienko 4bcd58b87d Updated LibTooling.html, minor improvements in CommonOptionsParser
llvm-svn: 162521
2012-08-24 00:39:14 +00:00
Alexander Kornienko 01387267c7 Reverted clang-check to fully supported CommandLine Library use-case: global
static variables.

llvm-svn: 162391
2012-08-22 20:52:52 +00:00
Alexander Kornienko bf4871d363 Implemented -ast-dump, -ast-print, -ast-dump-filter options in clang-check
llvm-svn: 161753
2012-08-13 10:50:08 +00:00
Alexander Kornienko f2f82550fd The new clang-ast-dump tool for selective AST dumping. Moved common command-line tool stuff to CommandLineClangTool
llvm-svn: 160265
2012-07-16 12:46:48 +00:00
Alexander Kornienko 8480d420d3 Updated -help message in clang-check.
Summary: Provide more information on usage in -help

Test Plan: ran once

Reviewers: klimek, chandlerc, djasper

Reviewed By: klimek

CC: cfe-commits

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

llvm-svn: 160132
2012-07-12 14:34:23 +00:00
Daniel Jasper 1808bbedaf Fix usage instructions for clang-check.
llvm-svn: 160048
2012-07-11 15:05:24 +00:00
Arnaud A. de Grandmaison 617f5269c3 Adds support for auto-detection of compilation databases, looking in a directory and all its parents.
llvm-svn: 159998
2012-07-10 16:56:35 +00:00
Manuel Klimek 65fd0e1fd3 Adds support for auto-detection of compilation databases
from a source file and changes clang-check to make use of this.

This makes clang-check just work on in-tree builds, and allows
easy setup via a symlink per source directory to make clang-check
work without any extra configuration.

llvm-svn: 159990
2012-07-10 13:10:51 +00:00
Manuel Klimek ff26efceb4 Adds a FixedCompilationDatabase to be able to specify tool parameters
at the command line.

llvm-svn: 154989
2012-04-18 07:41:50 +00:00
Manuel Klimek 47c245a537 Adds a tooling library.
Provides an API to run clang tools (FrontendActions) as standalone tools,
or repeatedly in-memory in a process. This is useful for unit-testing,
map-reduce style applications, source transformation daemons or command line
tools.

The ability to run over multiple translation units with different command
line arguments enables building up refactoring tools that need to apply
transformations across translation unit boundaries.

See tools/clang-check/ClangCheck.cpp for an example.

llvm-svn: 154008
2012-04-04 12:07:46 +00:00