summaryrefslogtreecommitdiffstats
path: root/lib/Tooling
Commit message (Collapse)AuthorAgeFilesLines
* Adds a FixedCompilationDatabase to be able to specify tool parametersManuel Klimek2012-04-181-0/+27
| | | | | | | | at the command line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154989 91177308-0d34-0410-b5e6-96231b3b80d8
* Switches the JSONCompilationDatabase to use the YAML parser.Manuel Klimek2012-04-171-36/+45
| | | | | | | | | | | | | | | | | | | 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
* Fixes a fix to finding the current directory:Manuel Klimek2012-04-091-1/+4
| | | | | | | | | | 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
* Tooling.cpp: Reorder inclusions according to the conding standards.NAKAMURA Takumi2012-04-041-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154016 91177308-0d34-0410-b5e6-96231b3b80d8
* Tooling.cpp: Don't refer to $ENV{PWD}. Use llvm::sys::fs instead.NAKAMURA Takumi2012-04-041-1/+3
| | | | | | $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
* Adds a tooling library.Manuel Klimek2012-04-044-0/+541
| | | | | | | | | | | | | | | | | 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
* Reverts the Tooling changes as requested by Chris.Manuel Klimek2011-06-026-1310/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132462 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch implements an AST matching framework that allows to writeManuel Klimek2011-05-313-30/+595
| | | | | | | | | | | 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
* Pulls the common part of the clang-check example into Tooling, to allow new ↵Manuel Klimek2011-05-161-0/+81
| | | | | | 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
* Let clang-check actually use the Directory entry in the json file.Nico Weber2011-05-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131367 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove noisy semicolons.Benjamin Kramer2011-04-302-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130621 91177308-0d34-0410-b5e6-96231b3b80d8
* Add lib/Tooling to the Makefile build.Nico Weber2011-04-301-0/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130581 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the next step in building the standalone tools infrastructure:Manuel Klimek2011-04-274-3/+429
| | | | | | | | | | | | | | | 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
* Adds a function to run FrontendActions over in-memory code. This isManuel Klimek2011-04-212-0/+223
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