summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling
Commit message (Collapse)AuthorAgeFilesLines
* Make ArgumentsAdjuster an std::function.Alexander Kornienko2014-12-033-55/+67
| | | | | | | | | | | | Reviewers: klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6505 llvm-svn: 223248
* Re-apply r222646 (was reverted in r222667). Adding 4 ASTMatchers: ↵Manuel Klimek2014-11-251-3/+11
| | | | | | | | | | | | | | | | | | | | | | | typedefDecl, isInMainFile, isInSystemFile, isInFileMatchingName Change to original: ifndef out tests in Windows due to /-separated paths. Summary: Often one is only interested in matches within the main-file or matches that are not within a system-header, for which this patch adds isInMainFile and isInSystemFile. They take no arguments and narrow down the matches. The isInFileMatchingName is mainly thought for interactive clang-query-sessions, to make a matcher more specific without restarting the session with the files you are interested in for that moment. It takes a string that will be used as regular-expression to match the filename of where the matched node is expanded. Patch by Hendrik von Prince. llvm-svn: 222765
* Reverting r222646; the tests do not pass on Windows. Also reverts r222664, ↵Aaron Ballman2014-11-241-11/+3
| | | | | | which was required for r222646 to compile with Visual Studio 2012. llvm-svn: 222667
* Adding 4 ASTMatchers: typedefDecl, isInMainFile, isInSystemFile, ↵Manuel Klimek2014-11-241-3/+11
| | | | | | | | | | | | | | | | | | | | isInFileMatchingName Summary: Often one is only interested in matches within the main-file or matches that are not within a system-header, for which this patch adds isInMainFile and isInSystemFile. They take no arguments and narrow down the matches. The isInFileMatchingName is mainly thought for interactive clang-query-sessions, to make a matcher more specific without restarting the session with the files you are interested in for that moment. It takes a string that will be used as regular-expression to match the filename of where the matched node is expanded. Patch by Hendrik von Prince. llvm-svn: 222646
* [Tooling] Restore current directory after processing each file.Alexander Kornienko2014-11-101-2/+17
| | | | | | | | | | | | | | | | | | Summary: If we actually change directory before processing a file, we need to restore it afterwards. This was broken in r216620. Added a comment for the changes in r216620. Reviewers: klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6162 llvm-svn: 221600
* [clang-tidy] Move -extra-arg handling to CommonOptionsProviderAlexander Kornienko2014-11-042-0/+73
| | | | | | | | | | | | | | | | | | Summary: Handle -extra-arg and -extra-arg-before options in the CommonOptionsProvider so they can be used in all clang tools. Adjust arguments in a CompilationDatabase wrapper instead of adding ArgumentsAdjuster to the tool. Reviewers: djasper, klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6073 llvm-svn: 221248
* [CMake] Prune redundant libdeps.NAKAMURA Takumi2014-10-301-1/+0
| | | | llvm-svn: 220893
* [CMake] clangToolingCore requires clangLex.NAKAMURA Takumi2014-10-301-0/+1
| | | | llvm-svn: 220889
* Refactor libTooling to reduce required dependencies.Daniel Jasper2014-10-296-261/+316
| | | | | | | | | | This moves classes for storing and applying replacements to separate files. These classes specifically are used by clang-format which doesn't have any other dependencies on clangAST. Thereby, the size of clang-format's binary can be cut roughly in half and its build time sped up. llvm-svn: 220867
* Driver: Use pointee_iterator rather than iterating over unique_ptrsJustin Bogner2014-10-032-6/+5
| | | | | | | | There's probably never a good reason to iterate over unique_ptrs. This lets us use range-for and say Job.foo instead of (*it)->foo in a few places. llvm-svn: 218938
* Clean up ClangTool's argument adjuster handling a bit with unique_ptr.Benjamin Kramer2014-09-241-18/+5
| | | | | | Make the dtor non-virtual while there. No functionality change. llvm-svn: 218379
* Tooling: Ignore file names in tooling::deduplicate.Benjamin Kramer2014-09-091-5/+19
| | | | | | | | | | | This was horribly broken due to how the sort predicate works. We would report a conflict for files with a replacement in the same position but different names if the length differed. Just ignore paths as this is often what the user wants. Files can occur with different names (due to symlinks or relative paths) and we don't ever want to do the same edit in one file twice. llvm-svn: 217439
* unique_ptrify JobList::JobsDavid Blaikie2014-09-042-8/+8
| | | | llvm-svn: 217168
* Query CompilationDatabase right before running each compilation.Alexander Kornienko2014-08-271-49/+44
| | | | | | | | | | | | | | | | | Summary: Query CompilationDatabase right before running each compilation. This allows supporting compilation databases that change external state required for successful compilation. Reviewers: klimek, djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D5086 llvm-svn: 216620
* Overload SourceManager::overrideFileContents so that unconditionally passing ↵David Blaikie2014-08-271-1/+1
| | | | | | | | | | ownership is explicitly done using unique_ptr. Only those callers who are dynamically passing ownership should need the 3 argument form. Those accepting the default ("do pass ownership") should do so explicitly with a unique_ptr now. llvm-svn: 216614
* Update for LLVM api change.Rafael Espindola2014-08-272-4/+7
| | | | llvm-svn: 216585
* 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
OpenPOWER on IntegriCloud