aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Tooling
AgeCommit message (Collapse)Author
2013-01-20Nuke SetUpBuildDumpLog.Sean Silva
Also, it was the only reason that `argc` and `argv` were being passed into createDiagnostics, so remove those parameters and clean up callers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172945 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-12Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko
brought into 'clang' namespace by clang/Basic/LLVM.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11Allow RefactoringTool to write to memory instead of always to diskEdwin Vane
RefactoringTool::run() always writes the result of rewrites to disk. Instead, make this optional and provide a method for getting the refactoring results in a memory buffer instead. Also made ClangTool polymorphic so RefactoringTool could inherit from it to properly express the IS-A relationship. This change also provides access to ClangTool's public interface, e.g. mapVirtualFile() which is important once refactored buffers start living in memory instead of on disk. Reviewers: klimek git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172219 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-14Style and Doc fix for CommonOptionsParserEdwin Vane
- Renaming GetCompilations() and GetSourcePathList() to follow LLVM style. - Updating docs to reflect name change. - Also updating help text to not mention clang-check since this class can be used by any tool. Reviewed By: Alexander Kornienko git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170229 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04Sort #include lines for all files under include/...Chandler Carruth
This is a simpler sort, entirely automatic with the help of llvm/utils/sort_includes.py -- no manual edits here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169238 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04Introduce CompilationDatabase::getAllCompileCommands() that returns allArgyrios Kyrtzidis
compile commands of the database and expose it via the libclang API. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169226 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25Adds the possibility to inject a callback that's called after each ↵Manuel Klimek
translation unit is processed. This is important when one wants to deduplicate results during one run over a translation unit by pointer identity of AST nodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166671 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08FileNameMatchTrie: Use StringRef instead of Twines where possible.Daniel Jasper
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165412 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08Support symlinks and relative paths in complilation databases.Daniel Jasper
Review: http://llvm-reviews.chandlerc.com/D30 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165392 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Add missing accessor.Manuel Klimek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163792 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30Tooling: Add a runToolOnCodeWithArgs() function that allowsNico Weber
passing additional parameters to a tool. Use this to fix a FIXME in testing code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162889 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-24Use LLVM's plugin registry to enable registering new compilationDaniel Jasper
databases. Move JSONCompilationDatabase.h to its own files and register it as plugin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162541 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-24Updated LibTooling.html, minor improvements in CommonOptionsParserAlexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162521 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-22Reverted clang-check to fully supported CommandLine Library use-case: globalAlexander Kornienko
static variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162391 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17Finishing the move of RefactoringCallbacks and fixing the correspondingDaniel Jasper
buildbot failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160355 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17Move RefactoringCallbacks to Tooling to avoid dependency fromDaniel Jasper
ASTMatchers (lower level abstraction) to Tooling (higher level abstraction). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160351 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16The new clang-ast-dump tool for selective AST dumping. Moved common ↵Alexander Kornienko
command-line tool stuff to CommandLineClangTool git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160265 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16Add refactoring callbacks to make common kinds of refactorings easy.Daniel Jasper
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160255 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-13Allows retrieving all files in a CompilationDatabase.Manuel Klimek
Patch by Tobias Koenig, some test changes by myself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160167 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-10Adds support for auto-detection of compilation databases, looking in a ↵Arnaud A. de Grandmaison
directory and all its parents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-10Adds support for auto-detection of compilation databasesManuel Klimek
from a source file and changes clang-check to make use of this. This makes clang-check just work on in-tree builds, and allows easy setup via a symlink per source directory to make clang-check work without any extra configuration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159990 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-05Adapts the FrontendAction convenience functions so that it can beManuel Klimek
used with classes that generate ASTConsumers; this allows decoupling the ASTConsumer generation from the Frontend library (like, for example, the MatchFinder in the upcoming ASTMatcher patch). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159760 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-04Fixed a problem related to resolution of built-in headers in case a path of ↵Alexander Kornienko
tool's binary contains sym-links. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157944 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31Fix an object lifetime issue in clang/Tooling.Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157759 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30Adds a toString method to Replacement, which helps debugging.Manuel Klimek
Adds missing header guards to Refactoring.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24Apply review comment from Jordan Rose.Manuel Klimek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157387 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-23Adds the Refactoring library, which is a layer on top of the Tooling libraryManuel Klimek
that allows easy refactoring across translation units. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-09Fix -Wdelete-non-virtual-dtor in Tooling code.David Blaikie
Also, add an anchor as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156495 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-09Declare abstract class ArgumentsAdjuster. This abstract interface describesSimon Atanasyan
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156478 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-07Fixes resolution of relative paths when running clang tools.Manuel Klimek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156299 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-23Fixes comment referencing old name.Manuel Klimek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155340 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-18Adds a FixedCompilationDatabase to be able to specify tool parametersManuel Klimek
at the command line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154989 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-17Switches the JSONCompilationDatabase to use the YAML parser.Manuel Klimek
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-04Adds a tooling library.Manuel Klimek
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
2011-06-02Reverts the Tooling changes as requested by Chris.Manuel Klimek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132462 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01Don't use stdint.h; including it directly is not allowed from LLVM code ↵Eli Friedman
because it doesn't exist on MSVC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132403 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01Remove pointless assert, N is unsigned.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132392 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01Change a name for consistency and hopefully unbreak builds with gcc 4.6.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132391 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31This patch implements an AST matching framework that allows to writeManuel Klimek
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-16Pulls the common part of the clang-check example into Tooling, to allow new ↵Manuel Klimek
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-04-27This is the next step in building the standalone tools infrastructure:Manuel Klimek
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-21Adds a function to run FrontendActions over in-memory code. This isManuel Klimek
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