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

Side by Side Diff: src/IceTargetLoweringX8632Traits.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/IceOperand.cpp ('k') | src/IceTargetLoweringX8664Traits.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/IceTargetLoweringX8632Traits.h - x86-32 traits -*- C++ -*-=// 1 //===- subzero/src/IceTargetLoweringX8632Traits.h - x86-32 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 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 assert(Var->getType() == IceType_f64); 926 assert(Var->getType() == IceType_f64);
927 Vars = Func->allocateArrayOf<Variable *>(1); 927 Vars = Func->allocateArrayOf<Variable *>(1);
928 Vars[0] = Var; 928 Vars[0] = Var;
929 NumVars = 1; 929 NumVars = 1;
930 } 930 }
931 931
932 Variable *Var; 932 Variable *Var;
933 Portion Part; 933 Portion Part;
934 }; 934 };
935 935
936 /// SpillVariable decorates a Variable by linking it to another Variable. When
937 /// stack frame offsets are computed, the SpillVariable is given a distinct
938 /// stack slot only if its linked Variable has a register. If the linked
939 /// Variable has a stack slot, then the Variable and SpillVariable share that
940 /// slot.
941 class SpillVariable : public Variable {
942 SpillVariable() = delete;
943 SpillVariable(const SpillVariable &) = delete;
944 SpillVariable &operator=(const SpillVariable &) = delete;
945
946 public:
947 static SpillVariable *create(Cfg *Func, Type Ty, SizeT Index) {
948 return new (Func->allocate<SpillVariable>())
949 SpillVariable(Func, Ty, Index);
950 }
951 constexpr static auto SpillVariableKind =
952 static_cast<OperandKind>(kVariable_Target);
953 static bool classof(const Operand *Operand) {
954 return Operand->getKind() == SpillVariableKind;
955 }
956 void setLinkedTo(Variable *Var) { LinkedTo = Var; }
957 Variable *getLinkedTo() const { return LinkedTo; }
958 // Inherit dump() and emit() from Variable.
959
960 private:
961 SpillVariable(const Cfg *Func, Type Ty, SizeT Index)
962 : Variable(Func, SpillVariableKind, Ty, Index), LinkedTo(nullptr) {}
963 Variable *LinkedTo;
964 };
965
966 // Note: The following data structures are defined in IceInstX8632.cpp. 936 // Note: The following data structures are defined in IceInstX8632.cpp.
967 937
968 static const struct InstBrAttributesType { 938 static const struct InstBrAttributesType {
969 Cond::BrCond Opposite; 939 Cond::BrCond Opposite;
970 const char *DisplayString; 940 const char *DisplayString;
971 const char *EmitString; 941 const char *EmitString;
972 } InstBrAttributes[]; 942 } InstBrAttributes[];
973 943
974 static const struct InstCmppsAttributesType { 944 static const struct InstCmppsAttributesType {
975 const char *EmitString; 945 const char *EmitString;
(...skipping 14 matching lines...) Expand all
990 960
991 static uint8_t InstSegmentPrefixes[]; 961 static uint8_t InstSegmentPrefixes[];
992 }; 962 };
993 963
994 using Traits = ::Ice::X8632::TargetX8632Traits; 964 using Traits = ::Ice::X8632::TargetX8632Traits;
995 } // end of namespace X8632 965 } // end of namespace X8632
996 966
997 } // end of namespace Ice 967 } // end of namespace Ice
998 968
999 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632TRAITS_H 969 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632TRAITS_H
OLDNEW
« no previous file with comments | « src/IceOperand.cpp ('k') | src/IceTargetLoweringX8664Traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698