| OLD | NEW |
| 1 //===- subzero/src/IceOperand.h - High-level operands -----------*- C++ -*-===// | 1 //===- subzero/src/IceOperand.h - High-level operands -----------*- 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 using Constant::dump; | 204 using Constant::dump; |
| 205 void dump(const Cfg *, Ostream &Str) const override { | 205 void dump(const Cfg *, Ostream &Str) const override { |
| 206 if (BuildDefs::dump()) | 206 if (BuildDefs::dump()) |
| 207 Str << getValue(); | 207 Str << getValue(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 static bool classof(const Operand *Operand) { | 210 static bool classof(const Operand *Operand) { |
| 211 return Operand->getKind() == K; | 211 return Operand->getKind() == K; |
| 212 } | 212 } |
| 213 | 213 |
| 214 SizeT hashValue() const override { | 214 SizeT hashValue() const override { return std::hash<PrimType>()(Value); } |
| 215 return std::hash<PrimType>()(Value); | |
| 216 } | |
| 217 | 215 |
| 218 virtual bool shouldBeRandomizedOrPooled() const override { return false; } | 216 virtual bool shouldBeRandomizedOrPooled() const override { return false; } |
| 219 | 217 |
| 220 private: | 218 private: |
| 221 ConstantPrimitive(Type Ty, PrimType Value) : Constant(K, Ty), Value(Value) {} | 219 ConstantPrimitive(Type Ty, PrimType Value) : Constant(K, Ty), Value(Value) {} |
| 222 | 220 |
| 223 void initName(GlobalContext *Ctx) { | 221 void initName(GlobalContext *Ctx) { |
| 224 std::string Buffer; | 222 std::string Buffer; |
| 225 llvm::raw_string_ostream Str(Buffer); | 223 llvm::raw_string_ostream Str(Buffer); |
| 226 constexpr bool IsCompact = !BuildDefs::dump(); | 224 constexpr bool IsCompact = !BuildDefs::dump(); |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 void dump(const Cfg *Func, Ostream &Str) const override; | 771 void dump(const Cfg *Func, Ostream &Str) const override; |
| 774 | 772 |
| 775 /// Return reg num of base register, if different from stack/frame register. | 773 /// Return reg num of base register, if different from stack/frame register. |
| 776 virtual RegNumT getBaseRegNum() const { return RegNumT(); } | 774 virtual RegNumT getBaseRegNum() const { return RegNumT(); } |
| 777 | 775 |
| 778 static bool classof(const Operand *Operand) { | 776 static bool classof(const Operand *Operand) { |
| 779 OperandKind Kind = Operand->getKind(); | 777 OperandKind Kind = Operand->getKind(); |
| 780 return Kind >= kVariable && Kind <= kVariable_Max; | 778 return Kind >= kVariable && Kind <= kVariable_Max; |
| 781 } | 779 } |
| 782 | 780 |
| 783 SizeT hashValue() const override { | 781 SizeT hashValue() const override { return std::hash<SizeT>()(getIndex()); } |
| 784 return std::hash<SizeT>()(getIndex()); | |
| 785 } | |
| 786 | 782 |
| 787 protected: | 783 protected: |
| 788 Variable(const Cfg *Func, OperandKind K, Type Ty, SizeT Index) | 784 Variable(const Cfg *Func, OperandKind K, Type Ty, SizeT Index) |
| 789 : Operand(K, Ty), Number(Index), | 785 : Operand(K, Ty), Number(Index), |
| 790 Name(VariableString::createWithoutString(Func)), | 786 Name(VariableString::createWithoutString(Func)), |
| 791 RegisterClass(static_cast<RegClass>(Ty)) { | 787 RegisterClass(static_cast<RegClass>(Ty)) { |
| 792 Vars = VarsReal; | 788 Vars = VarsReal; |
| 793 Vars[0] = this; | 789 Vars[0] = this; |
| 794 NumVars = 1; | 790 NumVars = 1; |
| 795 } | 791 } |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 return Operand->getKind() == kVariableBoolean; | 1023 return Operand->getKind() == kVariableBoolean; |
| 1028 } | 1024 } |
| 1029 | 1025 |
| 1030 private: | 1026 private: |
| 1031 Variable *BoolSource = nullptr; | 1027 Variable *BoolSource = nullptr; |
| 1032 }; | 1028 }; |
| 1033 | 1029 |
| 1034 } // end of namespace Ice | 1030 } // end of namespace Ice |
| 1035 | 1031 |
| 1036 #endif // SUBZERO_SRC_ICEOPERAND_H | 1032 #endif // SUBZERO_SRC_ICEOPERAND_H |
| OLD | NEW |