aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Voung <jvoung@chromium.org>2013-07-09 10:44:24 -0700
committerJan Voung <jvoung@chromium.org>2013-07-09 10:44:24 -0700
commitd7676885204bbc165a8b27a537777bfe450e6323 (patch)
treeb20745660cee7280736621e693bc9d6a3fa2e887
parent09c2c9826eaf883d22ef07de2bf5ae1a92bdd50c (diff)
Prune some arch-specific MC InstPrinter (.s printing), from sandboxed translator.
Saves about 100KB per arch. As noted in the test, some of the functions like getRegisterName() are not pruned. Common infrastructure code may still be sitting around, only the ${ARCH}InstPrinter::* is touched... but this is just a one-liner. BUG=https://code.google.com/p/nativeclient/issues/detail?id=1222 TEST=https://codereview.chromium.org/18333008/ R=dschuff@chromium.org Review URL: https://codereview.chromium.org/18238011
-rw-r--r--include/llvm/Support/TargetRegistry.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Support/TargetRegistry.h b/include/llvm/Support/TargetRegistry.h
index b06676d4d2..9658cded73 100644
--- a/include/llvm/Support/TargetRegistry.h
+++ b/include/llvm/Support/TargetRegistry.h
@@ -711,8 +711,14 @@ namespace llvm {
/// @param Fn - A function to construct an MCInstPrinter for the target.
static void RegisterMCInstPrinter(Target &T,
Target::MCInstPrinterCtorTy Fn) {
+ // @LOCALMOD-BEGIN
+ // Prune out the .s printer for the sandboxed translator,
+ // by preventing an InstPrinter from being used at all.
+ #if !defined(__native_client__)
if (!T.MCInstPrinterCtorFn)
T.MCInstPrinterCtorFn = Fn;
+ #endif
+ // @LOCALMOD-END
}
/// RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the