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

Side by Side Diff: src/IceTargetLoweringX8664Traits.h

Issue 2107073002: Subzero: Merge SpillVariable functionality directly into Variable. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review comments. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringX8632Traits.h ('k') | src/IceTargetLoweringX86Base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringX8664Traits.h - x86-64 traits -*- C++ -*-=// 1 //===- subzero/src/IceTargetLoweringX8664Traits.h - x86-64 traits -*- C++ -*-=//
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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 assert(Var->getType() == IceType_f64); 971 assert(Var->getType() == IceType_f64);
972 Vars = Func->allocateArrayOf<Variable *>(1); 972 Vars = Func->allocateArrayOf<Variable *>(1);
973 Vars[0] = Var; 973 Vars[0] = Var;
974 NumVars = 1; 974 NumVars = 1;
975 } 975 }
976 976
977 Variable *Var; 977 Variable *Var;
978 Portion Part; 978 Portion Part;
979 }; 979 };
980 980
981 /// SpillVariable decorates a Variable by linking it to another Variable. When
982 /// stack frame offsets are computed, the SpillVariable is given a distinct
983 /// stack slot only if its linked Variable has a register. If the linked
984 /// Variable has a stack slot, then the Variable and SpillVariable share that
985 /// slot.
986 class SpillVariable : public Variable {
987 SpillVariable() = delete;
988 SpillVariable(const SpillVariable &) = delete;
989 SpillVariable &operator=(const SpillVariable &) = delete;
990
991 public:
992 static SpillVariable *create(Cfg *Func, Type Ty, SizeT Index) {
993 return new (Func->allocate<SpillVariable>())
994 SpillVariable(Func, Ty, Index);
995 }
996 constexpr static auto SpillVariableKind =
997 static_cast<OperandKind>(kVariable_Target);
998 static bool classof(const Operand *Operand) {
999 return Operand->getKind() == SpillVariableKind;
1000 }
1001 void setLinkedTo(Variable *Var) { LinkedTo = Var; }
1002 Variable *getLinkedTo() const { return LinkedTo; }
1003 // Inherit dump() and emit() from Variable.
1004
1005 private:
1006 SpillVariable(const Cfg *Func, Type Ty, SizeT Index)
1007 : Variable(Func, SpillVariableKind, Ty, Index), LinkedTo(nullptr) {}
1008 Variable *LinkedTo;
1009 };
1010
1011 // Note: The following data structures are defined in IceInstX8664.cpp. 981 // Note: The following data structures are defined in IceInstX8664.cpp.
1012 982
1013 static const struct InstBrAttributesType { 983 static const struct InstBrAttributesType {
1014 Cond::BrCond Opposite; 984 Cond::BrCond Opposite;
1015 const char *DisplayString; 985 const char *DisplayString;
1016 const char *EmitString; 986 const char *EmitString;
1017 } InstBrAttributes[]; 987 } InstBrAttributes[];
1018 988
1019 static const struct InstCmppsAttributesType { 989 static const struct InstCmppsAttributesType {
1020 const char *EmitString; 990 const char *EmitString;
(...skipping 10 matching lines...) Expand all
1031 const char *FldString; // s, l, or <blank> 1001 const char *FldString; // s, l, or <blank>
1032 } TypeAttributes[]; 1002 } TypeAttributes[];
1033 }; 1003 };
1034 1004
1035 using Traits = ::Ice::X8664::TargetX8664Traits; 1005 using Traits = ::Ice::X8664::TargetX8664Traits;
1036 } // end of namespace X8664 1006 } // end of namespace X8664
1037 1007
1038 } // end of namespace Ice 1008 } // end of namespace Ice
1039 1009
1040 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8664TRAITS_H 1010 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8664TRAITS_H
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632Traits.h ('k') | src/IceTargetLoweringX86Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698