summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/ASTDiff/ASTDiff.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Fixes -Wrange-loop-analysis warningsMark de Wever2020-01-011-1/+1
| | | | | | This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71857
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-8/+8
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368942
* [AST] Update the comments of the various Expr::Ignore* + Related cleanupsBruno Ricci2019-02-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The description of what the various Expr::Ignore* do has drifted from the actual implementation. Inspection reveals that IgnoreParenImpCasts() is not equivalent to doing IgnoreParens() + IgnoreImpCasts() until reaching a fixed point, but IgnoreParenCasts() is equivalent to doing IgnoreParens() + IgnoreCasts() until reaching a fixed point. There is also a fair amount of duplication in the various Expr::Ignore* functions which increase the chance of further future inconsistencies. In preparation for the next patch which will factor out the implementation of the various Expr::Ignore*, do the following cleanups: Remove Stmt::IgnoreImplicit, in favor of Expr::IgnoreImplicit. IgnoreImplicit is the only function among all of the Expr::Ignore* which is available in Stmt. There are only a few users of Stmt::IgnoreImplicit. They can just use instead Expr::IgnoreImplicit like they have to do for the other Ignore*. Move Expr::IgnoreImpCasts() from Expr.h to Expr.cpp. This made no difference in the run-time with my usual benchmark (-fsyntax-only on all of Boost). While we are at it, make IgnoreParenNoopCasts take a const reference to the ASTContext for const correctness. Update the comments to match what the Expr::Ignore* are actually doing. I am not sure that listing exactly what each Expr::Ignore* do is optimal, but it certainly looks better than the current state which is in my opinion between misleading and just plain wrong. The whole patch is NFC (if you count removing Stmt::IgnoreImplicit as NFC). Differential Revision: https://reviews.llvm.org/D57266 Reviewed By: aaron.ballman llvm-svn: 353006
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Use llvm::{all,any,none}_of instead std::{all,any,none}_of. NFCFangrui Song2018-10-201-3/+2
| | | | llvm-svn: 344859
* llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)Fangrui Song2018-09-261-1/+1
| | | | | | | | | | | | | | Summary: The convenience wrapper in STLExtras is available since rL342102. Reviewers: rsmith, #clang, dblaikie Reviewed By: rsmith, #clang Subscribers: mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52576 llvm-svn: 343147
* Fix typos in clangAlexander Kornienko2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* [clang] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-03-271-1/+1
| | | | | | | | | | | r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. llvm-svn: 328636
* [clang-diff] Treat CXXCtorInitializer as a nodeJohannes Altmanninger2017-08-271-26/+36
| | | | | | | | | | Reviewers: arphaman Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D37002 llvm-svn: 311865
* [clang-diff] Remove NodeCountVisitor, NFCJohannes Altmanninger2017-08-251-35/+3
| | | | | | | | Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D37000 llvm-svn: 311770
* [clang-diff] Fix getRelativeNameJohannes Altmanninger2017-08-221-2/+4
| | | | | | Handle the case when DeclContext is null. llvm-svn: 311434
* [clang-diff] Use the relative name for NamedDeclJohannes Altmanninger2017-08-221-16/+57
| | | | | | | | | | | | | | Summary: If a node referring to a name is within a class or namespace, do not use the full qualified name, but strip the namespace prefix. Reviewers: arphaman, bkramer Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36681 llvm-svn: 311433
* [clang-diff] Improve and test getNodeValueJohannes Altmanninger2017-08-201-39/+87
| | | | | | | | | | | | Summary: Use qualified names if available. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36186 llvm-svn: 311292
* [clang-diff] Fix similarity computationJohannes Altmanninger2017-08-201-13/+22
| | | | | | | | | | | | | | Summary: Add separate tests for the top-down and the bottom-up phase, as well as one for the optimal matching. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36185 llvm-svn: 311284
* [clang-diff] Filter AST nodesJohannes Altmanninger2017-08-201-1/+16
| | | | | | | | | | | | | | Summary: Ignore macros and implicit AST nodes, as well as anything outside of the main source file. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36184 llvm-svn: 311280
* [clang-diff] Simplify mappingJohannes Altmanninger2017-08-191-59/+15
| | | | | | | | | | | | | | | | | | | Summary: Until we find a decent heuristic on how to choose between multiple identical trees, there is no point in supporting multiple mappings. This also enables matching of nodes with parents of different types, because there are many instances where this is appropriate. For example for and foreach statements; functions in the global or other namespaces. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36183 llvm-svn: 311251
* Revert "Revert "[clang-diff] Move printing of matches and changes to ↵Johannes Altmanninger2017-08-191-181/+142
| | | | | | | | | | clang-diff"" Fix build by renaming ChangeKind -> Change This reverts commit 0c78c5729f29315d7945988efd048c0cb86c07ce. llvm-svn: 311222
* Revert "Revert "[clang-diff] Move the JSON export function to clang-diff""Johannes Altmanninger2017-08-191-26/+28
| | | | | | | This reverts commit eac4c13ac9ea8f12bc049e040c7b9c8a517f54e7, the original commit *should* not have caused the build failure. llvm-svn: 311216
* Revert "[clang-diff] Move the JSON export function to clang-diff"Vlad Tsyrklevich2017-08-181-28/+26
| | | | | | This reverts commit r311199, it was causing widespread build failures. llvm-svn: 311211
* Revert "[clang-diff] Move printing of matches and changes to clang-diff"Vlad Tsyrklevich2017-08-181-143/+181
| | | | | | This reverts commit r311200, it was causing widespread build failures. llvm-svn: 311210
* [clang-diff] Move printing of matches and changes to clang-diffJohannes Altmanninger2017-08-181-181/+143
| | | | | | | | | | | | | | | Summary: This also changes the output order of the changes. Now the matches are printed in pre-order, intertwined with insertions, updates, and moves. Deletions are printed afterwards. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36179 llvm-svn: 311200
* [clang-diff] Move the JSON export function to clang-diffJohannes Altmanninger2017-08-181-26/+28
| | | | | | | | | | Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36178 llvm-svn: 311199
* [clang-diff] Fix some errors and inconsistenciesJohannes Altmanninger2017-08-181-32/+25
| | | | | | | | | | | | | | | | Fix to the computation of the rightmost descendant. Prevents root nodes from being mapped if they are already mapped. This only makes a difference when we compare AST Nodes other than entire translation units, a feature which still has to be tested. Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36176 llvm-svn: 311172
* [clang-diff] Renames, NFCJohannes Altmanninger2017-08-011-93/+90
| | | | llvm-svn: 309738
* [clang-diff] Move data declarations to the public headerJohannes Altmanninger2017-08-011-7/+116
| | | | llvm-svn: 309737
* [clang-diff] Get rid of unused variable warnings in ASTDiff.cppAlex Lorenz2017-07-211-6/+4
| | | | llvm-svn: 308737
* Fix another compiler error from r308731Alex Lorenz2017-07-211-1/+1
| | | | | | | std::pair in emplace back couldn't be constructed because SNodeId has an explicit constructor. Not sure how this even compiled on my machine before. llvm-svn: 308734
* Fix tuple construction compiler error from r308731Alex Lorenz2017-07-211-1/+1
| | | | llvm-svn: 308733
* [clang-diff] Add initial implementationAlex Lorenz2017-07-211-0/+912
This is the first commit for the "Clang-based C/C++ diff tool" GSoC project. ASTDiff is a new library that computes a structural AST diff between two ASTs using the gumtree algorithm. Clang-diff is a new Clang tool that will show the structural code changes between different ASTs. Patch by Johannes Altmanninger! Differential Revision: https://reviews.llvm.org/D34329 llvm-svn: 308731
OpenPOWER on IntegriCloud