[all-commits] [llvm/llvm-project] 489449: [libTooling] Further simplify `Stencil` type and i...

Yitzhak Mandelbaum via All-commits all-commits at lists.llvm.org
Mon Nov 11 09:45:34 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 489449c28aaa45086d507fbad96826420adf409d
      https://github.com/llvm/llvm-project/commit/489449c28aaa45086d507fbad96826420adf409d
  Author: Yitzhak Mandelbaum <yitzhakm at google.com>
  Date:   2019-11-11 (Mon, 11 Nov 2019)

  Changed paths:
    M clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp
    M clang/include/clang/Tooling/Transformer/MatchConsumer.h
    M clang/include/clang/Tooling/Transformer/RewriteRule.h
    M clang/include/clang/Tooling/Transformer/Stencil.h
    M clang/lib/Tooling/Transformer/RewriteRule.cpp
    M clang/lib/Tooling/Transformer/Stencil.cpp
    M clang/unittests/Tooling/StencilTest.cpp
    M clang/unittests/Tooling/TransformerTest.cpp

  Log Message:
  -----------
  [libTooling] Further simplify `Stencil` type and introduce `MatchComputation`.

Summary:
This revision introduces a new interface `MatchComputation` which generalizes
the `Stencil` interface and replaces the `std::function` interface of
`MatchConsumer`. With this revision, `Stencil` (as an abstraction) becomes just
one collection of implementations of
`MatchComputation<std::string>`. Correspondingly, we remove the `Stencil` class
entirely in favor of a simple type alias, deprecate `MatchConsumer` and change
all functions that accepted `MatchConsumer<std::string>` to use
`MatchComputation<std::string>` instead.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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




More information about the All-commits mailing list