Граф коммитов

24 Коммитов

Автор SHA1 Сообщение Дата
John Thompson 824d398006 Initial checkin of new module-map-checker tool.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@198693 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-07 15:22:08 +00:00
Peter Collingbourne 26c59a1880 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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@194227 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-08 00:08:23 +00:00
John Thompson 37f6cf49ea pp-trace - preprocessor tacing and PPCallbacks testing tool
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@193743 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 12:23:32 +00:00
Chandler Carruth 8b603e0b20 Rename cpp11-migrate to clang-modernize.
There is no reason to expect this tool to be limited to C++11, it seems
very likely to be of on-going interest. It seems likely to be useful for
modernizing even as new libraries come out in TSes and other formats
than a complete standard. Fundamentally, we need something a bit more
general. After some discussion on the list, going with
'clang-modernize'.

I've tried to do a reasonably comprehensive job of fixing up the names,
but I may still have missed some. Feel free to poke me if you spot any
fallout here. Things I've tried reasonably hard to find and fix:

- cpp11-migrate -> clang-modernize
- Migrator -> Modernizer
- Clean up the introductory documentation that was C++11 specific.

I'll also point out that this tool continues to delight me. =] Also,
a huge thanks to those who have so carefully, thoroughly documented the
tool. The docs here are simply phenomenal. Every tool should be this
well documented. I hope I have updated the documentation reasonably
well, but I'm not very good at documentation, so review much
appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@189960 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-04 17:35:07 +00:00
Edwin Vane ad43cdb5f1 Rename clang-replace -> clang-apply-replacements
Made changes throughout clang-tools-extra for the renaming of
clang-replace to clang-apply-replacements as per feedback from
community.



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@189832 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 17:58:19 +00:00
Edwin Vane 36fd774d9d cpp11-migrate: Refactor for driver model of operation
Re-commit of r189691 and r189689 now with a proper autoconf fix.

Massive simplification of how replacements and file overrides are
handled by the migrator:
* Sources and headers are all treated the same.
* All replacements for a given translation unit are stored in the same
  TranslationUnitReplacements structure.
* Change tracking is updated only from main file; no need for
  propagating "is tracking" flag around.
* Transform base class no longer responsible for applying replacements.
  They are simply stored and main() looks after deduplication and
  application.
* Renamed -yaml-only to -serialize-replacements. Same restrictions apply:
  Can only request one transform. New restriction: formatting cannot also
  be turned on since it's basically a transform.
* If -serialize-replacements is requested, changes to files will not be
  applied on disk.
* Changed behaviour of function generating names for serialized
  replacements: Only the main source file goes into the name of the file
  since a file may contain changes for multiple different files.
* Updated HeaderReplacements LIT test for new serialization behaviour.
  * Replaced old test that ensures replacements are not serialized if
    -serialize-replacements is not provided. New version ensures changes
    are made directly to all files in the translation unit.
* Updated unit tests.
  * Due to major simplification of structures in FileOverrides.h, the
    FileOverridesTest is quite a bit simpler now.



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@189798 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 13:16:02 +00:00
Edwin Vane 7812fdc26a Introducing new tool clang-replace
Introducing new tool 'clang-replace' that finds files containing
serialized Replacements and applies those changes after deduplication
and detecting conflicts.

Currently the tool does not apply changes. It stops just after the
deduplication and conflict report phase. Forthcoming patches will
complete functionality.

Both build systems updated for new tool.

Includes a conflict test case.

clang-replace added to Doxygen build.

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



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@189008 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 13:07:14 +00:00
Daniel Jasper 62bb8df359 Initial architecture for clang-tidy.
This is the first version of a possible clang-tidy architecture. The
purpose of clang-tidy is to detect errors in adhering to common coding
patterns, e.g. described in the LLVM Coding Standards.

This is still heavily in flux.

Review: http://llvm-reviews.chandlerc.com/D884

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@187345 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 08:19:24 +00:00
Edwin Vane c4f4e56fc9 Updating cpp11-migrate unit tests
With the lib-ification of cpp11-migrate, real unit tests can be written.
Replacing dummy tests with some simple tests for the Transform public
interface.



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@178900 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05 19:17:36 +00:00
Edwin Vane d22180f92f Unit test support for Clang extra tools
Added support to CMake and autoconf for unit tests in clang-tools-extra. A
dummy test exists for now until more meaningful tests can be written.



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@178661 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03 15:11:08 +00:00
Daniel Jasper 151e8e08c6 Fix Makefile.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@177507 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 10:02:35 +00:00
John Thompson d7b5574efc Initial check in of Doug's modularize tool for checking header readiness for modules, plus some changes per review feedback: Removed system headers, changed to use stream output, added file name in message.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@176847 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 02:07:30 +00:00
Chandler Carruth e79882e9bd Switch from autogenerating tests to using the preprocessor.
NOTE: You may need to run 'make clean' or 'ninja -t clean' etc!!! This
      is due to really nasty bug/interactions between
      CMake/configure/make/Ninja/LIT...

This commit tries to back out the support for generating test cases as
part of the build system due to the issues I brought up in post-commit
review:

1) It adds a *lot* of complexity and fragility to the build system. See
   the number of commits required to try to get all the bots happy.
2) It isn't really necessary -- we can already run scripts to generate
   things with the RUN lines of a test.
3) It makes the tests somewhat harder to debug as they cross between
   more domains.
4) In almost all cases it isn't really needed or it can be done directly
   using the preprocessor.

I should have been more proactive reviewing this, and I'm really sorry
about the churn here. =/ To help keep track of what commits are going
where, this backs out most of the non-test-changes from these revisions:
  r176397
  r176373
  r176293
  r176184
  r175744
  r175624
  r175545
  r175544

There were several trivial or cleanup changes to the lit files or other
files. Some of these looked ok, but I didn't try to tease them apart...
Edwin, if you know what to look for, please carry on with the cleanups
there, and sorry for hosing stuff here but I'm not much of a Python
person, and so I was erring on the side of cautiously backing out the
change.

I've tried to preserve the test changes everywhere I could, but review
is appreciated here in case I missed some.

I then re-wrote the tests to use the preprocessor rather than python to
expand to the various bits of code. The nicest part of this is that now
all the files are just C++ code. They edit and behave like C++ code,
etc. RUN lines with different -D flags are used to run the same test
over multiple different configurations, and includes bracketed in
special defines are used to flesh out a collection of standard interface
stubs to test interactions between pieces. These probably aren't perfect
yet, but I think its an improvement (at least in terms of build system
complexity) and will hopefully be a useful demonstration of the
technique I prefer for these types of tests.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@176627 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 10:09:47 +00:00
Edwin Vane 1edaa8b5ba Fix recursive make in clang-tools-extra
Autoconf make (all) now properly recurses from tools/extra/Makefile into
tools/extra/test/Makefile and tools/extra/test/cpp11-migrate/Makefile. The
'all' target is responsible for creating lit config files and autogenerating
tests. Subsequent 'check-all' targets will properly work.

Re-enabling UseAuto/iterator.cpp test.

General clean-up of clang-tools-extra makefiles; removing dead targets and
removing duplicated pieces of llvm/Makefile.rules.



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@176373 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 19:50:52 +00:00
Edwin Vane d405bcad17 Removing loop-convert tool
cpp11-migrate now contains the loop convert transform code and tests.
Cleaning up the old code/tests and updating build system files as
necessary.

Reviewers: klimek



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@172074 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 15:19:11 +00:00
Edwin Vane a9fb16a53b Add cpp11-migrate to autoconf build
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@169986 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 16:08:10 +00:00
Daniel Jasper 69cb8869df First version of a command line clang-format tool.
Reads a single source range (offset, length) as well as the style guide
as parameters and then reformats everything it receives from stdin.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@169364 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-05 09:01:09 +00:00
David Blaikie f87c2ccb46 Add loop-convert to the Make build.
Hey, now the loop-convert tests pass too.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@163015 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-31 19:46:47 +00:00
Sam Panzer c6bcc7acee Reverted to correct commit this time.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@162624 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-24 23:29:33 +00:00
Sam Panzer bf90235053 Reverted incorect partial commit of loop migrator. git-svn strikes again
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@162618 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-24 23:02:27 +00:00
Marshall Clow 4699a538e5 Rename directory from 'toolTemplate' to 'tool-template'
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@161887 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14 18:59:24 +00:00
Marshall Clow 239efbd2ac Added a tool template to make creating new tools simpler
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@161886 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14 18:53:39 +00:00
Chandler Carruth ae5569067c Use parallel dirs here, there shouldn't be cross-tool dependencies
anyways. Also place it after the config makefile inclusion which seems
the more canonical location.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@161613 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-09 20:47:32 +00:00
Chandler Carruth da86effe3e Fix up the makefiles in the tools repo, and add a top-level makefile
suitable for building as part of the LLVM/Clang build.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@161538 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-08 23:34:47 +00:00