[all-commits] [llvm/llvm-project] c2f0c2: [NFC] Refactor SuffixTree to use LLVM-style RTTI

Jessica Paquette via All-commits all-commits at lists.llvm.org
Thu May 11 17:51:48 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c2f0c204d1847fac9f8d47c06a40cecd717a546d
      https://github.com/llvm/llvm-project/commit/c2f0c204d1847fac9f8d47c06a40cecd717a546d
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2023-05-11 (Thu, 11 May 2023)

  Changed paths:
    M llvm/include/llvm/Support/SuffixTree.h
    M llvm/lib/Support/SuffixTree.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list