Index: src/IceTargetLowering.cpp |
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp |
index bd5c11b47e4fd0548a6084bf3a0c75a4516f0f42..1f459a49d436b4f7286e3aeda00ff02dbaaaa711 100644 |
--- a/src/IceTargetLowering.cpp |
+++ b/src/IceTargetLowering.cpp |
@@ -245,8 +245,21 @@ void TargetLowering::staticInit(GlobalContext *Ctx) { |
} |
} |
+TargetLowering::SandboxType |
+TargetLowering::determineSandboxTypeFromFlags(const ClFlags &Flags) { |
+ assert(!Flags.getUseSandboxing() || !Flags.getUseNonsfi()); |
+ if (Flags.getUseNonsfi()) { |
+ return TargetLowering::ST_Nonsfi; |
+ } |
+ if (Flags.getUseSandboxing()) { |
+ return TargetLowering::ST_NaCl; |
+ } |
+ return TargetLowering::ST_None; |
+} |
+ |
TargetLowering::TargetLowering(Cfg *Func) |
- : Func(Func), Ctx(Func->getContext()), Context() {} |
+ : Func(Func), Ctx(Func->getContext()), |
+ SandboxingType(determineSandboxTypeFromFlags(Ctx->getFlags())) {} |
TargetLowering::AutoBundle::AutoBundle(TargetLowering *Target, |
InstBundleLock::Option Option) |