diff options
author | Dan Gohman <sunfish@google.com> | 2014-02-13 11:47:44 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@google.com> | 2014-02-13 11:47:44 -0800 |
commit | 6f629a513c37587247dc83b961e86c177cef5d6d (patch) | |
tree | 5c5b7a1d1e0bb1a3ac23440aa9a3426d304f1891 /lib/Transforms | |
parent | 04faad37ba15e237c87e58e9914a998a3d7a2ed1 (diff) |
Don't leave behind unreachable blocks with illegal instructions.
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/NaCl/ExpandI64.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/NaCl/ExpandI64.cpp b/lib/Transforms/NaCl/ExpandI64.cpp index 8f0efb2478..d6c75c0577 100644 --- a/lib/Transforms/NaCl/ExpandI64.cpp +++ b/lib/Transforms/NaCl/ExpandI64.cpp @@ -38,6 +38,7 @@ #include "llvm/Pass.h" #include "llvm/Support/CFG.h" #include "llvm/Transforms/NaCl.h" +#include "llvm/Transforms/Utils/Local.h" #include <map> #include "llvm/Support/raw_ostream.h" @@ -1031,6 +1032,11 @@ bool ExpandI64::runOnModule(Module &M) { Instruction *D = Dead.pop_back_val(); D->eraseFromParent(); } + + // We only visited blocks found by a DFS walk from the entry, so we haven't + // visited any unreachable blocks, and they may still contain illegal + // instructions at this point. Being unreachable, they can simply be deleted. + removeUnreachableBlocks(*Func); } // post pass - clean up illegal functions that were legalized. We do this |