Index: src/IceTargetLowering.cpp |
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp |
index 04f77e61b2caf26ea4fe4bedffc1efae35434fcd..2873272a63cdaf206884e8120698caef4187d5ec 100644 |
--- a/src/IceTargetLowering.cpp |
+++ b/src/IceTargetLowering.cpp |
@@ -152,6 +152,25 @@ void TargetLowering::staticInit(const ClFlags &Flags) { |
TargetLowering::TargetLowering(Cfg *Func) |
: Func(Func), Ctx(Func->getContext()), Context() {} |
+TargetLowering::AutoBundle::AutoBundle(TargetLowering *Target, |
+ InstBundleLock::Option Option) |
+ : Target(Target), |
+ NeedSandboxing(Target->Ctx->getFlags().getUseSandboxing()) { |
+ assert(!Target->AutoBundling); |
+ Target->AutoBundling = true; |
+ if (NeedSandboxing) { |
+ Target->_bundle_lock(Option); |
+ } |
+} |
+ |
+TargetLowering::AutoBundle::~AutoBundle() { |
+ assert(Target->AutoBundling); |
+ Target->AutoBundling = false; |
+ if (NeedSandboxing) { |
+ Target->_bundle_unlock(); |
+ } |
+} |
+ |
void TargetLowering::genTargetHelperCalls() { |
for (CfgNode *Node : Func->getNodes()) { |
Context.init(Node); |