summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed a bad assert from r194968. r194969 removed the assert.Richard Trieu2013-12-051-0/+1
| | | | llvm-svn: 196463
* Remove a whole lot of unused variablesAlp Toker2013-11-271-1/+1
| | | | | | | There are about 30 removed in this patch, generated by a new FixIt I haven't got round to submitting yet. llvm-svn: 195814
* Tooling/CompilationDatabase.cpp: Use \return here instead of \param[out]. ↵NAKAMURA Takumi2013-11-171-3/+2
| | | | | | [-Wdocumentation] llvm-svn: 194971
* Remove a bad string compare from r194968Alp Toker2013-11-171-1/+0
| | | | | | | | lib/Tooling/CompilationDatabase.cpp:275:34: warning: result of comparison against a string literal is unspecified (use strncmp instead) [-Wstring-compare] This assert() should probably be fixed and added back at some point. llvm-svn: 194969
* Relax some preconditions for using FixedCompilationDatabase.Edwin Vane2013-11-171-2/+185
| | | | | | | | FixedCompilationDatabase (FCD) requires that the arguments it consumes after '--' must not include positional parameters or the argv[0] of the tool. This patch relaxes those restrictions. llvm-svn: 194968
* Adds the ability to inject a DiagnosticConsumer into ClangTools.Manuel Klimek2013-11-071-14/+30
| | | | llvm-svn: 194226
* Introduce ClangTool::buildASTs, and buildASTFromCode.Peter Collingbourne2013-11-061-35/+119
| | | | | | | | | | | | | | | | | | | | | These allow clients to retrieve persistent AST objects (ASTUnits) which can be used in an ad-hoc manner after parsing. To accommodate this change, the code for processing a CompilerInvocation using a FrontendAction has been factored out to FrontendActionFactory, and a new base class, ToolAction, has been introduced, allowing the tool to do arbitrary things with each CompilerInvocation. This change was necessary because ASTUnit does not use the FrontendAction interface directly. This change also causes the FileManager in ClangTool to use shared ownership. This will become necessary because ASTUnit takes shared ownership of FileManager (ClangTool's FileManager is currently unused by ASTUnit; this is a FIXME). As shown in the tests, any client of ToolInvocation will need to be modified to use shared ownership for FileManager. Differential Revision: http://llvm-reviews.chandlerc.com/D2097 llvm-svn: 194164
* Use Rewriter::overwriteChangedFiles() directlyAlp Toker2013-10-291-17/+1
| | | | | | | | | | | | | This replaces the custom code in RefactoringTool::saveRewrittenFiles() which lacked atomic file saving and error diagnostics, resolving an old FIXME from r157331. Landing this time with the proper return code, plus a very unhelpful comment cleared up. Rubber-stamped by Manuel Klimek. llvm-svn: 193594
* Revert "Use Rewriter::overwriteChangedFiles() directly"Alp Toker2013-10-291-1/+17
| | | | | | | | This wasn't ready for prime time yet, seems to break tools-extra. This reverts commit r193590. llvm-svn: 193592
* Use Rewriter::overwriteChangedFiles() directlyAlp Toker2013-10-291-17/+1
| | | | | | | | | The old code in RefactoringTool::saveRewrittenFiles() lacked atomic moves and diagnostics and had FIXME to this effect. Rubber-stamped by Manuel Klimek. llvm-svn: 193590
* Reverted r192992 broke windows and freebsd builds.Ariel J. Bernal2013-10-181-10/+4
| | | | llvm-svn: 192997
* This patch fixes replacements that are not applied when relative paths areAriel J. Bernal2013-10-181-4/+10
| | | | | | | | | | specified. In particular it makes sure that relative paths for non-virtual files aren't made absolute. Added unittest. llvm-svn: 192992
* Revert commit r192299 until find a way to account for simlinks in OS X.Ariel J. Bernal2013-10-091-10/+4
| | | | llvm-svn: 192313
* This patch fixes replacements that are not applied when relative paths areAriel J. Bernal2013-10-091-7/+12
| | | | | | | | | | specified. In particular it makes sure that relative paths for non-virtual files aren't made absolute. Added unittest test. llvm-svn: 192299
* Fixed replacements for files with relative paths are not applied.Ariel J. Bernal2013-10-011-1/+12
| | | | | | | | Replacements were no applied when using a compilation database with paths in the compilation command relative to the compile directory. This patch makes those paths abosulte. llvm-svn: 191776
* Move Compilation::PrintJob and PrintDiagnosticJob into Job::Print.Hans Wennborg2013-09-121-2/+2
| | | | | | | | | | | | | | | | | This moves the code to Job.cpp, which seems like a more natural fit, and replaces the "is this a JobList? is this a Command?" logic with a virtual function call. It also removes the code duplication between PrintJob and PrintDiagnosticJob and simplifies the code a little. There's no functionality change here, except that the Executable is now always printed within quotes, whereas it would previously not be quoted in crash reports, which I think was a bug. Differential Revision: http://llvm-reviews.chandlerc.com/D1653 llvm-svn: 190620
* Simplify code with the in place path::native. No functionality change.Benjamin Kramer2013-09-111-3/+2
| | | | llvm-svn: 190515
* Adding a vector version of clang::tooling::shiftedCodePosition().Edwin Vane2013-08-271-0/+17
| | | | | | | | | During the transition of clang::tooling::Replacements from std::set to std::vector, functions such as clang::tooling::applyAllReplacements() have been duplicated to take a std::vector<Replacement>. Applying this same temporary duplication to clang::tooling::shiftedCodePosition(). llvm-svn: 189358
* Tweak Replacement comparisonsEdwin Vane2013-08-161-13/+14
| | | | | | | | * Introduce operator< to replace Replacement::Less * Make operator== and operator< on Replacements non-member functions * Change order of comparisons in operator< to do string comparisons last llvm-svn: 188550
* Adding a vector version of tooling::applyAllReplacementsEdwin Vane2013-08-131-0/+17
| | | | | | | | | | | One day soon, tooling::Replacements will be changed from being implemented as an std::set to being implemented as an std::vector. Until then, some new code using vectors of Replacements would enjoy having a version of applyAllReplacements that takes a vector. Differential Revision: http://llvm-reviews.chandlerc.com/D1380 llvm-svn: 188295
* Fixing a conflict detection bug in tooling::deduplicateEdwin Vane2013-08-131-2/+3
| | | | | | | | If a Replacment is contained within the conflict range being built, the conflict range would be erroneously shortened. Now fixed. Tests updated to catch this case. llvm-svn: 188287
* Fix warning in builds without asserts.Rafael Espindola2013-08-101-0/+1
| | | | llvm-svn: 188132
* Simplify now that llvm::sys::current_path checks $PWD.Rafael Espindola2013-08-101-12/+5
| | | | llvm-svn: 188128
* Introduce Replacement deduplication and conflict detection functionEdwin Vane2013-08-081-0/+44
| | | | | | | | | | Summary: This patch adds tooling::deduplicate() which removes duplicates from and looks for conflicts in a vector of Replacements. Differential Revision: http://llvm-reviews.chandlerc.com/D1314 llvm-svn: 187979
* Allow clang tools to display an overview when using the CommonOptionsParser.Manuel Klimek2013-07-191-2/+3
| | | | | | Patch by Guillaume Papin. llvm-svn: 186671
* Constify Replacements parameter to applyAllReplacements.David Blaikie2013-07-171-4/+4
| | | | | | | | http://llvm-reviews.chandlerc.com/D1169 Patch by Guillaume Papin. llvm-svn: 186526
* Update for llvm API change.Rafael Espindola2013-07-161-2/+2
| | | | llvm-svn: 186448
* Put helper class in anonymous namespace.Craig Topper2013-07-011-2/+2
| | | | llvm-svn: 185306
* Remove unused include.Rafael Espindola2013-06-261-1/+0
| | | | llvm-svn: 184936
* Use llvm::sys::fs::getMainExecutable.Rafael Espindola2013-06-261-1/+1
| | | | llvm-svn: 184915
* In tooling, reenable freeing of datastructures in codegen, just as we do forNick Lewycky2013-06-251-0/+1
| | | | | | the frontend. We don't want to respect the -disable-free flag here. llvm-svn: 184861
* Include PathV1.h only where it is used.Rafael Espindola2013-06-171-0/+1
| | | | llvm-svn: 184090
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-3/+4
| | | | | | | | | | | | | | | | | | The big changes are: - Deleting Driver/(Arg|Opt)* - Rewriting includes to llvm/Option/ and re-sorting - 'using namespace llvm::opt' in clang::driver - Fixing the autoconf build by adding option everywhere As discussed in the review, this change includes using directives in header files. I'll make follow up changes to remove those in favor of name specifiers. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D975 llvm-svn: 183989
* Include Path.h instead of PathV2.h.Rafael Espindola2013-06-111-1/+1
| | | | | | I am about to move PathV2.h to Path.h. llvm-svn: 183795
* ClangTool: strip -o from the command linePavel Labath2013-06-062-2/+20
| | | | | | | | | | | | | | Summary: This patch creates a new ArgumentsAdjuster, which removes all -o parameters from the command line. This adjuster is inserted by default into the ClangTool pipeline. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D925 llvm-svn: 183398
* Make clang tools ignore -fcolor-diagnostics and -fdiagnostics-color ↵Alexander Kornienko2013-06-051-2/+10
| | | | | | | | | | | | | | | | | | | retrieved from the compilation database. Summary: Clang tools' diagnostic output could be force colored when a command line from the compilation database contains -fcolor-diagnostics or -fdiagnostics-color. This is not what we want e.g. for vim integration. Reviewers: klimek Reviewed By: klimek CC: cfe-commits, revane, jordan_rose Differential Revision: http://llvm-reviews.chandlerc.com/D917 llvm-svn: 183304
* Enables chaining of argument adjusters in clang tools.Manuel Klimek2013-06-041-4/+16
| | | | | | | | This enables changing clang-check to get extra arguments. Patch by Pavel Labath. llvm-svn: 183227
* Let clang-format move the cursor appropriately.Daniel Jasper2013-05-211-0/+13
| | | | | | | | | With this patch, clang-format will try to keep the cursor at the original code position in editor integrations (implemented for emacs and vim). This means, after formatting, clang-format will try to keep the cursor on the same character of the same token. llvm-svn: 182373
* Add a more convenient interface to use clang-format.Daniel Jasper2013-05-161-13/+44
| | | | | | | | | | | | It turns out that several implementations go through the trouble of setting up a SourceManager and Lexer and abstracting this into a function makes usage easier. Also abstracts SourceManager-independent ranges out of tooling::Refactoring and provides a convenience function to create them from line ranges. llvm-svn: 181997
* ClangTool output cleanupEdwin Vane2013-03-151-2/+8
| | | | | | | | | | 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> llvm-svn: 177177
* Reverting r176944 until Author fixes test failure.Edwin Vane2013-03-131-5/+2
| | | | llvm-svn: 176945
* ClangTool output cleanupEdwin Vane2013-03-131-2/+5
| | | | | | | | | | 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> llvm-svn: 176944
* CommandLineArgumentParser: handle single quotes.Peter Collingbourne2013-03-021-3/+14
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D482 llvm-svn: 176404
* Nuke SetUpBuildDumpLog.Sean Silva2013-01-201-6/+3
| | | | | | | Also, it was the only reason that `argc` and `argv` were being passed into createDiagnostics, so remove those parameters and clean up callers. llvm-svn: 172945
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-125-40/+38
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Fix spurious output in JSONCompilationDatabaseArnaud A. de Grandmaison2013-01-121-5/+1
| | | | llvm-svn: 172321
* Allow RefactoringTool to write to memory instead of always to diskEdwin Vane2013-01-111-29/+34
| | | | | | | | | | | | | | | 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 llvm-svn: 172219
* Style and Doc fix for CommonOptionsParserEdwin Vane2012-12-141-2/+2
| | | | | | | | | | | | - 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 llvm-svn: 170229
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-044-5/+4
| | | | | | | | | | | | | 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. llvm-svn: 169237
* Introduce CompilationDatabase::getAllCompileCommands() that returns allArgyrios Kyrtzidis2012-12-042-9/+30
| | | | | | compile commands of the database and expose it via the libclang API. llvm-svn: 169226
OpenPOWER on IntegriCloud