summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling
Commit message (Collapse)AuthorAgeFilesLines
...
* Sure-up MemoryBuffer ownership in JSONCompilationDatabase's ctor.David Blaikie2014-08-081-2/+2
| | | | llvm-svn: 215246
* CompilationDatabase: Sure-up ownership of compilation databases using ↵David Blaikie2014-08-083-25/+24
| | | | | | | | | | | | | std::unique_ptr Diving into the memory leaks fixed by r213851 there was one case of a memory leak of a CompilationDatabase due to not properly taking ownership of the result of "CompilationDatabase::autoDetectFromSource". Given that both implementations and callers have been using unique_ptr to own CompilationDatabase objects - make this explicit in the API to reduce the risk of further leaks. llvm-svn: 215215
* Make clang's rewrite engine a core featureAlp Toker2014-07-161-1/+1
| | | | | | | | | | | | | | | The rewrite facility's footprint is small so it's not worth going to these lengths to support disabling at configure time, particularly since key compiler features now depend on it. Meanwhile the Objective-C rewriters have been moved under the ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still potentially worth excluding from lightweight builds. Tests are now passing with any combination of feature flags. The flags historically haven't been tested by LLVM's build servers so caveat emptor. llvm-svn: 213171
* Update for llvm api change.Rafael Espindola2014-07-061-5/+4
| | | | llvm-svn: 212408
* Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker2014-07-051-2/+2
| | | | llvm-svn: 212369
* Include system_error directly.Rafael Espindola2014-06-122-2/+2
| | | | llvm-svn: 210802
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-123-4/+4
| | | | llvm-svn: 210780
* Remove the last remaining llvm/Config/config.h includesAlp Toker2014-06-041-1/+1
| | | | | | | | | | | | This corrects long-standing misuses of LLVM's internal config.h. In most cases the public llvm-config.h header was intended and we can now remove the old hacks thanks to LLVM r210144. The config.h header is private, won't be installed and should no longer be included by clang or other modules. llvm-svn: 210145
* Don't compare an error_code with nullptr.Rafael Espindola2014-06-011-1/+1
| | | | llvm-svn: 209993
* [C++11] Use 'nullptr'. Tooling edition.Craig Topper2014-05-204-29/+30
| | | | llvm-svn: 209192
* Tooling: use stderr, not stdout for missing command line messagesAlp Toker2014-05-161-2/+2
| | | | | | Matches other tooling output that use stderr. llvm-svn: 208988
* Eliminate DefaultImageName from the Driver constructorAlp Toker2014-05-152-6/+4
| | | | | | | | | | | | All callers were passing in "a.out" or garbage so a sensible default works fine here as a cleanup. This also brings about the possibility of adapting the value based on the driver's compatibility mode in future. The setting can still be changed via Driver::DefaultImageName as needed. llvm-svn: 208926
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-101-0/+1
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. llvm-svn: 208470
* PR19601: std::remove_if does not really remove the elements.Arnaud A. de Grandmaison2014-04-301-2/+3
| | | | | | | | It moves them at the end of the range instead, so an extra erase is needed. It is strange that this code works without the erase. On the other hand, removing the remove_if will make fail some tests. llvm-svn: 207696
* Push unique_ptr ownership of ASTUnits further back into their factories.David Blaikie2014-04-251-7/+9
| | | | llvm-svn: 207237
* Improve ownership of ASTUnits in libTooling by using std::unique_ptr.David Blaikie2014-04-251-8/+8
| | | | llvm-svn: 207229
* [Modules] Update Clang's two files that use DEBUG(...) without definingChandler Carruth2014-04-211-0/+2
| | | | | | DEBUG_TYPE to do so. LLVM's Debug.h requires this as of r206822. llvm-svn: 206823
* Tooling: Move heavyweight vectors around instead of copying.Benjamin Kramer2014-03-201-32/+27
| | | | | | While there convert to range-based for loops. No functionality change. llvm-svn: 204338
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-153-5/+5
| | | | | | class. llvm-svn: 203999
* Check for LLVM_ON_WIN32 instead of _WIN32.Hans Wennborg2014-03-121-1/+2
| | | | | | This is a follow-up to r203624 to address Anton's comment. llvm-svn: 203668
* [C++11] Avoid implicit conversion of ArrayRef to std::vector and use move ↵Benjamin Kramer2014-03-101-1/+2
| | | | | | semantics where appropriate. llvm-svn: 203477
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-073-13/+13
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-072-6/+6
| | | | | | This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
* Added a const qualifier to SourceManager& parameters.Alexander Kornienko2014-03-051-5/+7
| | | | llvm-svn: 202964
* Disable all dependency output options when using the Tooling library.Peter Collingbourne2014-03-021-0/+1
| | | | | | | | | | | | | | It isn't appropriate for a tool to be stomping over the dependency files, especially if the actual build uses a compiler other than Clang or the tool cannot find all the headers for some reason (which would cause the existing dependency file to be deleted). If a tool actually needs to care about dependency files we can think about adding a mechanism for getting to this information. Differential Revision: http://llvm-reviews.chandlerc.com/D2912 llvm-svn: 202669
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202625
* [CMake] Use LINK_LIBS instead of target_link_libraries().NAKAMURA Takumi2014-02-261-2/+1
| | | | llvm-svn: 202238
* [CMake] Get rid of explicit dependencies to include/clang/*.inc and ↵NAKAMURA Takumi2014-02-211-9/+0
| | | | | | | | | | | | | | | | | | | introduce CLANG_TABLEGEN_TARGETS. This does; - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list. - List of targets is added to LLVM_COMMON_DEPENDS. - all clang libraries and targets depend on generated headers. You might wonder this would be regression, but in fact, this is little loss. - Almost all of clang libraries depend on tblgen'd files and clang-tblgen. - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild. - Each library's dependencies to tblgen'd files might vary along headers' structure. It made hard to track and update *really optimal* dependencies. Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS. llvm-svn: 201842
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-072-10/+9
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. llvm-svn: 198686
* CompilationDatabase.cpp:stripPositionalArgs(): Match not "no-integrated-as" ↵NAKAMURA Takumi2013-12-141-1/+2
| | | | | | but "-no-integrated-as", it really fixes r197229. llvm-svn: 197309
* clang-check to ignore -no-integrated-as because certain drivers can't handle itArtyom Skrobov2013-12-131-2/+6
| | | | llvm-svn: 197229
* Filter-out irrelevant command-line options in CommonOptionsParser.Alexander Kornienko2013-12-121-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Leave only -help, -version and options from the specified category. Updated clang-check and clang-tidy. As clang-tidy is in a separate repository, here's the diff: Index: tools/extra/clang-tidy/tool/ClangTidyMain.cpp =================================================================== --- tools/extra/clang-tidy/tool/ClangTidyMain.cpp (revision 197024) +++ tools/extra/clang-tidy/tool/ClangTidyMain.cpp (working copy) @@ -39,7 +39,7 @@ // FIXME: Add option to list name/description of all checks. int main(int argc, const char **argv) { - CommonOptionsParser OptionsParser(argc, argv); + CommonOptionsParser OptionsParser(argc, argv, ClangTidyCategory); SmallVector<clang::tidy::ClangTidyError, 16> Errors; clang::tidy::runClangTidy(Checks, OptionsParser.getCompilations(), Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits, revane, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2379 llvm-svn: 197139
* [CMake] clang/lib: Prune redundant dependencies.NAKAMURA Takumi2013-12-101-1/+0
| | | | llvm-svn: 196864
* [CMake] clang/lib: Satisfy dependencies to add *actually used* libraries on ↵NAKAMURA Takumi2013-12-091-2/+4
| | | | | | | | target_link_libraries() and LLVM_LINK_COMPONENTS. I will prune redundant dependencies later. llvm-svn: 196800
* 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
OpenPOWER on IntegriCloud