summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/CompilationDatabase.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Roll-back r250822.Angel Garcia Gomez2015-10-201-2/+2
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-2/+2
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* [tooling] In CompileCommand, Expose the 'file' that was associated with the ↵Argyrios Kyrtzidis2015-09-111-1/+3
| | | | | | command. llvm-svn: 247468
* Use LLVM_ATTRIBUTE_UNUSED to hide gcc 5.1 unused variable warning.Yaron Keren2015-08-071-1/+1
| | | | | | Suggestion by David Blaikie! llvm-svn: 244326
* Silence tools/clang/lib/Tooling/CompilationDatabase.cpp:328:12: warning:Yaron Keren2015-08-071-1/+1
| | | | | | | ‘clang::tooling::JSONAnchorDest’ defined but not used [-Wunused-variable] from gcc 5.1. llvm-svn: 244312
* Driver: Remove the Job class. NFCJustin Bogner2015-07-021-8/+5
| | | | | | | | | | | We had a strange relationship here where we made a list of Jobs inherit from a single Job, but there weren't actually any places where this arbitrary nesting was used or needed. Simplify all of this by removing Job entirely and updating all of the users to either work with a JobList or a single Command. llvm-svn: 241310
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-2/+1
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* Improve const-nessDavid Blaikie2015-04-171-5/+3
| | | | | | | | This allows callers to pass a char ** (such as the one coming from the standard decreed main declaration - even though everyone usually puts const on that themselves). llvm-svn: 235150
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
* Tooling: Hide implementation detailsBenjamin Kramer2015-03-091-3/+7
| | | | | | NFC. llvm-svn: 231656
* Driver: Use pointee_iterator rather than iterating over unique_ptrsJustin Bogner2014-10-031-4/+3
| | | | | | | | 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
* unique_ptrify JobList::JobsDavid Blaikie2014-09-041-3/+3
| | | | llvm-svn: 217168
* CompilationDatabase: Sure-up ownership of compilation databases using ↵David Blaikie2014-08-081-14/+13
| | | | | | | | | | | | | 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
* Include system_error directly.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210802
* [C++11] Use 'nullptr'. Tooling edition.Craig Topper2014-05-201-5/+5
| | | | llvm-svn: 209192
* Eliminate DefaultImageName from the Driver constructorAlp Toker2014-05-151-3/+3
| | | | | | | | | | | | 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
* [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-071-3/+3
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-1/+1
| | | | llvm-svn: 202625
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-071-9/+8
| | | | | | | 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
* Fixed a bad assert from r194968. r194969 removed the assert.Richard Trieu2013-12-051-0/+1
| | | | llvm-svn: 196463
* 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
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-2/+2
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | 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-041-0/+5
| | | | | | compile commands of the database and expose it via the libclang API. llvm-svn: 169226
* Only report first error when no compilation database is found.Daniel Jasper2012-10-151-2/+7
| | | | | Review: http://llvm-reviews.chandlerc.com/D62 llvm-svn: 165933
* Use LLVM's plugin registry to enable registering new compilationDaniel Jasper2012-08-241-256/+36
| | | | | | | databases. Move JSONCompilationDatabase.h to its own files and register it as plugin. llvm-svn: 162541
* Add a custom initialize hook for clang tools + minor fixes in ↵Alexander Kornienko2012-07-171-1/+1
| | | | | | CustomCompilationDatabase.h llvm-svn: 160369
* Allows retrieving all files in a CompilationDatabase.Manuel Klimek2012-07-131-0/+20
| | | | | | Patch by Tobias Koenig, some test changes by myself. llvm-svn: 160167
* Add a hook to supply a custom CompilationDatabase. To add a custom ↵Daniel Jasper2012-07-111-0/+9
| | | | | | | | CompilationDatabase, make it implement findCompilationDatabaseForDirectory in CustomCompilationDatabase.h and set USE_COSTUM_COMPILATION_DATABASE. Differential Revision: http://llvm-reviews.chandlerc.com/D4 llvm-svn: 160061
* Adds support for auto-detection of compilation databases, looking in a ↵Arnaud A. de Grandmaison2012-07-101-9/+33
| | | | | | directory and all its parents. llvm-svn: 159998
* Adds support for auto-detection of compilation databasesManuel Klimek2012-07-101-1/+18
| | | | | | | | | | 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. llvm-svn: 159990
* Tooling: Canonicalize Key in IndexByFile[]. llvm::sys::path::native() may be ↵NAKAMURA Takumi2012-05-231-2/+6
| | | | | | | | used here. It fixes test/Tooling on Win32 hosts. llvm-svn: 157350
* Fixes crasher bug in JSONCompilationDatabase for invalid input.Manuel Klimek2012-05-151-6/+22
| | | | llvm-svn: 156814
* Adds a FixedCompilationDatabase to be able to specify tool parametersManuel Klimek2012-04-181-0/+27
| | | | | | at the command line. llvm-svn: 154989
* Switches the JSONCompilationDatabase to use the YAML parser.Manuel Klimek2012-04-171-36/+45
| | | | | | | | | | | | | | | | | 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). llvm-svn: 154929
* Adds a tooling library.Manuel Klimek2012-04-041-0/+230
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. llvm-svn: 154008
OpenPOWER on IntegriCloud