diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2017-01-25 07:58:10 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2017-01-25 07:58:10 +0000 |
commit | 43a7759f4b67199d0e8eebfd19d5bf42a8b364b5 (patch) | |
tree | e105c6ce6134862fcd03ffdc09ef1174005049d0 /llvm/lib/CodeGen/MachineDominators.cpp | |
parent | ac03b4b924eee5f1f9105b3119ccecb16b89f206 (diff) | |
download | llvm-43a7759f4b67199d0e8eebfd19d5bf42a8b364b5.zip llvm-43a7759f4b67199d0e8eebfd19d5bf42a8b364b5.tar.gz llvm-43a7759f4b67199d0e8eebfd19d5bf42a8b364b5.tar.bz2 |
Do not verify dominator tree if it has no roots
If dominator tree has no roots, the pass that calculates it is
likely to be skipped. It occures, for instance, in the case of
entities with linkage available_externally. Do not run tree
verification in such case.
Differential Revision: https://reviews.llvm.org/D28767
llvm-svn: 293033
Diffstat (limited to 'llvm/lib/CodeGen/MachineDominators.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineDominators.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineDominators.cpp b/llvm/lib/CodeGen/MachineDominators.cpp index 303a6a92..4e34887 100644 --- a/llvm/lib/CodeGen/MachineDominators.cpp +++ b/llvm/lib/CodeGen/MachineDominators.cpp @@ -143,6 +143,10 @@ void MachineDominatorTree::applySplitCriticalEdges() const { } void MachineDominatorTree::verifyDomTree() const { + if (getRoots().empty()) + // If dominator tree is unavailable, skip verification. + return; + MachineFunction &F = *getRoot()->getParent(); MachineDominatorTree OtherDT; |