[libTooling] Change Stencil equality to use `toString()`
authorYitzhak Mandelbaum <yitzhakm@google.com>
Fri, 11 Oct 2019 14:02:03 +0000 (14:02 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Fri, 11 Oct 2019 14:02:03 +0000 (14:02 +0000)
commitcf2438ec130946ad0f2d533f84831b742262d9f9
treeb04266968e5fa9b83d4bd032f083b14eb5fafa04
parentaa87b081cdff970c4e24ceb15d1aca367a1edbf8
[libTooling] Change Stencil equality to use `toString()`

Summary:
Removes the `isEqual` method from StencilPartInterface and modifies equality to
use the string representation returned by the `toString` method for comparison.

This means the `run` and `selection` stencils return true by default, and
clients should be cautious in relying on equality operator for comparison of
stencils containing parts generated by these functions.

It also means we no longer need the custom RTTI support (typeId() and
down_cast()), so it has been removed.

Patch by Harshal T. Lehri.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 374552
clang/include/clang/Tooling/Transformer/Stencil.h
clang/lib/Tooling/Transformer/Stencil.cpp
clang/unittests/Tooling/StencilTest.cpp