summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Tooling
Commit message (Collapse)AuthorAgeFilesLines
...
* Reverted r192992 broke windows and freebsd builds.Ariel J. Bernal2013-10-181-46/+0
| | | | llvm-svn: 192997
* This patch fixes replacements that are not applied when relative paths areAriel J. Bernal2013-10-181-0/+46
| | | | | | | | | | 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-53/+0
| | | | llvm-svn: 192313
* This patch fixes replacements that are not applied when relative paths areAriel J. Bernal2013-10-091-0/+53
| | | | | | | | | | specified. In particular it makes sure that relative paths for non-virtual files aren't made absolute. Added unittest test. llvm-svn: 192299
* Add a test case to test RAV visits parameters of implicit copy constructor.Michael Han2013-09-121-3/+7
| | | | llvm-svn: 190632
* Teach RAV to visit parameter variable declarations of implicit functions. ↵Michael Han2013-09-112-1/+30
| | | | | | | | | | | | | | | Fixes PR16182. Normally RAV visits parameter variable declarations of a function by traversing the TypeLoc of the parameter declarations. However, for implicit functions, their parameters don't have any TypeLoc, because they are implicit. So for implicit functions, we visit their parameter variable declarations by traversing them through the function declaration, and visit them accordingly. Reviewed by Richard Smith and Manuel Klimek. llvm-svn: 190528
* Do not quote YAML plain string myself. Let YAMLIO do that.Rui Ueyama2013-09-111-15/+15
| | | | llvm-svn: 190486
* Mark lambda closure classes as being implicitly-generated.James Dennett2013-09-051-0/+26
| | | | | | | | | | | | | | Summary: Closure classes for C++ lambdas are always compiler-generated. This one-line change calls setImplicit(true) on them at creation time, such that a default RecursiveASTVisitor (or any for which shouldVisitImplicitCode returns false) will skip them. Reviewers: rsmith, dblaikie Reviewed By: dblaikie CC: klimek, revane, cfe-commits, jordan_rose Differential Revision: http://llvm-reviews.chandlerc.com/D1593 llvm-svn: 190073
* Adding a vector version of clang::tooling::shiftedCodePosition().Edwin Vane2013-08-271-0/+19
| | | | | | | | | 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
* Adding Replacement serialization supportEdwin Vane2013-08-202-0/+107
| | | | | | | | | | | | | | | | Adding a new data structure for storing the Replacements generated for a single translation unit. Structure contains a vector of Replacements as well a field indicating the main source file of the translation unit. An optional 'Context' field allows for tools to provide any information they want about the context the Replacements were generated in. This context is printed, for example, when detecting conflicts during Replacement deduplication. YAML serialization for this data structure is implemented in this patch. Tests are included. Differential Revision: http://llvm-reviews.chandlerc.com/D1422 llvm-svn: 188818
* Have Range::overlapsWith use positive logicEdwin Vane2013-08-131-0/+1
| | | | | | Improved test to catch missing case. llvm-svn: 188304
* Adding a vector version of tooling::applyAllReplacementsEdwin Vane2013-08-131-0/+15
| | | | | | | | | | | 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-6/+11
| | | | | | | | 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
* Expose LambdaIntroducer::DefaultLoc in the AST's LambdaExpr.James Dennett2013-08-091-1/+20
| | | | | | | | | | | | | | | | | | | | | Summary: Source-centric tools need access to the location of a C++11 lambda expression's capture-default ('&' or '=') when it's present. It's possible for them to find it by re-lexing and re-implementing rules that Clang's parser has already applied, but the cost of storing the SourceLocation and making it available to them is 32 bits per LambdaExpr (a small delta, proportionally), and the simplification in client code is significant. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits, klimek, revane Differential Revision: http://llvm-reviews.chandlerc.com/D1192 llvm-svn: 188121
* Introduce Replacement deduplication and conflict detection functionEdwin Vane2013-08-081-0/+71
| | | | | | | | | | 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
* Adds overlapsWith and contains predicates on tooling::Range.Manuel Klimek2013-07-191-0/+15
| | | | | | Patch by Guillaume Papin. llvm-svn: 186670
* Add a hook RecursiveASTVisitor::TraverseLambdaBody, to enable visitors toJames Dennett2013-07-101-0/+25
| | | | | | | | | | | | | | | | use/maintain additional state from the LambdaExpr while visiting the body of a LambdaExpr. One use for this arises because Clang's AST currently holds lambda bodies in a form prior to their adjustment to refer to captured copies of local variables, and so some clients will need access to the lambda's closure type in order to query how to map VarDecl*s to the FieldDecls of their by-copy captures. This hook is sufficient for at least one such client; to do this without such a hook would require the client to re-implement the whole of TraverseLambdaExpr, which is non-trivial and would likely be more brittle. llvm-svn: 186024
* Use llvm::sys::fs::createTemporaryFile.Rafael Espindola2013-07-052-2/+2
| | | | llvm-svn: 185717
* Bug fix: Make RecursiveASTVisitor<T>::TraverseLambdaExpr callJames Dennett2013-06-301-2/+19
| | | | | | | WalkUpFromLambdaExpr, so that the Visit* functions are called on that AST node. llvm-svn: 185277
* Add enumerators to TestVisitor::Language to allow visitor tests toJames Dennett2013-06-301-2/+3
| | | | | | | | | | | | | | explicitly specify use of C++98 or C++11. Lang_CXX is preserved as an alias for Lang_CXX98. This does not add Lang_CXX1Y or Lang_C11, on the assumption that it's better to add them if/when they are needed. (This is a prerequisite for a test in a later patch for RecursiveASTVisitor.) Reviewed by Richard Smith. llvm-svn: 185276
* Sync file handling logic in RewriterTestContext.h and RefactoringTest.cpp.Rafael Espindola2013-06-261-24/+18
| | | | | | | They are mostly duplicated and got out of sync during the PathV1 removal. We should factor the code somewhere, but for now a FIXME will do. llvm-svn: 185019
* Remove last use of PathV1.h from clang.Rafael Espindola2013-06-261-19/+25
| | | | | | | Instead of creating a temporary directory, remember the set of temporary files we create. llvm-svn: 184951
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-1/+1
| | | | | | | | | | | | | | | | | | 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
* Include PathV1.h in a file that uses it.Rafael Espindola2013-06-111-0/+1
| | | | llvm-svn: 183786
* Enables chaining of argument adjusters in clang tools.Manuel Klimek2013-06-041-0/+41
| | | | | | | | This enables changing clang-check to get extra arguments. Patch by Pavel Labath. llvm-svn: 183227
* Coding style fix for SourceFileCallbacksEdwin Vane2013-05-301-3/+3
| | | | llvm-svn: 182930
* Tooling: Call back for both begin and end of sourcesEdwin Vane2013-05-291-7/+14
| | | | | | | | | | | | newFrontendActionFactory() took a pointer to a callback to call when a source file was done being processed by an action. This revision updates the callback to include an ante-processing callback as well. Callback-providing class renamed and callback functions themselves renamed. Functions are no longer pure-virtual so users aren't forced to implement both callbacks if one isn't needed. llvm-svn: 182864
* Let clang-format move the cursor appropriately.Daniel Jasper2013-05-211-0/+24
| | | | | | | | | 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
* Use only explicit bool conversion operatorDavid Blaikie2013-05-151-2/+2
| | | | | | | | | | | | | | | | | | | The most common (non-buggy) case are where such objects are used as return expressions in bool-returning functions or as boolean function arguments. In those cases I've used (& added if necessary) a named function to provide the equivalent (or sometimes negative, depending on convenient wording) test. DiagnosticBuilder kept its implicit conversion operator owing to the prevalent use of it in return statements. One bug was found in ExprConstant.cpp involving a comparison of two PointerUnions (PointerUnion did not previously have an operator==, so instead both operands were converted to bool & then compared). A test is included in test/SemaCXX/constant-expression-cxx1y.cpp for the fix (adding operator== to PointerUnion in LLVM). llvm-svn: 181869
* CommandLineArgumentParser: handle single quotes.Peter Collingbourne2013-03-021-0/+6
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D482 llvm-svn: 176404
* Streamify getNameForDiagnostic and remove the string versions of ↵Benjamin Kramer2013-02-221-2/+3
| | | | | | PrintTemplateArgumentList. llvm-svn: 175894
* Fix a typo in the name of a tooling unit testHal Finkel2013-01-281-1/+1
| | | | llvm-svn: 173658
* fix the unit tests too.Chris Lattner2013-01-192-1/+2
| | | | llvm-svn: 172907
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-124-19/+19
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Really sort the #include lines in unittests/...Chandler Carruth2012-12-041-1/+1
| | | | | | I forgot to re-sort after fixing main module headers. llvm-svn: 169244
* Sort the #include lines for unittests/...Chandler Carruth2012-12-043-9/+8
| | | | | | I've tried to place sensible headers at the top as main-module headers. llvm-svn: 169243
* Introduce CompilationDatabase::getAllCompileCommands() that returns allArgyrios Kyrtzidis2012-12-041-0/+49
| | | | | | compile commands of the database and expose it via the libclang API. llvm-svn: 169226
* Allow an ASTConsumer to selectively skip function bodies while parsing. PatchRichard Smith2012-11-271-0/+24
| | | | | | by Olivier Goffart! llvm-svn: 168726
* unittests/ToolingTest.cpp: Suppress ↵NAKAMURA Takumi2012-10-251-0/+2
| | | | | | newFrontendActionFactory.InjectsEndOfSourceFileCallback on Win32 for now. Investigating. llvm-svn: 166674
* Adds the possibility to inject a callback that's called after each ↵Manuel Klimek2012-10-251-0/+30
| | | | | | | | translation unit is processed. This is important when one wants to deduplicate results during one run over a translation unit by pointer identity of AST nodes. llvm-svn: 166671
* Tweak include orderDouglas Gregor2012-10-231-1/+1
| | | | llvm-svn: 166521
* Buildbot debugging is funDouglas Gregor2012-10-232-4/+7
| | | | llvm-svn: 166516
* CompilationDatabaseTest: Fix another Windows path issue.Daniel Jasper2012-10-081-2/+6
| | | | llvm-svn: 165425
* CompilationDatabase: Use //net paths for tests, as they should beDaniel Jasper2012-10-081-40/+42
| | | | | | considered absolute on all platforms. llvm-svn: 165422
* FileNameMatchTrie: Use StringRef instead of Twines where possible.Daniel Jasper2012-10-081-2/+2
| | | | llvm-svn: 165412
* Support symlinks and relative paths in complilation databases.Daniel Jasper2012-10-081-9/+86
| | | | | Review: http://llvm-reviews.chandlerc.com/D30 llvm-svn: 165392
* Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek2012-09-014-4/+5
| | | | | | | This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. llvm-svn: 163050
* Tooling: Add a runToolOnCodeWithArgs() function that allowsNico Weber2012-08-301-3/+6
| | | | | | | | passing additional parameters to a tool. Use this to fix a FIXME in testing code. llvm-svn: 162889
* Allow RecursiveASTVisitor to visit CXXCtorInitializer objects for whichJames Dennett2012-08-242-42/+168
| | | | | | | | | | | isWritten() returns false, if shouldVisitImplicitCode() returns true. Previously those CXXCtorInitializers were always skipped. In order to make this change easier to test, this patch also extends the test class template ExpectedLocationVisitor to support arbitrary numbers of expected matches and disallowed matches. llvm-svn: 162544
OpenPOWER on IntegriCloud