[NFC] Refactor SuffixTree to use LLVM-style RTTI
authorJessica Paquette <jpaquette@apple.com>
Thu, 11 May 2023 21:52:53 +0000 (14:52 -0700)
committerJessica Paquette <jpaquette@apple.com>
Fri, 12 May 2023 00:50:21 +0000 (17:50 -0700)
commitc2f0c204d1847fac9f8d47c06a40cecd717a546d
tree327faa49770b8f1a5071977d9354b3b0c932b9be
parent0a70d20c07a774a8b45dba0babd3515b36aa3590
[NFC] Refactor SuffixTree to use LLVM-style RTTI

Following guidelines in

https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html

This allows us to

* Quickly discern between leaf and internal nodes
* Be more idiomatic with the rest of LLVM
* Save some size on node structs
* Reduce the number of allocations (because end indices for internal nodes no
  longer need to be pointers to be compatible with leaf nodes)

Also object orientify the code some more. This allows for more asserts and
checks.

This shouldn't impact code size on the MachineOutliner.

- All unit tests pass (outliner lit + llvm-unit)
- No code size changes on CTMark @ -Oz for AArch64
llvm/include/llvm/Support/SuffixTree.h
llvm/lib/Support/SuffixTree.cpp