Commit Graph

113 Commits

Author SHA1 Message Date
Simon Atanasyan 32df72db66 Declare abstract class ArgumentsAdjuster. This abstract interface describes
a command line argument adjuster, which is responsible for command line
arguments modification before the arguments are used to run a frontend action.

Define class ClangSyntaxOnlyAdjuster implements ArgumentsAdjuster interface.
This class converts input command line arguments to the "syntax check only"
variant.

Reviewed by Manuel Klimek.

llvm-svn: 156478
2012-05-09 16:18:30 +00:00
Manuel Klimek 805d8dc52a Fixes resolution of relative paths when running clang tools.
The chdir is not the perfect fix, as it is thread hostile. The
real fix will be to make -working-dir work correctly, which will
take time to implement. Before that, the tooling library cannot
be used concurrently.

llvm-svn: 156299
2012-05-07 09:17:48 +00:00
Manuel Klimek 3778a435d1 Fixes the header search logic for tools:
The driver needs to get the correct path to the executable to deduce
the header search path.

llvm-svn: 155542
2012-04-25 09:25:41 +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
Kaelyn Uhrain 606b5291e5 Fix quoting to allow shell expansion to occur for shell variables
introduced by the test harness' expansion of %t.

llvm-svn: 154443
2012-04-10 22:27:27 +00:00
Manuel Klimek 1baf89eac9 Fix tautological FileCheck by moving the CHECK to an extra line.
llvm-svn: 154393
2012-04-10 12:12:33 +00:00
Manuel Klimek 35fa2655dd Implementing a test for the use of PWD to base finding the
correct compile commands on, based on an idea by Jordan Rose.

llvm-svn: 154335
2012-04-09 19:10:04 +00:00
NAKAMURA Takumi 2b9219eea1 clang/test/Tooling/clang-check.cpp: Mark it as XFAIL also on cygwin.
It seems clang-check doesn't like gcc driver on cygming. Investigating.

llvm-svn: 154066
2012-04-04 23:23:19 +00:00
NAKAMURA Takumi 67458e3696 clang/test/Tooling/clang-check.cpp: Mark it as XFAIL mingw,msvc for now.
It seems JSON parser doesn't like path separator '\' on Win32 hosts.

llvm-svn: 154017
2012-04-04 14:35:23 +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
Manuel Klimek 8a160cc42b Reverts the Tooling changes as requested by Chris.
llvm-svn: 132462
2011-06-02 16:58:33 +00:00
Manuel Klimek 6fad7119b9 Fix test breakage due to example not being built.
llvm-svn: 132376
2011-06-01 00:18:08 +00:00
Manuel Klimek 0cfc6a045c 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.

llvm-svn: 132374
2011-05-31 23:49:32 +00:00