summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Tooling
Commit message (Collapse)AuthorAgeFilesLines
...
* [LibTooling] Add RangeSelector library for defining source ranges based on ↵Yitzhak Mandelbaum2019-05-202-0/+499
| | | | | | | | | | | | | | | | | | | | | | bound AST nodes. Summary: The RangeSelector library defines a combinator language for specifying source ranges based on bound ids for AST nodes. The combinator approach follows the design of the AST matchers. The RangeSelectors defined here will be used in both RewriteRule, for specifying source affected by edit, and in Stencil for specifying source to use constructively in a replacement. Reviewers: ilya-biryukov Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61774 llvm-svn: 361152
* [Syntax] Introduce TokenBuffer, start clangToolingSyntax libraryIlya Biryukov2019-05-203-0/+677
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: TokenBuffer stores the list of tokens for a file obtained after preprocessing. This is a base building block for syntax trees, see [1] for the full proposal on syntax trees. This commits also starts a new sub-library of ClangTooling, which would be the home for the syntax trees and syntax-tree-based refactoring utilities. [1]: https://lists.llvm.org/pipermail/cfe-dev/2019-February/061414.html Reviewers: gribozavr, sammccall Reviewed By: sammccall Subscribers: mgrang, riccibruno, Eugene.Zelenko, mgorny, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59887 llvm-svn: 361148
* [LibTooling] Add support to Transformer for composing rules as an ordered ↵Yitzhak Mandelbaum2019-05-171-2/+89
| | | | | | | | | | | | | | | | | | | | choice. This revision updates `RewriteRule` to support multiple subrules that are interpreted as an ordered-choice (apply the first one that matches). With this feature, users can write the rules that appear later in the list of subrules knowing that previous rules' patterns *have not matched*, freeing them from reasoning about those cases in the current pattern. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61335 llvm-svn: 361037
* [Tooling] Add -x flags when inferring compile commands for files with ↵Sam McCall2019-05-071-2/+5
| | | | | | | | | | | | | | | | no/invalid extension. Summary: We treat them as headers, as the motivating case is C++ standard library. Reviewers: kadircet Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61633 llvm-svn: 360153
* [c++20] Implement P0428R2 - Familiar template syntax for generic lambdasHamza Sood2019-05-041-0/+53
| | | | | | Differential Revision: https://reviews.llvm.org/D36527 llvm-svn: 359967
* [LibTooling] Fix broken test after r359574.Yitzhak Mandelbaum2019-04-301-3/+5
| | | | | | r359574 changed the way that failures are reported, which broke the test TransformerTest.NodePartNameDeclRefFailure which detects a faiure. llvm-svn: 359578
* [LibTooling] Change Transformer's TextGenerator to a partial function.Yitzhak Mandelbaum2019-04-301-23/+59
| | | | | | | | | | | | | | | | | | | | | | Summary: Changes the signature of the TextGenerator std::function to return an Expected<std::string> instead of std::string to allow for (non-fatal) failures. Previously, we expected that any failures would be expressed with assertions. However, that's unfriendly to running the code in servers or other places that don't want their library calls to crash the program. Correspondingly, updates Transformer's handling of failures in TextGenerators and the signature of `ChangeConsumer`. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61015 llvm-svn: 359574
* Fix gcc "-Wdangling-else" warning. NFCI.Simon Pilgrim2019-04-301-1/+2
| | | | llvm-svn: 359551
* [LibTooling] Fix -Wsign-compare after r358697Bjorn Pettersson2019-04-191-2/+2
| | | | llvm-svn: 358745
* [LibTooling] Extend Transformer to support multiple simultaneous changes.Yitzhak Mandelbaum2019-04-181-70/+105
| | | | | | | | | | | | | | | | Summary: This revision allows users to specify independent changes to multiple (related) sections of the input. Previously, only a single section of input could be selected for replacement. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60408 llvm-svn: 358697
* [LibTooling] Add Stencil library for format-string style codegen.Yitzhak Mandelbaum2019-04-182-0/+224
| | | | | | | | | | | | | | | | | | | | | Summary: This file defines the *Stencil* abstraction: a code-generating object, parameterized by named references to (bound) AST nodes. Given a match result, a stencil can be evaluated to a string of source code. A stencil is similar in spirit to a format string: it is composed of a series of raw text strings, references to nodes (the parameters) and helper code-generation operations. See thread on cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling" for background. Reviewers: sbenza Reviewed By: sbenza Subscribers: ilya-biryukov, mgorny, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59371 llvm-svn: 358691
* [clang-tidy] Add fix descriptions to clang-tidy checks.Haojian Wu2019-04-171-82/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Motivation/Context: in the code review system integrating with clang-tidy, clang-tidy doesn't provide a human-readable description of the fix. Usually developers have to preview a code diff (before vs after apply the fix) to understand what the fix does before applying a fix. This patch proposes that each clang-tidy check provides a short and actional fix description that can be shown in the UI, so that users can know what the fix does without previewing diff. This patch extends clang-tidy framework to support fix descriptions (will add implementations for existing checks in the future). Fix descriptions and fixes are emitted via diagnostic::Note (rather than attaching the main warning diagnostic). Before this patch: ``` void MyCheck::check(...) { ... diag(loc, "my check warning") << FixtItHint::CreateReplacement(...); } ``` After: ``` void MyCheck::check(...) { ... diag(loc, "my check warning"); // Emit a check warning diag(loc, "fix description", DiagnosticIDs::Note) << FixtItHint::CreateReplacement(...); // Emit a diagnostic note and a fix } ``` Reviewers: sammccall, alexfh Reviewed By: alexfh Subscribers: MyDeveloperDay, Eugene.Zelenko, aaron.ballman, JonasToth, xazax.hun, jdoerfert, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D59932 llvm-svn: 358576
* [Lookup] Invisible decls should not be ambiguous when renaming.Eric Liu2019-04-151-6/+40
| | | | | | | | | | | | | | | | | | Summary: For example, a renamed type in a header file can conflict with declaration in a random file that includes the header, but we should not consider the decl ambiguous if it's not visible at the rename location. This improves consistency of generated replacements when header file is included in different TUs. Reviewers: hokein Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60257 llvm-svn: 358378
* [Tooling] add a Heuristic field indicating that a CompileCommand was guessed.Sam McCall2019-04-051-9/+28
| | | | | | | | | | | | | | | | | | | | Summary: Use cases: - a tool that dumps the heuristic used for each header in a project can be used to evaluate changes to the heuristic - we want to expose this information to users in clangd as it affects accuracy/reliability of editor features - express interpolation tests more directly Reviewers: ilya-biryukov, klimek Subscribers: ioeric, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60194 llvm-svn: 357770
* [LibTooling] Add Transformer, a library for source-to-source transformations.Yitzhak Mandelbaum2019-04-052-0/+390
| | | | | | | | | | | | | | | | Summary: Adds a basic version of Transformer, a library supporting the concise specification of clang-based source-to-source transformations. A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling". Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, ABataev, mgorny, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59376 llvm-svn: 357768
* [LibTooling] Add "SourceCode" library for functions relating to source-code ↵Yitzhak Mandelbaum2019-04-053-29/+98
| | | | | | | | | | | | | | | | | | | | | | | | | manipulation. Summary: Introduces a utility library in Refactoring/ to collect routines related to source-code manipulation. In this change, we move "extended-range" functions from the FixIt library (in clangTooling) to this new library. We need to use this functionality in Refactoring/ and cannot access it if it resides in Tooling/, because that would cause clangToolingRefactor to depend on clangTooling, which would be a circular dependency. Reviewers: ilya-biryukov, ioeric Reviewed By: ilya-biryukov Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60269 llvm-svn: 357764
* Revert "[LibTooling] Add Transformer, a library for source-to-source ↵Alexey Bataev2019-04-032-390/+0
| | | | | | | | | transformations." This reverts commit r357576 to fix the problem with the cyclic dependencies between libTooling and libToolingRefactor. llvm-svn: 357612
* [LibTooling] Add Transformer, a library for source-to-source transformations.Yitzhak Mandelbaum2019-04-032-0/+390
| | | | | | | | | | | | | | | | Summary: Adds a basic version of Transformer, a library supporting the concise specification of clang-based source-to-source transformations. A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling". Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: mgorny, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59376 llvm-svn: 357576
* Range-style std::find{,_if} -> llvm::find{,_if}. NFCFangrui Song2019-03-311-4/+2
| | | | llvm-svn: 357359
* [Tooling] Add more scope specifiers until spelling is not ambiguous.Eric Liu2019-03-191-7/+25
| | | | | | | | | | | | | | | | | | Summary: Previously, when the renamed spelling is ambiguous, we simply use the full-qualfied name (with leading "::"). This patch makes it try adding additional specifiers one at a time until name is no longer ambiguous, which allows us to find better disambuguated spelling. Reviewers: kadircet, gribozavr Subscribers: jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59487 llvm-svn: 356446
* Make getFullyQualifiedName qualify both the pointee and class type for ↵Benjamin Kramer2019-03-151-1/+3
| | | | | | | | | | | member ptr types We already handle pointers and references, member ptrs are just another special case. Fixes PR40732. Differential Revision: https://reviews.llvm.org/D59387 llvm-svn: 356250
* [LibTooling] Add retrieval of extended AST-node source to FixIt libraryYitzhak Mandelbaum2019-03-131-0/+29
| | | | | | | | | | | | | | | | | | | | | Summary: Introduces variants of `getText` and `getSourceRange` that extract the source text of an AST node potentially with a trailing token. Some of the new functions manipulate `CharSourceRange`s, rather than `SourceRange`s, because they document and dynamically enforce their type. So, this revision also updates the corresponding existing FixIt functions to manipulate `CharSourceRange`s. This change is not strictly necessary, but seems like the correct choice, to keep the API self-consistent. This revision is the first in a series intended to improve the abstractions available to users for writing source-to-source transformations. A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling". Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: kimgr, riccibruno, JonasToth, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58556 llvm-svn: 356095
* [clang][Tooling] Delete dots and dotdots when generating absolute pathsKadir Cetinkaya2019-03-081-0/+5
| | | | | | | | | | | | | | | | Summary: GetAllFiles interface returns absolute paths, but keeps dots and dot dots. This patch makes those paths canonical by deleting them. Reviewers: hokein Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59079 llvm-svn: 355678
* Use llvm::is_contained. NFCFangrui Song2019-02-101-1/+1
| | | | llvm-svn: 353635
* [Tooling] Handle #pragma once header guard in include insertion.Eric Liu2019-01-291-3/+11
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D57223 llvm-svn: 352503
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1942-168/+126
| | | | | | | | | | | | | | | | | 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
* [tooling] Add a new argument adjuster for deleting plugin related command ↵Kadir Cetinkaya2019-01-181-0/+31
| | | | | | | | | | | | | | | | line args Summary: Currently both clangd and clang-tidy makes use of this mechanism so putting it into tooling so that all tools can make use of it. Reviewers: ilya-biryukov, sammccall Subscribers: ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D56856 llvm-svn: 351531
* Reapply [Tooling] Make clang-tool find libc++ dir on mac when running on a ↵Sam McCall2019-01-161-34/+18
| | | | | | | | | file without compilation database. This reverts commit r351282, and re-lands r351222 and r351229 with the use-after-free fixed. llvm-svn: 351316
* Revert "[Tooling] Make clang-tool find libc++ dir on mac when running on a ↵Vlad Tsyrklevich2019-01-161-18/+34
| | | | | | | | | file without compilation database." This reverts commits r351222 and r351229, they were causing ASan/MSan failures on the sanitizer bots. llvm-svn: 351282
* [Tooling] Fix broken compliation databse tests.Haojian Wu2019-01-151-34/+18
| | | | | | I forgot to update the unittest in r351222. llvm-svn: 351229
* [AST] Fix double-traversal of code in top-level lambdas in RAV(implicit = yes).Sam McCall2019-01-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Prior to r351069, lambda classes were traversed or not depending on the {Function, Class, Namespace, TU} DeclContext containing them. If it was a function (common case) they were not traversed. If it was a namespace or TU (top-level lambda) they were traversed as part of that DeclContext traversal. r351069 "fixed" RAV to traverse these as part of the LambdaExpr, which is the right place. But top-level lambdas are now traversed twice. We fix that as blocks and block captures were apparently fixed in the past. Maybe it would be nicer to avoid adding the lambda classes to the DeclContext in the first place, but I can't work out the implications of that. Reviewers: bkramer, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56665 llvm-svn: 351075
* [AST] RecursiveASTVisitor visits lambda classes when implicit visitation is on.Sam McCall2019-01-141-14/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes ASTContext's parent map for nodes in such classes (e.g. operator()). https://bugs.llvm.org/show_bug.cgi?id=39949 This also changes the observed shape of the AST for implicit RAVs. - this includes AST MatchFinder: cxxRecordDecl() now matches lambda classes, functionDecl() matches the call operator, and the parent chain is body -> call operator -> lambda class -> lambdaexpr rather than body -> lambdaexpr. - this appears not to matter for the ASTImporterLookupTable builder - this doesn't matter for the other RAVs in-tree. In order to do this, we remove the TraverseLambdaBody hook. The problem is it's hard/weird to ensure this hook is called when traversing via the implicit class. There were just two users of this hook in-tree, who use it to skip bodies. I replaced these with explicitly traversing the captures only. Another approach would be recording the bodies when the lambda is visited, and then recognizing them later. I'd be open to suggestion on how to preserve this hook, instead. Reviewers: aaron.ballman, JonasToth Subscribers: cfe-commits, rsmith, jdennett Differential Revision: https://reviews.llvm.org/D56444 llvm-svn: 351047
* Add explicit dependency on clangSerialization for a bunch of components to ↵Fangrui Song2018-12-121-0/+1
| | | | | | | | | | | | | | | fix -DBUILD_SHARED_LIBS=on build This is a more thorough fix of rC348911. The story about -DBUILD_SHARED_LIBS=on build after rC348907 (Move PCHContainerOperations from Frontend to Serialization) is: 1. libclangSerialization.so defines PCHContainerReader dtor, ... 2. clangFrontend and clangTooling define classes inheriting from PCHContainerReader, thus their DSOs have undefined references on PCHContainerReader dtor 3. Components depending on either clangFrontend or clangTooling cannot be linked unless they have explicit dependency on clangSerialization due to the default linker option -z defs. The explicit dependency could be avoided if libclang{Frontend,Tooling}.so had these undefined references. This patch adds the explicit dependency on clangSerialization to make them build. llvm-svn: 348915
* [unittests] Add C++17 and C++2a support to the tooling testsHamza Sood2018-12-071-0/+4
| | | | llvm-svn: 348603
* Implement YAML serialization of notes in clang::tooling::Diagnostic.Alexander Kornienko2018-11-211-6/+36
| | | | llvm-svn: 347371
* [Support] Teach YAMLIO about polymorphic typesScott Linder2018-11-142-4/+4
| | | | | | | | | | | | | | | | | | | | | Add support for "polymorphic" types to YAMLIO. PolymorphicTraits can dynamically switch between other traits (Scalar, Map, or Sequence). When inputting, the PolymorphicTraits type is told which type to become, and when outputting the PolymorphicTraits type is asked which type it currently is. Also add support for TaggedScalarTraits to allow dynamically differentiating between multiple scalar types using YAML tags. Serialize empty maps as "{}" and empty sequences as "[]", so that types are preserved when round-tripping PolymorphicTraits. This change has equivalent semantics, but may break e.g. tests which compare output verbatim. Differential Revision: https://reviews.llvm.org/D48144 llvm-svn: 346884
* [AST] Allow limiting the scope of common AST traversals (getParents, RAV).Sam McCall2018-11-142-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The goal is to allow analyses such as clang-tidy checks to run on a subset of the AST, e.g. "only on main-file decls" for interactive tools. Today, these become "problematically global" by running RecursiveASTVisitors rooted at the TUDecl, or by navigating up via ASTContext::getParent(). The scope is restricted using a set of top-level-decls that RecursiveASTVisitors should be rooted at. This also applies to the visitor that populates the parent map, and so the top-level-decls are considered to have no parents. This patch makes the traversal scope a mutable property of ASTContext. The more obvious way to do this is to pass the top-level decls to relevant functions directly, but this has some problems: - it's error-prone: accidentally mixing restricted and unrestricted scopes is a performance trap. Interleaving multiple analyses is common (many clang-tidy checks run matchers or RAVs from matcher callbacks) - it doesn't map well to the actual use cases, where we really do want *all* traversals to be restricted. - it involves a lot of plumbing in parts of the code that don't care about traversals. This approach was tried out in D54259 and D54261, I wanted to like it but it feels pretty awful in practice. Caveats: to get scope-limiting behavior of RecursiveASTVisitors, callers have to call the new TraverseAST(Ctx) function instead of TraverseDecl(TU). I think this is an improvement to the API regardless. Reviewers: klimek, ioeric Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D54309 llvm-svn: 346847
* [Tooling] Add "-filter" option to AllTUsExecutionHaojian Wu2018-11-051-2/+5
| | | | | | | | | | | | Summary: We can run the tools on a subset files of compilation database. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D54092 llvm-svn: 346131
* Make YAML quote forward slashes.Zachary Turner2018-10-122-9/+9
| | | | | | | | | | | | | | | | | If you have the string /usr/bin, prior to this patch it would not be quoted by our YAML serializer. But a string like C:\src would be, due to the presence of a backslash. This makes the quoting rules of basically every single file path different depending on the path syntax (posix vs. Windows). While technically not required by the YAML specification to quote forward slashes, when the behavior of paths is inconsistent it makes it difficult to portably write FileCheck lines that will work with either kind of path. Differential Revision: https://reviews.llvm.org/D53169 llvm-svn: 344359
* Revert "Make YAML quote forward slashes."Zachary Turner2018-10-122-9/+9
| | | | | | | | | | This reverts commit b86c16ad8c97dadc1f529da72a5bb74e9eaed344. This is being reverted because I forgot to write a useful commit message, so I'm going to resubmit it with an actual commit message. llvm-svn: 344358
* Make YAML quote forward slashes.Zachary Turner2018-10-122-9/+9
| | | | llvm-svn: 344357
* Lift VFS from clang to llvm (NFC)Jonas Devlieghere2018-10-103-28/+28
| | | | | | | | | | | | | | | | | | | This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 llvm-svn: 344140
* [Sema] Remove location from implicit capture init exprVedant Kumar2018-09-131-5/+5
| | | | | | | | | | | | | | | | | | A lambda's closure is initialized when the lambda is declared. For implicit captures, the initialization code emitted from EmitLambdaExpr references source locations *within the lambda body* in the function containing the lambda. This results in a poor debugging experience: we step to the line containing the lambda, then into lambda, out again, over and over, until every capture's field is initialized. To improve stepping behavior, assign the starting location of the lambda to expressions which initialize an implicit capture within it. rdar://39807527 Differential Revision: https://reviews.llvm.org/D50927 llvm-svn: 342194
* [Tooling] Improve handling of CL-style optionsHamza Sood2018-09-091-3/+30
| | | | | | | | | | | | | | | | | | This patch fixes the handling of clang-cl options in InterpolatingCompilationDatabase. They were previously ignored completely, which led to a lot of bugs: Additional options were being added with the wrong syntax. E.g. a file was specified as C++ by adding -x c++, which causes an error in CL mode. The args were parsed and then rendered, which means that the aliasing information was lost. E.g. /W4 was rendered to -Wall, which in CL mode means -Weverything. CL options were ignored when checking things like -std=, so a lot of logic was being bypassed. Differential Revision: https://reviews.llvm.org/D51321 llvm-svn: 341760
* Parse compile commands lazily in InterpolatingCompilationDatabaseIlya Biryukov2018-08-281-3/+6
| | | | | | | | | | | | | | | | | Summary: This greatly reduces the time to read 'compile_commands.json'. For Chromium on my machine it's now 0.7 seconds vs 30 seconds before the change. Reviewers: sammccall, jfb Reviewed By: sammccall Subscribers: mgrang, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D51314 llvm-svn: 340838
* [Tooling] Add a isSingleProcess() helper to ToolExecutorIlya Biryukov2018-08-241-0/+2
| | | | | | | | | | | | | | | | Summary: Used in clangd's symbol builder to optimize for the common shared-memory executor case. Reviewers: ioeric Reviewed By: ioeric Subscribers: kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51164 llvm-svn: 340599
* Port getLocStart -> getBeginLocStephen Kelly2018-08-098-9/+9
| | | | | | | | | | Reviewers: teemperor! Subscribers: jholewinski, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50350 llvm-svn: 339385
* Fully qualify the renamed symbol if the shortened name is ambiguous.Eric Liu2018-08-031-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For example, when renaming `a::b::x::foo` to `y::foo` below, replacing `x::foo()` with `y::foo()` can cause ambiguity. In such cases, we simply fully qualify the name with leading `::`. ``` namespace a { namespace b { namespace x { void foo() {} } namespace y { void foo() {} } } } namespace a { namespace b { void f() { x::foo(); } } } ``` Reviewers: ilya-biryukov, hokein Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50189 llvm-svn: 338832
* [Tooling] Add operator== to CompileCommandSimon Marchi2018-07-171-0/+28
| | | | | | | | | | | | Summary: It does the obvious thing of comparing all fields. This will be needed for a clangd patch I have in the pipeline. Subscribers: dblaikie, ilya-biryukov, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D49265 llvm-svn: 337284
* [clang][tooling] Don't forget to link to clangToolingInclusions.Roman Lebedev2018-06-041-0/+1
| | | | | | | Fixes build with shared libs, broken by rL333874. Some buildbot converage is sorely missing. llvm-svn: 333890
OpenPOWER on IntegriCloud