aboutsummaryrefslogtreecommitdiff
path: root/lib/Tooling
AgeCommit message (Collapse)Author
2013-03-15ClangTool output cleanupEdwin Vane
Information messages sent to stdout by ClangTool now only happen when the -debug flag is set. Error messages that used to go to stdout now go to stderr. Author: Ariel J Bernal <ariel.j.bernal@intel.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177177 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13Reverting r176944 until Author fixes test failure.Edwin Vane
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176945 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13ClangTool output cleanupEdwin Vane
Information messages sent to stdout by ClangTool now only happen when the -debug flag is set. Error messages that used to go to stdout now go to stderr. Author: Ariel J Bernal <ariel.j.bernal@intel.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176944 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-02CommandLineArgumentParser: handle single quotes.Peter Collingbourne
Differential Revision: http://llvm-reviews.chandlerc.com/D482 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176404 91177308-0d34-0410-b5e6-96231b3b80d8
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-12Fix spurious output in JSONCompilationDatabaseArnaud A. de Grandmaison
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172321 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 all of Clang's files under 'lib', and fix up the broken headersChandler Carruth
uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 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-11-27Remove some dead code. CLANG_IS_PRODUCTION is now just a build flag andRafael Espindola
is not used in any #ifdef. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168703 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor
the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15Only report first error when no compilation database is found.Daniel Jasper
Review: http://llvm-reviews.chandlerc.com/D62 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165933 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08Hopefully appease Windows buildbot with Japanese (?) error message.Daniel Jasper
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165414 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-01Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek
This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163050 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-28Only add common tool options when CommonOptionsParser is used.Alexander Kornienko
Summary: Subj. Reviewers: chandlerc, klimek, djasper Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D29 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162798 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-24Fix the definition of JSONAnchorSource. MSVC mangles variable symbols, and ↵NAKAMURA Takumi
"volatile" affects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162550 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-31Fixes a segfault in Tooling when using pch's:Manuel Klimek
Clear the FileManager's stat cache in between running translation units, as the stat cache loaded from a pch is only valid for one compiler invocation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161047 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27clang/lib: [CMake] Update tblgen'd dependencies.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160851 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27clang/lib: [CMake] Reformat, alphabetize lists.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160850 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-18Reverted custom init hook from r160369.Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160432 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17Add a custom initialize hook for clang tools + minor fixes in ↵Alexander Kornienko
CustomCompilationDatabase.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160369 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-16Fix copy-paste mistake for CMake dependency.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160315 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16Looks like libTooling might also depend on ClangDiagnosticCommon.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160313 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-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-11Add a hook to supply a custom CompilationDatabase. To add a custom ↵Daniel Jasper
CompilationDatabase, make it implement findCompilationDatabaseForDirectory in CustomCompilationDatabase.h and set USE_COSTUM_COMPILATION_DATABASE. Differential Revision: http://llvm-reviews.chandlerc.com/D4 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160061 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-21Remove a goofy CMake hack and use the standard CMake facilities toChandler Carruth
express library-level dependencies within Clang. This is no more verbose really, and plays nicer with the rest of the CMake facilities. It should also have no change in functionality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158888 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-06-02ToolInvocation::mapVirtualFile(): Tweak for Win32. Handle the key as native ↵NAKAMURA Takumi
path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157889 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-30Fixed a memory leak in clang/Tooling.Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157687 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-23Tooling: Canonicalize Key in IndexByFile[]. llvm::sys::path::native() may be ↵NAKAMURA Takumi
used here. It fixes test/Tooling on Win32 hosts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157350 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-15Fixes crasher bug in JSONCompilationDatabase for invalid input.Manuel Klimek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156814 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