diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2020-10-20 19:51:44 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2020-10-20 19:53:07 +0200 |
commit | 848a68a032d1c59274526abb3220714202d4757e (patch) | |
tree | 7851aecb19ae27b2d6dd46966f94e908fbc83856 /clang/lib/Basic/SourceManager.cpp | |
parent | b333d6e129f23d204cd3a44ffb9f3a69dc3e0bc9 (diff) | |
download | llvm-848a68a032d1c59274526abb3220714202d4757e.zip llvm-848a68a032d1c59274526abb3220714202d4757e.tar.gz llvm-848a68a032d1c59274526abb3220714202d4757e.tar.bz2 |
DomTree: Extract (mostly) read-only logic into type-erased base classes
Avoid having to instantiate and compile a subset of the dominator tree logic
separately for each node type. More importantly, this allows generic
algorithms to be built on top of dominator trees without writing them as
templates -- such algorithms can now use opaque CfgBlockRef and
CfgInterface instead.
A type-erased implementation of dominator trees could be written in
terms of CfgInterface as well, but doing so would change the current
trade-off: it would slightly reduce code size at the cost of a slight
runtime overhead.
This patch does not change the trade-off, as it only does type-erasure
where basic blocks can be treated in a fully opaque way, i.e. it only
moves methods that don't require iteration over CFG successors and
predecessors.
v5:
- rename generic_{begin,end,children} back without the generic_ prefix
and refer explictly to base class methods in NewGVN, which wants to
mutate the order of dominator tree node children directly
v6:
- style change: iDom -> idom; it's arguable whether this is really
invalid, since it is actually standard camelCase, but clang-tidy
complains about it so... *shrug*
- rename {to,from}Generic -> {wrap,unwrap}Ref
Change-Id: Ib860dc04cf8bb093d8ed00be7def40d662213672
Differential Revision: https://reviews.llvm.org/D83089
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
0 files changed, 0 insertions, 0 deletions