Commit Graph

578 Commits

Author SHA1 Message Date
Alexander Kornienko 33a0bce133 Deduplicate clang-tidy error messages by file, offset and message.
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
2014-03-10 09:45:49 +00:00
Ahmed Charles 6a2dc5c381 [C++11] Replace OwningPtr with std::unique_ptr.
This removes all references to OwningPtr, which should be fairly
undisruptive to out-of-tree projects since they are unlikely to use
clang-tools-extra as a library instead of a set of tools.

llvm-svn: 203382
2014-03-09 09:24:40 +00:00
NAKAMURA Takumi 67101a52de clang-tools-extra/test/pp-trace/pp-trace-modules.cpp: Flush module cache to let robust around r203317.
llvm-svn: 203369
2014-03-09 04:10:17 +00:00
NAKAMURA Takumi dc979e8c2c clang-tools-extra/test/pp-trace/pp-trace-modules.cpp: Use [[@LINE]].
llvm-svn: 203368
2014-03-09 04:10:05 +00:00
Alexander Kornienko 95cd50f6d1 Use the appropriate operator<< instead of addRanges.
llvm-svn: 203118
2014-03-06 13:24:28 +00:00
Alexander Kornienko df1e3cb157 Use range-based for loops for better readability. No functional changes intended.
Reviewers: chandlerc

Reviewed By: chandlerc

CC: cfe-commits

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

llvm-svn: 203101
2014-03-06 10:17:46 +00:00
Alexander Kornienko b4a8079bf0 Use more specific checks filter in the test.
llvm-svn: 203097
2014-03-06 08:31:03 +00:00
Alexander Kornienko 9de3a98c4e Fixed a crash when handling diagnostics without a valid file location, e.g. 'error reading <file>'.
llvm-svn: 202987
2014-03-05 15:44:36 +00:00
Alexander Kornienko 16ac6cebcf Added a module for checks not related to LLVM or Google coding style.
llvm-svn: 202970
2014-03-05 13:14:32 +00:00
Alexander Kornienko 21f3b77707 Fixed formatting.
llvm-svn: 202969
2014-03-05 13:01:24 +00:00
Chandler Carruth edc9e38810 [cleanup] Re-sort headers with llvm/utils/sort_includes.py.
llvm-svn: 202809
2014-03-04 10:03:05 +00:00
Alexander Kornienko 7c9b29f525 Normalized the usage of override in the doc.
llvm-svn: 202710
2014-03-03 13:36:30 +00:00
Craig Topper 6d73f449b8 Determine support for colored output from stdout instead of stderr since that's where the diagnostics go.
llvm-svn: 202680
2014-03-03 07:37:42 +00:00
Ahmed Charles de61d0edad [C++11] Add #include's for OwningPtr.
Allows removing #include's in LLVM while switching to std::unique_ptr.

llvm-svn: 202676
2014-03-03 07:00:47 +00:00
Peter Collingbourne b17a3b3d33 Add a level parameter to ClangTidyCheck::diag.
The goal is to make it possible for checks to emit diagnostics at levels
other than 'warning'.

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

llvm-svn: 202668
2014-03-02 23:34:48 +00:00
Dmitri Gribenko 23077e3e0a Documentation comments: fix incorrect usage of \param
llvm-svn: 202649
2014-03-02 16:48:59 +00:00
Benjamin Kramer ffe110b304 [C++11] Replace llvm::tie with std::tie.
llvm-svn: 202646
2014-03-02 13:48:32 +00:00
Craig Topper e67972c462 Revert a LLVM_OVERRIDE to 'override' change in documentation. My search and replace was a little overzealous.
llvm-svn: 202633
2014-03-02 10:24:34 +00:00
Craig Topper a3dbe84166 [C++11] Replace LLVM_OVERRIDE with 'override'
llvm-svn: 202632
2014-03-02 10:20:11 +00:00
Tobias Grosser 6c6af852f9 Add new 'remark' diagnostic type
llvm-svn: 202477
2014-02-28 09:42:12 +00:00
Alexander Kornienko 31219d3abd Added a naive NOLINT implementation.
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
2014-02-28 00:27:50 +00:00
Alexander Kornienko 098871609f Made the ClangTidyTest helper class independent of the testing framework.
Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits

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

llvm-svn: 202399
2014-02-27 14:28:02 +00:00
Alexander Kornienko cb9272fe66 Normalized "virtual" and "LLVM_OVERRIDE" usage in clang-tidy.
Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits

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

llvm-svn: 202392
2014-02-27 13:14:51 +00:00
NAKAMURA Takumi 9698686505 [CMake] Use LINK_LIBS instead of target_link_libraries().
llvm-svn: 202238
2014-02-26 06:41:29 +00:00
Alexander Kornienko 84e30a7346 Adding documentation for clang-tidy.
Summary:
Contains a short user's manual and some instructions on writing
clang-tidy checks.

Reviewers: klimek, djasper

Reviewed By: klimek

CC: cfe-commits

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

llvm-svn: 202164
2014-02-25 16:46:13 +00:00
Rafael Espindola 26af26255c Update for llvm api change.
llvm-svn: 202055
2014-02-24 18:21:04 +00:00
Rafael Espindola dc59a36caa Update for llvm api change.
llvm-svn: 202045
2014-02-24 15:41:44 +00:00
NAKAMURA Takumi 871d104e1c [CMake] Apply DEPENDS to clangTidy.
llvm-svn: 201977
2014-02-23 13:43:01 +00:00
Peter Collingbourne b549019c3c Add a makefile for clang-query. Patch by Alex Horn!
While at it, have cmake build and test the tool if libedit is not installed,
as this dependency is now optional.

llvm-svn: 201599
2014-02-18 19:46:01 +00:00
Alexander Kornienko d68aa4c0fc Re-add the '!' removed by mistake.
llvm-svn: 201343
2014-02-13 16:29:39 +00:00
Alexander Kornienko 298b3823b5 Clang-tidy: don't create ASTConsumers not needed for the set of checks we perform.
Summary:
This doesn't have any significant effect on the performance, but it
looks like a good thing to do.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits

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

llvm-svn: 201340
2014-02-13 16:10:47 +00:00
Alexander Kornienko 32eaa37b15 Fix ExplicitConstructorCheck to warn only on in-class declarations.
Summary:
I'm not absolutely sure this is 100% correct solution, but it seems to
do what I expect.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

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

llvm-svn: 201308
2014-02-13 10:11:48 +00:00
Alexander Kornienko d1afc70795 Consume checker names from clang static analyzer.
Summary: This patch depends on patches D2556 and D2557.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits, jordan_rose, krememek

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

llvm-svn: 201221
2014-02-12 09:52:07 +00:00
Nick Lewycky ccf8e29060 The diagnostic printer expects the LangOptions to still be alive. Give it one that lives at least as long as all the uses of it. This is still wrong though, we should be passing in the correct LangOpts for a given source file.
llvm-svn: 200952
2014-02-06 22:57:16 +00:00
Alexander Kornienko 54461eb389 Improve clang-tidy diagnostic output and filtering.
Summary:
This patch introduces several improvements to clang-tidy diagnostic;
  1. Make filtering of messages from non-user code more reliable. Output an
     error when it or any of the related notes touches user code. This fixes an
     assertion when an error has a location in a system header, and one of the
     notes relates to user code.
  2. In order for 1. to work, subscribe to the static analyzer diagnostics using
     a custom PathDiagnosticConsumer.
  3. Enable colors on supported terminals.
  4. Output FixItHints.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits

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

llvm-svn: 200924
2014-02-06 14:50:10 +00:00
Alexander Kornienko 99c9d6a0f6 Make the OptionCategory variable static.
llvm-svn: 200841
2014-02-05 13:43:27 +00:00
Alexander Kornienko 6d129d5454 Fix crash when handling an argument parsing-related warning.
Summary: Don't crash on warnings coming before the translation unit starts.

Reviewers: klimek, djasper

Reviewed By: djasper

CC: cfe-commits

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

llvm-svn: 200702
2014-02-03 15:55:35 +00:00
Peter Collingbourne d9a0f254bc Add completion to the query parser, and hook it up to clang-query.
Differential Revision: http://llvm-reviews.chandlerc.com/D2263

llvm-svn: 200604
2014-02-01 01:42:46 +00:00
Peter Collingbourne c31176da02 Switch clang-query to use the lineeditor library.
Differential Revision: http://llvm-reviews.chandlerc.com/D2262

llvm-svn: 200603
2014-02-01 01:42:42 +00:00
NAKAMURA Takumi 298a161927 check-clang-tools: Also it doesn't require neither llvm_src_root nor llvm_obj_root.
llvm-svn: 200148
2014-01-26 12:40:18 +00:00
Alp Toker a143676664 Fix another invalid getCustomDiagID() use to unbreak the build
It was calling the utility wrapper that now requires a constant string
following clang r200132. The StringRef version on DiagnosticIDs appears to have
been what was intended so change to that.

llvm-svn: 200142
2014-01-26 08:36:03 +00:00
Alp Toker 82f8c50a73 Prospective build fix for unsafe usage of getCustomDiagID()
This now requires a compile-time constant string so let's build proper
diagnostic IDs and pass through the inputs as arguments.

Tracks clang changes in r200132.

llvm-svn: 200139
2014-01-26 06:58:01 +00:00
Alp Toker 9fb93576e6 Track clang changes from r200082
llvm-svn: 200084
2014-01-25 16:57:03 +00:00
Alp Toker 65dfc8ce09 Attempt to stabilize the Windows builder
llvm-svn: 200076
2014-01-25 13:09:12 +00:00
NAKAMURA Takumi c28a9a2c33 [CMake] Deprecate CLANG_RUNTIME_OUTPUT_INTDIR and CLANG_LIBRARY_OUTPUT_INTDIR.
LLVM_*_OUTPUT_INTDIR should be available everywhere. It was my mistake when I introduced INTDIR stuff.

llvm-svn: 199597
2014-01-19 13:00:01 +00:00
NAKAMURA Takumi ba496ff394 check-clang-tools: Fixup for r199583.
- Forgot to tweak autoconf's Makefile.
  - Apply lit's param to config.clang_tools_dir.

llvm-svn: 199589
2014-01-19 12:07:45 +00:00
NAKAMURA Takumi 5d942f2229 [CMake] Import CLANG_TOOLS_DIR from check-clang into check-clang-tools for standalone clang.
llvm-svn: 199583
2014-01-19 11:19:07 +00:00
NAKAMURA Takumi fda2cf9007 [CMake] check_library_exists() requires inclusion in clang standalone build.
llvm-svn: 199578
2014-01-19 08:54:11 +00:00
Alexander Kornienko 41bfe8dde1 Add the check name to the clang-tidy diagnostic output.
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
2014-01-13 10:50:51 +00:00
NAKAMURA Takumi 07ef316ff3 [CMake] module-map-checker itself should depend just on LLVMSupport.
llvm-svn: 199072
2014-01-13 03:20:07 +00:00
Alexander Kornienko 0ba86b73aa Re-applied r198807, r198808 with an additional change to fix linking in configure Release+Asserts build.
llvm-svn: 198875
2014-01-09 16:31:25 +00:00
Alexander Kornienko 73f7b0273e Reverted r198807, r198808, as they cause link errors in configure builds. Will look at this later.
llvm-svn: 198832
2014-01-09 02:21:52 +00:00
Alp Toker 58983f1398 Fix typo
llvm-svn: 198831
2014-01-09 01:39:49 +00:00
Alexander Kornienko 875288bd82 Updated file comment.
llvm-svn: 198808
2014-01-08 23:35:01 +00:00
Alexander Kornienko a89f99c1e2 Restructured code, no functional changes.
Summary:
Moved implementation of classes declared in
ClangTidyDiagnosticConsumer.h to ClangTidyDiagnosticConsumer.cpp.
Added a FIXME note in ClangTidyDiagnosticConsumer::HandleDiagnostic.

Reviewers: klimek, djasper

Reviewed By: klimek

CC: cfe-commits

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

llvm-svn: 198807
2014-01-08 23:30:40 +00:00
Alexander Kornienko 86d305c779 Don't emit diagnostics for system headers.
Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits

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

llvm-svn: 198767
2014-01-08 15:21:08 +00:00
Chandler Carruth f7e45c0ed4 Fix the top header that corresponds to this source file. Thanks for
spotting this Cody Maloney!

llvm-svn: 198716
2014-01-07 22:15:39 +00:00
Chandler Carruth 85e6e87171 Run llvm/utils/sort_includes.py over the Clang tools code. This doesn't
always produce as pretty of results as it does in LLVM and Clang, but
I don't mind and the value of having a single canonical ordering is very
high IMO.

Let me know if you spot really serious problems here.

llvm-svn: 198703
2014-01-07 20:05:01 +00:00
John Thompson e0756452a3 Initial checkin of new module-map-checker tool.
llvm-svn: 198693
2014-01-07 15:22:08 +00:00
Alexander Kornienko d1199cb4f0 A follow-up to r198426: move AnalysisConsumer.h to include/clang/...
llvm-svn: 198427
2014-01-03 17:24:20 +00:00
Alexander Kornienko fc58987f00 Clear the diagnostic buffer after flushing it.
Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits

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

llvm-svn: 198423
2014-01-03 15:34:40 +00:00
Alexander Kornienko b045d8bc07 Rework of r198404 to avoid changes in the build configuration.
llvm-svn: 198405
2014-01-03 10:50:17 +00:00
NAKAMURA Takumi 321b7d35e5 clang-tody: Rework r198403, to fix build.
llvm-svn: 198404
2014-01-03 10:24:51 +00:00
NAKAMURA Takumi 4fd9913803 clang-tidy: Fix build since r198402 in the case that the source tree of clang-tools-extra is not located on clang/tools/extra.
FIXME: Get rid of private headers in other modules.
llvm-svn: 198403
2014-01-03 09:49:13 +00:00
Alexander Kornienko 175fefbda3 Refactored Clang-tidy for better reusability.
Summary:
Made ClangTidyAction more slim and moved its declaration to header to
allow easy creation of Clang-tidy ASTConsumer. Don't derive from
clang::ento::AnalysisAction, use clang::ento::CreateAnalysisConsumer instead
(I'll propose making this function a part of a public API in a separate patch).

Use MultiplexConsumer instead of a custom class.

Don't re-filter checkers list for each TU.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits

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

llvm-svn: 198402
2014-01-03 09:31:57 +00:00
NAKAMURA Takumi d40d387fb1 Update the copyright credits -- Happy new year 2014!
FIXME: Dragonegg may be updated at non-trivial changes.
llvm-svn: 198274
2014-01-01 08:27:31 +00:00
NAKAMURA Takumi 4c141c3ef8 Make lit.site.cfg Py3-compatible. Copied from r188041.
llvm-svn: 198204
2013-12-30 06:18:08 +00:00
Alexander Kornienko fb9e92b167 Clang-tidy: added --disable-checks, --list-checks options.
Summary:
Allow disabling checks by regex. By default, disable alpha.* checks,
that are not particularly good tested (e.g. IdempotentOperationChecker, see
http://llvm-reviews.chandlerc.com/D2427).

Fixed a bug, that would disable all analyzer checks, when using a regex more
strict, than 'clang-analyzer-', for example --checks='clang-analyzer-deadcode-'.

Added --list-checks to list all enabled checks. This is useful to test specific
values in --checks/--disable-checks.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits, klimek

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

llvm-svn: 197717
2013-12-19 19:57:05 +00:00
Alexander Kornienko 06ff5a7235 Fix the usage of the CommonOptionsParser ctor changed in r197139.
llvm-svn: 197141
2013-12-12 10:01:39 +00:00
John Thompson e744d2b92d Fix assertion error.
llvm-svn: 196863
2013-12-10 02:26:44 +00:00
NAKAMURA Takumi 78f534d689 [CMake] clang-tools-extra: Update dependencies.
llvm-svn: 196860
2013-12-10 01:41:10 +00:00
NAKAMURA Takumi ff9225f3d7 [CMake] clang-tools-extra may not depend on LLVM CodeGen.
llvm-svn: 196805
2013-12-09 19:27:57 +00:00
NAKAMURA Takumi 21bf7a11b9 check-clang-tools: Prune 'clang' stuff. Clang is not used here.
llvm-svn: 196804
2013-12-09 19:27:46 +00:00
Benjamin Kramer 4c719e5b8d clang-modernize: Update PPCallback user.
Add LLVM_OVERRIDE to make this a hard error in the future.

llvm-svn: 196659
2013-12-07 17:18:12 +00:00
John Thompson 87f9fef5a5 Changed ConditionValue argument to PPCallbacks If and Elif callbacks to be a 3-state enum.
llvm-svn: 196648
2013-12-07 08:41:15 +00:00
NAKAMURA Takumi 0d62c78c20 clang-tools-extra/test/clang-modernize/HeaderReplacements/main.cpp: Dequote safe chars rather than hairy quoting.
Thanks to Lang, to let me noticed.

llvm-svn: 196559
2013-12-06 02:00:41 +00:00
NAKAMURA Takumi c69c625dda Revert r196474, "Re-apply r196439, with sed patterns modified to be more DOS-path friendly."
llvm-svn: 196553
2013-12-06 00:34:09 +00:00
Lang Hames 50aa21aedd Re-apply r196439, with sed patterns modified to be more DOS-path friendly.
llvm-svn: 196474
2013-12-05 06:17:42 +00:00
NAKAMURA Takumi 4655681c27 Revert r196439, "If the LLVM OBJ_DIR path contains any characters not listed in the"
Did you expect to break DOS driveletter?

llvm-svn: 196460
2013-12-05 03:05:26 +00:00
Lang Hames b53a85a6f8 If the LLVM OBJ_DIR path contains any characters not listed in the
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
2013-12-05 00:33:58 +00:00
John Thompson abe79d9fd2 Improve comment, as requested by Alp Toker.
llvm-svn: 196409
2013-12-04 20:41:30 +00:00
John Thompson 17c357342a Enea Zaffanella's fix for the PPCallbacks Elif callback, with a slight re-org, and an update of the new PPCallbacks test (soon to be moved to clang from extra), rather the unittest.
llvm-svn: 196407
2013-12-04 20:19:30 +00:00
Alexander Kornienko 3daaf32e93 Adapt the code to the interface change in r196108.
llvm-svn: 196109
2013-12-02 15:22:30 +00:00
Alp Toker 9a5134e6be Fix a variety of user-visible and comment typos
llvm-svn: 196038
2013-12-01 05:08:12 +00:00
Alp Toker 303a6481cb Add a .clang-format to avoid reflow of test RUN lines
See thread "clang-format turning tests into no-ops"

llvm-svn: 196037
2013-12-01 05:08:00 +00:00
NAKAMURA Takumi 63bf66816c Trailing linefeed.
llvm-svn: 195357
2013-11-21 13:50:58 +00:00
Alexander Kornienko e5df476c8b Fix the build after r195016.
llvm-svn: 195020
2013-11-18 18:03:29 +00:00
John Thompson 5100e8e9ae Reworked moduleImport example with real data.
llvm-svn: 194885
2013-11-15 23:26:14 +00:00
Manuel Klimek fe3f34e50b Always add core checkers if static analyzer checks are enabled.
In response to post-commit feedback by Jordan, this is required to
make sure path-sensitive checks work correctly.

llvm-svn: 194807
2013-11-15 11:19:56 +00:00
Manuel Klimek 814f9bd93a Make clang's static analyzer checks available through clang-tidy.
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
2013-11-14 15:49:44 +00:00
John Thompson c2d8a5c7f5 [extra] pp-trace - Fix for PragmaWarning output, adding tests for the pragma callbacks.
llvm-svn: 194636
2013-11-14 00:18:19 +00:00
John Thompson 13e1cd3a37 Extended moduleImport test to test a module with more than one path component. This required a change to the includes test, because of the change to the headers.
llvm-svn: 194504
2013-11-12 19:50:49 +00:00
John Thompson c1a13f3f20 Fixed moduleImport and ident callbacks. Fixed modules test. Added ident callback test. A better test for moduleExport is coming.
llvm-svn: 194447
2013-11-12 03:12:18 +00:00
John Thompson 0bc443b5c8 [extra] pp-trace - Add test for conditional callbacks.
llvm-svn: 194440
2013-11-12 02:04:53 +00:00
John Thompson da0b753035 [extra] pp-trace - Test for moduleImport.
llvm-svn: 194422
2013-11-11 21:20:02 +00:00
Peter Collingbourne c7ae6101a4 Revert r194247 conditional on non-MSVC.
These definitions are required by the standard.  MSVC rejecting them
appears to be a bug.

llvm-svn: 194252
2013-11-08 08:54:53 +00:00
NAKAMURA Takumi 55380c4e54 clang-query: Unbreak msvc.
llvm-svn: 194247
2013-11-08 06:29:09 +00:00
Peter Collingbourne 0dc0e6d32c Silence GCC warning.
llvm-svn: 194230
2013-11-08 01:08:12 +00:00
Peter Collingbourne 8b1265b353 Introduce clang-query tool.
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
2013-11-08 00:08:23 +00:00
John Thompson 41778fd28f pp-trace user documentation - beginnings
llvm-svn: 194081
2013-11-05 14:41:29 +00:00
John Thompson 5252325990 [extra] pp-trace - Fixed problems found while writing docs.
llvm-svn: 194079
2013-11-05 14:16:11 +00:00
John Thompson 1da6792242 pp-trace user documentation - beginnings
llvm-svn: 193842
2013-11-01 00:39:54 +00:00
John Thompson 5052eb7394 pp-trace user documentation - beginnings
llvm-svn: 193841
2013-11-01 00:38:04 +00:00
Dan Gohman cc30af0cef Rename Input to Inputs, for consistency with other tests.
llvm-svn: 193805
2013-10-31 21:29:44 +00:00
Alexey Samsonov fe74ba6b7b Delete unused private field to fix -Werror build
llvm-svn: 193763
2013-10-31 17:03:07 +00:00
John Thompson 17c4f7d1db Fix comment. pp-trace can only handle source file at a time.
llvm-svn: 193746
2013-10-31 12:53:42 +00:00
NAKAMURA Takumi 125a4171b2 check-clang-tools: Add pp-trace for deps.
llvm-svn: 193745
2013-10-31 12:46:16 +00:00
NAKAMURA Takumi a256eb4038 check-clang-tools: Reorder CLANG_TOOLS_TEST_DEPS.
llvm-svn: 193744
2013-10-31 12:46:10 +00:00
John Thompson 9979454e72 pp-trace - preprocessor tacing and PPCallbacks testing tool
llvm-svn: 193743
2013-10-31 12:23:32 +00:00
Edwin Vane dd8cc29ce5 Refactoring transform-specific options
Making the user null macros command-line option visible to the
UseNullptrTransform class instead of being visible only to the match callback.

llvm-svn: 192905
2013-10-17 17:57:36 +00:00
John Thompson 26ecaf95a2 Added module map generation docs and some clean-up.
llvm-svn: 192792
2013-10-16 13:44:21 +00:00
NAKAMURA Takumi bf5391d2ef clang-tools-extra/modularize: Compare Paths to Prefix as natively-canonicalized form.
On Win32, paths are not expected to be canonicalized.

llvm-svn: 192763
2013-10-16 01:42:33 +00:00
Rui Ueyama dfa171034c Add missing dependency for clang-modernize.
Clang-modernize uses clang-apply-replacements internally but its CMakefile.txt
lacked the dependency.

llvm-svn: 192723
2013-10-15 18:01:06 +00:00
Will Dietz 0f3b4aaf34 ModuleAssistant: Fix warning, don't return bool as a pointer.
No functionality change intended.

llvm-svn: 192713
2013-10-15 15:45:00 +00:00
John Thompson 5ab4f11152 Added module map generation option.
llvm-svn: 192703
2013-10-15 13:52:33 +00:00
Ismail Pazarbasi ebcc0a004b Reverted Test commit; added new line to the end of README.txt
llvm-svn: 192541
2013-10-12 20:43:36 +00:00
Ismail Pazarbasi cdc244bcd8 Test commit; added new line to the end of README.txt
llvm-svn: 192540
2013-10-12 20:42:31 +00:00
Edwin Vane f6a34b5665 clang-modernize: Clean up help output
Now hiding options clang-modernize doesn't use and didn't create. Version
printer specialized for clang-modernize. EXAMPLES text fixed and brought
up-to-date.

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

llvm-svn: 192253
2013-10-08 23:31:05 +00:00
Edwin Vane ea9d124fd4 Switching code owner email address.
llvm-svn: 192189
2013-10-08 16:28:05 +00:00
Edwin Vane c76c0dd952 Update clang-modernizer docs
Summary: Docs updated to reflect new behaviour and new options.

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

llvm-svn: 192105
2013-10-07 15:56:25 +00:00
Edwin Vane c669a8ea7c clang-modernize: Fixing doxygen warnings
llvm-svn: 192100
2013-10-07 13:40:19 +00:00
Edwin Vane 9e5b0da062 clang-modernize: Fix clang-apply-replacements invocation bug
The command-line for clang-apply-replacements was being mangled due to an
uninitialized variable. gasp! Now fixed.

llvm-svn: 192033
2013-10-05 13:31:31 +00:00
Edwin Vane c0f00b79f7 clang-modernize: Apply replacements using clang-apply-replacements
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
2013-10-05 12:15:58 +00:00
Edwin Vane 2fb10d1889 clang-apply-replacements: Fixing doxygen warning
llvm-svn: 191754
2013-10-01 13:21:39 +00:00
Edwin Vane 6afb68408d Fix build by adding dep on TransformUtils
clang-apply-replacements unittest Makefile wasn't linking in TransformUtils.

llvm-svn: 191669
2013-09-30 14:29:28 +00:00
Edwin Vane 59d93af4a5 clang-apply-replacements: Add code formatting functionality
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
2013-09-30 13:59:21 +00:00
Edwin Vane bdd8561dea clang-modernize: Fixing a few left over cpp11-migrate references
Build files for unit tests hadn't been updated yet.

llvm-svn: 191451
2013-09-26 19:26:58 +00:00
Edwin Vane e228d10709 clang-modernize: Reset LoopConvert's TU tracking info per TU
The LoopConvert transform makes use of data structures it builds up over
the course of transforming a TU. Until now, these data structures
weren't being cleared out before the next TU was being processed.

Fixes PR17253.

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

llvm-svn: 191448
2013-09-26 19:10:04 +00:00
Edwin Vane 6d5350cb76 clang-apply-replacements: Clean up -help and -version
Options that leak from other parts of LLVM are now pruned out of -help.

-version output is specific to clang-apply-replacements now.

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

llvm-svn: 191322
2013-09-24 18:14:54 +00:00
Ariel J. Bernal e5ba87b6bb Clean up timing command line option.
Use getNumOccurrences instead of usina a default constant string.

llvm-svn: 191308
2013-09-24 15:41:30 +00:00
Ariel J. Bernal faa2b3a101 Fixed test for compilation databases.
Fixed test that was previously failing due to concurrency.

llvm-svn: 191215
2013-09-23 19:02:25 +00:00
Ariel J. Bernal f50eb0c73c Added tests for testing migration of files in a compilation database.
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
2013-09-23 18:37:32 +00:00
John Thompson 02bad9fbc3 Fix headers, use source quoting.
llvm-svn: 191211
2013-09-23 17:57:00 +00:00
John Thompson 8925d4622b Changed error messages to use source quoting.
llvm-svn: 191201
2013-09-23 14:17:27 +00:00
John Thompson 587f6db9e1 Added list of checks made.
llvm-svn: 191093
2013-09-20 16:47:33 +00:00
John Thompson a2b66875d3 Added colon to make proper error message prefix.
llvm-svn: 191092
2013-09-20 14:44:20 +00:00
John Thompson 2d2d45e330 Added modularize documentation.
llvm-svn: 191091
2013-09-20 14:40:52 +00:00
Alexey Samsonov 2a8fcee302 Don't use default label in fully covered switch
llvm-svn: 190992
2013-09-19 07:35:47 +00:00
John Thompson 740839260b Check for #include in extern and namespace blocks.
llvm-svn: 190950
2013-09-18 18:19:43 +00:00
Ariel J. Bernal defd1a93c9 Fix for removing not included files from a compilation database.
remove_if doesn't alter the container properties. Need to use erase to remove
the elements past the new end.

llvm-svn: 190803
2013-09-16 20:12:22 +00:00
Ariel J. Bernal 583d095fa4 Transform files in a compilation database if no sources are provided.
Compile all files in a compilation database or a subset determined by a
sub-directory so you  don't have to specify them manually.

llvm-svn: 190630
2013-09-12 20:10:59 +00:00
Ariel J. Bernal dfa4c7548b Point doxygen link to somthing useful.
llvm-svn: 190607
2013-09-12 15:26:44 +00:00
NAKAMURA Takumi 4814eaa9ba clang-tools-extra/test/clang-modernize/HeaderReplacements/main.cpp: Tweak sed(1) to let paths with a driveletter quoted in *_expected.yaml.
llvm-svn: 190517
2013-09-11 11:55:59 +00:00
Benjamin Kramer 3353a10339 Modularize: Use in-place version of sys::path::native.
llvm-svn: 190511
2013-09-11 10:45:25 +00:00
Rui Ueyama 9b866c2312 Fix YAML tests again.
llvm-svn: 190489
2013-09-11 04:51:09 +00:00
Rui Ueyama a53cbc5821 Fix YAML tests.
llvm-svn: 190487
2013-09-11 04:40:12 +00:00
Guillaume Papin 65ec930557 clang-modernize: Fix bugs in Pass-By-Value transform
- 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
2013-09-06 22:28:53 +00:00
Edwin Vane 5a816f044c clang-modernize: Tweak docs after rename
* Removing sphinx warnings about docs not in a toctree.
* Adding more links to cpp11-migrate redirect docs.

llvm-svn: 190195
2013-09-06 19:27:19 +00:00
Edwin Vane 684daa90f2 clang-modernize: Update docs with -include/-exclude
-include/-exclude and friends have been marked as hidden options until this
point. This is no longer necessary. Update the docs to describe their effect.

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

llvm-svn: 190194
2013-09-06 19:26:25 +00:00
Edwin Vane 5f002639e4 clang-modernize: Remove -headers option
clang-modernize can now transform headers properly and the experimental
-headers option is no longer necessary.

Remember, at least -include is necessary for indicating which headers
are allowed to be changed.

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

llvm-svn: 190158
2013-09-06 14:23:56 +00:00