recog: Add an RAII class for undoing insn changes
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 17 Dec 2020 00:15:08 +0000 (00:15 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 17 Dec 2020 00:15:08 +0000 (00:15 +0000)
commita240ea024dd8533d898c8cd779dedd0747bbbf2e
tree629eeeeafd6d1c4ca7fbefe69769fe6e29b5d5b2
parent0d74260a1f6704da869b87d163f4be31fd0f2b41
recog: Add an RAII class for undoing insn changes

When using validate_change to make a group of changes, you have
to remember to cancel them if something goes wrong.  This patch
adds an RAII class to make that easier.  See the comments in the
patch for details and examples.

gcc/
* recog.h (insn_change_watermark): New class.
gcc/recog.h