Index: lib/Transforms/NaCl/PNaClABISimplify.cpp |
diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp |
index d695f61203726505bd414d04043195ca7c1a8932..91729c253ba731eddff2e49cedc63e7598182a83 100644 |
--- a/lib/Transforms/NaCl/PNaClABISimplify.cpp |
+++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp |
@@ -47,6 +47,9 @@ void llvm::PNaClABISimplifyAddPreOptPasses(PassManager &PM) { |
const char *SymbolsToPreserve[] = { "_start" }; |
PM.add(createInternalizePass(SymbolsToPreserve)); |
+ // Expand out computed gotos (indirectbr and blockaddresses) into switches. |
+ PM.add(createExpandIndirectBrPass()); |
+ |
// LowerExpect converts Intrinsic::expect into branch weights, |
// which can then be removed after BlockPlacement. |
PM.add(createLowerExpectIntrinsicPass()); |