OLD | NEW |
1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// | 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 return; \ | 238 return; \ |
239 } \ | 239 } \ |
240 InitGuard##X = true; \ | 240 InitGuard##X = true; \ |
241 ::X::staticInit(Ctx); \ | 241 ::X::staticInit(Ctx); \ |
242 } break; | 242 } break; |
243 #include "llvm/Config/SZTargets.def" | 243 #include "llvm/Config/SZTargets.def" |
244 #undef SUBZERO_TARGET | 244 #undef SUBZERO_TARGET |
245 } | 245 } |
246 } | 246 } |
247 | 247 |
| 248 TargetLowering::SandboxType |
| 249 TargetLowering::determineSandboxTypeFromFlags(const ClFlags &Flags) { |
| 250 assert(!Flags.getUseSandboxing() || !Flags.getUseNonsfi()); |
| 251 if (Flags.getUseNonsfi()) { |
| 252 return TargetLowering::ST_Nonsfi; |
| 253 } |
| 254 if (Flags.getUseSandboxing()) { |
| 255 return TargetLowering::ST_NaCl; |
| 256 } |
| 257 return TargetLowering::ST_None; |
| 258 } |
| 259 |
248 TargetLowering::TargetLowering(Cfg *Func) | 260 TargetLowering::TargetLowering(Cfg *Func) |
249 : Func(Func), Ctx(Func->getContext()), Context() {} | 261 : Func(Func), Ctx(Func->getContext()), |
| 262 SandboxingType(determineSandboxTypeFromFlags(Ctx->getFlags())) {} |
250 | 263 |
251 TargetLowering::AutoBundle::AutoBundle(TargetLowering *Target, | 264 TargetLowering::AutoBundle::AutoBundle(TargetLowering *Target, |
252 InstBundleLock::Option Option) | 265 InstBundleLock::Option Option) |
253 : Target(Target), | 266 : Target(Target), |
254 NeedSandboxing(Target->Ctx->getFlags().getUseSandboxing()) { | 267 NeedSandboxing(Target->Ctx->getFlags().getUseSandboxing()) { |
255 assert(!Target->AutoBundling); | 268 assert(!Target->AutoBundling); |
256 Target->AutoBundling = true; | 269 Target->AutoBundling = true; |
257 if (NeedSandboxing) { | 270 if (NeedSandboxing) { |
258 Target->_bundle_lock(Option); | 271 Target->_bundle_lock(Option); |
259 } | 272 } |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 case Target_##X: \ | 830 case Target_##X: \ |
818 return ::X::createTargetHeaderLowering(Ctx); | 831 return ::X::createTargetHeaderLowering(Ctx); |
819 #include "llvm/Config/SZTargets.def" | 832 #include "llvm/Config/SZTargets.def" |
820 #undef SUBZERO_TARGET | 833 #undef SUBZERO_TARGET |
821 } | 834 } |
822 } | 835 } |
823 | 836 |
824 TargetHeaderLowering::~TargetHeaderLowering() = default; | 837 TargetHeaderLowering::~TargetHeaderLowering() = default; |
825 | 838 |
826 } // end of namespace Ice | 839 } // end of namespace Ice |
OLD | NEW |