[all-commits] [llvm/llvm-project] d81d69: [libTooling] Change Transformer's `cat` to handle ...

Yitzhak Mandelbaum via All-commits all-commits at lists.llvm.org
Fri Jun 19 11:49:53 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d81d69f1c0c161e093531cf1ac9c1fa280ab5bf1
      https://github.com/llvm/llvm-project/commit/d81d69f1c0c161e093531cf1ac9c1fa280ab5bf1
  Author: Yitzhak Mandelbaum <yitzhakm at google.com>
  Date:   2020-06-19 (Fri, 19 Jun 2020)

  Changed paths:
    M clang-tools-extra/test/clang-tidy/checkers/abseil-string-find-str-contains.cpp
    M clang/lib/Tooling/Transformer/Stencil.cpp
    M clang/unittests/Tooling/StencilTest.cpp

  Log Message:
  -----------
  [libTooling] Change Transformer's `cat` to handle some cases of text in macros.

Summary:
Currently, `cat` validates range selections before extracting the corresponding
source text. However, this means that any range inside a macro is rejected as an
error. This patch changes the implementation to first try to map the range to
something reasonable. This makes the behavior consistent with handling of ranges
used for selecting portions of the source to edit.

Also updates a clang-tidy lit-test for one of the checks which was affected by
this change.

Reviewers: gribozavr2, tdl-g

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82126




More information about the All-commits mailing list