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

Unified Diff: src/IceTargetLowering.h

Issue 944333002: Subzero: Update tests and build scripts for sandboxing. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: More code review changes Created 5 years, 10 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
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceTargetLowering.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLowering.h
diff --git a/src/IceTargetLowering.h b/src/IceTargetLowering.h
index 92eed51197efe6a96f1c9e3251be0e82c60c3875..2ad2685f184f21259829a885b8e5ad7ec6106ae0 100644
--- a/src/IceTargetLowering.h
+++ b/src/IceTargetLowering.h
@@ -192,6 +192,17 @@ public:
llvm::SmallVectorImpl<int32_t> &Permutation,
const llvm::SmallBitVector &ExcludeRegisters) const = 0;
+ // Save/restore any mutable state for the situation where code
+ // emission needs multiple passes, such as sandboxing or relaxation.
+ // Subclasses may provide their own implementation, but should be
+ // sure to also call the parent class's methods.
+ virtual void snapshotEmitState() {
+ SnapshotStackAdjustment = StackAdjustment;
+ }
+ virtual void rollbackEmitState() {
+ StackAdjustment = SnapshotStackAdjustment;
+ }
+
virtual void emitVariable(const Variable *Var) const = 0;
// Performs target-specific argument lowering.
@@ -239,6 +250,9 @@ protected:
// natural location, as arguments are pushed for a function call.
int32_t StackAdjustment;
LoweringContext Context;
+
+private:
+ int32_t SnapshotStackAdjustment;
};
// TargetDataLowering is used for "lowering" data including initializers
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceTargetLowering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698