[all-commits] [llvm/llvm-project] cf4287: [libTooling] Add assorted `EditGenerator` combinat...

Yitzhak Mandelbaum via All-commits all-commits at lists.llvm.org
Fri Jul 24 06:15:00 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: cf428778128fed5eacee884964af53bf4a9f74f2
      https://github.com/llvm/llvm-project/commit/cf428778128fed5eacee884964af53bf4a9f74f2
  Author: Yitzhak Mandelbaum <yitzhakm at google.com>
  Date:   2020-07-24 (Fri, 24 Jul 2020)

  Changed paths:
    M clang/include/clang/Tooling/Transformer/MatchConsumer.h
    M clang/include/clang/Tooling/Transformer/RewriteRule.h
    M clang/lib/Tooling/Transformer/RewriteRule.cpp
    M clang/unittests/Tooling/TransformerTest.cpp

  Log Message:
  -----------
  [libTooling] Add assorted `EditGenerator` combinators.

Summary:
This patch adds various combinators that help in constructing `EditGenerator`s:
   * `noEdits`
   * `ifBound`, specialized to `ASTEdit`
   * `flatten` and `flattenVector` which allow for easy construction from a set
     of sub edits.
   * `shrinkTo`, which generates edits to shrink a given range to another that
     it encloses.

Reviewers: asoffer, gribozavr2

Subscribers: cfe-commits

Tags: #clang

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




More information about the All-commits mailing list