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

14 Коммитов

Автор SHA1 Сообщение Дата
Manuel Klimek 30318e6df9 Adds a FixedCompilationDatabase to be able to specify tool parameters
at the command line.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154989 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-18 07:41:50 +00:00
Manuel Klimek c661f1467a Switches the JSONCompilationDatabase to use the YAML parser.
This will allow us to delete the JSON parser from llvm.

The biggest change is a general change of strategy - instead
of storing StringRef's to the values for the command line and
directory in the input buffer, we store ScalarNode*'s. The
reason is that the YAML parser's getRawValue on ScalarNodes
returns a string that includes the quotes in case of double
quoted strings.

For the same reason we're removing the JSON parsing part of
the command line parsing - this means an extra copy for a
command line when it is requested (and only when it is requested).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154929 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-17 16:54:26 +00:00
Manuel Klimek 4f5b3ac464 Fixes a fix to finding the current directory:
We currently want to look whether PWD is available - if PWD is available it will
get us the non-resolved current path, while fs::current_path will resolve
symlinks. The long term fix is to not rely on that behavior any more.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154330 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-09 18:08:23 +00:00
NAKAMURA Takumi 01b8ca52fe Tooling.cpp: Reorder inclusions according to the conding standards.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154016 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 13:59:41 +00:00
NAKAMURA Takumi b175d0f054 Tooling.cpp: Don't refer to $ENV{PWD}. Use llvm::sys::fs instead.
$ENV{PWD} is not expected to be set on all hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154015 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 13:59:36 +00:00
Manuel Klimek cb971c6726 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154008 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04 12:07:46 +00:00
Manuel Klimek 16f213142f Reverts the Tooling changes as requested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132462 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 16:58:33 +00:00
Manuel Klimek 64cbdf3709 This patch implements an AST matching framework that allows to write
tools that match on the C++ ASTs. The main interface is in ASTMatchers.h,
an example implementation of a tool that removes redundant .c_str() calls
is in the example RemoveCStrCalls.cpp.

Various contributions:
Zhanyong Wan, Chandler Carruth, Marcin Kowalczyk, Wei Xu, James Dennett.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132374 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31 23:49:32 +00:00
Manuel Klimek 81e557b1de Pulls the common part of the clang-check example into Tooling, to allow new tools to be implemented without duplicating the boilerplate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131425 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 21:33:46 +00:00
Nico Weber a83c17c28f Let clang-check actually use the Directory entry in the json file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-14 21:20:23 +00:00
Benjamin Kramer 0ddd364aa2 Remove noisy semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130621 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 19:55:55 +00:00
Nico Weber fddbcb459f Add lib/Tooling to the Makefile build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130581 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 03:09:18 +00:00
Manuel Klimek 9a05fa97df This is the next step in building the standalone tools infrastructure:
This patch simplifies writing of standalone Clang tools. As an
example, we add clang-check, a tool that runs a syntax only frontend
action over a .cc file. When you integrate this into your favorite
editor, you get much faster feedback on your compilation errors, thus
reducing your feedback cycle especially when writing new code.

The tool depends on integration of an outstanding patch to CMake to
work which allows you to always have a current compile command
database in your cmake output directory when you set
CMAKE_EXPORT_COMPILE_COMMANDS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130306 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 16:39:14 +00:00
Manuel Klimek cf3ce5d896 Adds a function to run FrontendActions over in-memory code. This is
the first step towards a standalone Clang tool infrastructure.
The plan is to make it easy to build command line tools that run over
the AST of source files in a project outside of the build system.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129924 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 18:37:41 +00:00