Summary:
This is immediately useful for generating macro expansion notes, and
may be useful for other things later on.
Reviewers: klimek, djasper
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2950
llvm-svn: 203457
Summary: Peter, I guess, this can help you in testing your check.
Reviewers: djasper, pcc, klimek
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2989
llvm-svn: 203451
Summary:
Added a naive NOLINT implementation. It doesn't care about specific
linter categories, just the "// NOLINT" on the same line as a diagnostic.
Reviewers: klimek
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2896
llvm-svn: 202452
Summary:
Pass check names all the way from ClangTidyModule through
ClangTidyCheck and ClangTidyContext to ClangTidyError, and output it in
handleErrors. This allows to find mis-behaving check and disable it easily.
Reviewers: djasper, klimek
Reviewed By: djasper
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2534
llvm-svn: 199094
ScalarSafeChars array in Output::scalarString (See YAMLTraits.cpp line 554 as
of r196428), this test will fail: The path will be single quoted to preserve
the 'unsafe' characters, which doesn't match the expected (unquoted) output.
Notionally "unsafe" characters include fairly innocuous ones like the '+'
symbol (I don't know enough YAML to be sure, but I suspect '+' doesn't really
need to be quoted).
I have added some sed lines to strip leading spaces, and leading and trailing
single quote (') characters from the path. That should make this test slightly
more robust.
If possible, this test should be rewritten to use FileCheck, rather than
diffing against expected output - the latter is likely to brittle, and require
further sed goop in the future.
llvm-svn: 196439
This is implemented in a way that the current static analyzer
architecture allows, in the future we might want to revisit this.
With this change static analyzer checks are available from clang-tidy
by specifying -checks=clang-analyzer-<name>.
This change also fixes the use of the compilation database to allow
clang-tidy to be used like any other clang tool.
llvm-svn: 194707
This tool is for interactive exploration of the Clang AST using AST matchers.
It currently allows the user to enter a matcher at an interactive prompt
and view the resulting bindings as diagnostics, AST pretty prints or AST
dumps. Example session:
$ cat foo.c
void foo(void) {}
$ clang-query foo.c --
clang-query> match functionDecl()
Match #1:
foo.c:1:1: note: "root" binds here
void foo(void) {}
^~~~~~~~~~~~~~~~~
1 match.
Differential Revision: http://llvm-reviews.chandlerc.com/D2098
llvm-svn: 194227
Summary:
The clang-apply-replacements process is now invoked to apply
replacements between applying transforms. This resulted in a massive
simplification of the tool:
- FileOverrides class no longer needed.
- Change tracking and code formatting no longer needed.
- No more dependency on libclangApplyReplacements.
- Final syntax check is easier to do directly now than with a separate
header/source pair.
Replacement handling stuff abstracted into a new header/source pair to
de-clutter ClangModernize.cpp somewhat.
Tests updated.
Differential Revision: http://llvm-reviews.chandlerc.com/D1836
llvm-svn: 192032
The tool now supports a collection of arguments to turn on and provide settings
for the formatting of code affected by applying replacements:
* --format turns on formatting (default style is LLVM)
* --style controls code style settings
* --style-config allows one to explicitly indicate where a style config file
lives.
The libclangApplyReplacements interface has a new function to turn Replacements
into Ranges to be used with tooling::reformat().
llvm-svn: 191667
This patch also fixes the case where a compilation database is autodetected from
source but the file itself cannot be found in the compilation database, it then
ignores the compilation database and transforms the file with c++11 support.
llvm-svn: 191213
- Limit the transform to const-ref and non-const value parameters only.
- Do not generate a replacement when the type is already a value.
See CM-139 for the bugs corresponding to this issue.
llvm-svn: 190212