[libTooling] Add `ifBound`, `elseBranch` RangeSelector combinators.
authorYitzhak Mandelbaum <yitzhakm@google.com>
Fri, 20 Sep 2019 17:11:03 +0000 (17:11 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Fri, 20 Sep 2019 17:11:03 +0000 (17:11 +0000)
commiteff88e42f7860ac38cccafd175f5feca4d89c7c3
treee1258524ae2832ab6890abdabc2aca20afa175f3
parent1b7b4b467f03322f37b20ccee5cdef0c9ecec5d4
[libTooling] Add `ifBound`, `elseBranch` RangeSelector combinators.

Summary:
Adds two new combinators and corresponding tests to the RangeSelector library.
* `ifBound` -- conditional evaluation of range-selectors, based on whether a
   given node id is bound in the match.
* `elseBranch` -- selects the source range of the else and its statement.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 372410
clang/include/clang/Tooling/Refactoring/RangeSelector.h
clang/lib/Tooling/Refactoring/RangeSelector.cpp
clang/unittests/Tooling/RangeSelectorTest.cpp