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

Unified Diff: src/IceInstX8632.h

Issue 586943003: Subzero: Change the way bitcast stack slot lowering is handled. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add clarifying comment to asType() Created 6 years, 3 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/IceOperand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstX8632.h
diff --git a/src/IceInstX8632.h b/src/IceInstX8632.h
index a24f9863583778507d9b4d749d7980ab9671bb69..ac391701f3dec84bf679e4954aa17f44d2cd527d 100644
--- a/src/IceInstX8632.h
+++ b/src/IceInstX8632.h
@@ -135,6 +135,33 @@ private:
Portion Part;
};
+// SpillVariable decorates a Variable by linking it to another
+// Variable. When stack frame offsets are computed, the SpillVariable
+// is given a distinct stack slot only if its linked Variable has a
+// register. If the linked Variable has a stack slot, then the
+// Variable and SpillVariable share that slot.
+class SpillVariable : public Variable {
+public:
+ static SpillVariable *create(Cfg *Func, Type Ty, const CfgNode *Node,
+ SizeT Index, const IceString &Name) {
+ return new (Func->allocate<SpillVariable>())
+ SpillVariable(Ty, Node, Index, Name);
+ }
+ const static OperandKind SpillVariableKind =
+ static_cast<OperandKind>(kVariable_Target);
+ static bool classof(const Operand *Operand) {
+ return Operand->getKind() == SpillVariableKind;
+ }
+ void setLinkedTo(Variable *Var) { LinkedTo = Var; }
+ Variable *getLinkedTo() const { return LinkedTo; }
+ // Inherit dump() and emit() from Variable.
+private:
+ SpillVariable(Type Ty, const CfgNode *Node, SizeT Index,
+ const IceString &Name)
+ : Variable(SpillVariableKind, Ty, Node, Index, Name), LinkedTo(NULL) {}
+ Variable *LinkedTo;
+};
+
class InstX8632 : public InstTarget {
public:
enum InstKindX8632 {
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceOperand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698