Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: lib/Transforms/NaCl/PNaClABISimplify.cpp

Issue 120773002: PNaCl: Implement computed gotos (indirectbr) by expanding out to switches (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Cleanup Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());

Powered by Google App Engine
This is Rietveld 408576698