input: add get_source_text_between
authorJeff Chapman II <jchapman@lock3software.com>
Thu, 3 Nov 2022 19:47:47 +0000 (15:47 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 4 Nov 2022 17:07:14 +0000 (13:07 -0400)
commit0386c40eebf1800dc7728ba85f3dbbb9ec4eeb5d
tree4e50664ab59a990dff40825e20f4ad72961a9bfa
parent679be32e66428f0ba81d1c1b55f7bd47f01cb295
input: add get_source_text_between

The c++-contracts branch uses this to retrieve the source form of the
contract predicate, to be returned by contract_violation::comment().

Co-authored-by: Jason Merrill <jason@redhat.com>
gcc/ChangeLog:

* input.cc (get_source_text_between): New fn.
* input.h (get_source_text_between): Declare.
gcc/input.cc
gcc/input.h