diff options
author | Eli Friedman <efriedma@codeaurora.org> | 2018-08-22 21:38:57 +0000 |
---|---|---|
committer | Eli Friedman <efriedma@codeaurora.org> | 2018-08-22 21:38:57 +0000 |
commit | f3c39a7c794ca77c1b9c457944be402564771f60 (patch) | |
tree | 81d016e63feaccaf31051fc2cb5209fe550b9f68 /llvm/lib/CodeGen/SafeStackColoring.cpp | |
parent | 48883142de4846bd8fc13d135f48df28dc762546 (diff) | |
download | bcm5719-llvm-f3c39a7c794ca77c1b9c457944be402564771f60.tar.gz bcm5719-llvm-f3c39a7c794ca77c1b9c457944be402564771f60.zip |
[SafeStack] Handle unreachable code with safe stack coloring.
Instead of asserting that the function doesn't have any unreachable
code, just ignore it for the purpose of computing liveness.
Differential Revision: https://reviews.llvm.org/D51070
llvm-svn: 340456
Diffstat (limited to 'llvm/lib/CodeGen/SafeStackColoring.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SafeStackColoring.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SafeStackColoring.cpp b/llvm/lib/CodeGen/SafeStackColoring.cpp index 329458778a9..b1914b5d380 100644 --- a/llvm/lib/CodeGen/SafeStackColoring.cpp +++ b/llvm/lib/CodeGen/SafeStackColoring.cpp @@ -172,7 +172,9 @@ void StackColoring::calculateLocalLiveness() { BitVector LocalLiveIn; for (auto *PredBB : predecessors(BB)) { LivenessMap::const_iterator I = BlockLiveness.find(PredBB); - assert(I != BlockLiveness.end() && "Predecessor not found"); + // If a predecessor is unreachable, ignore it. + if (I == BlockLiveness.end()) + continue; LocalLiveIn |= I->second.LiveOut; } |