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 // This file declares the Operand class and its target-independent | 10 // This file declares the Operand class and its target-independent |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 const OperandKind Kind; | 77 const OperandKind Kind; |
78 // Vars and NumVars are initialized by the derived class. | 78 // Vars and NumVars are initialized by the derived class. |
79 SizeT NumVars; | 79 SizeT NumVars; |
80 Variable **Vars; | 80 Variable **Vars; |
81 | 81 |
82 private: | 82 private: |
83 Operand(const Operand &) LLVM_DELETED_FUNCTION; | 83 Operand(const Operand &) LLVM_DELETED_FUNCTION; |
84 Operand &operator=(const Operand &) LLVM_DELETED_FUNCTION; | 84 Operand &operator=(const Operand &) LLVM_DELETED_FUNCTION; |
85 }; | 85 }; |
86 | 86 |
| 87 template<class StreamType> |
| 88 inline StreamType &operator<<(StreamType &Str, const Operand &Op) { |
| 89 Op.dump(Str); |
| 90 return Str; |
| 91 } |
| 92 |
87 // Constant is the abstract base class for constants. All | 93 // Constant is the abstract base class for constants. All |
88 // constants are allocated from a global arena and are pooled. | 94 // constants are allocated from a global arena and are pooled. |
89 class Constant : public Operand { | 95 class Constant : public Operand { |
90 public: | 96 public: |
91 uint32_t getPoolEntryID() const { return PoolEntryID; } | 97 uint32_t getPoolEntryID() const { return PoolEntryID; } |
92 using Operand::dump; | 98 using Operand::dump; |
93 virtual void emit(const Cfg *Func) const { emit(Func->getContext()); } | 99 virtual void emit(const Cfg *Func) const { emit(Func->getContext()); } |
94 virtual void emit(GlobalContext *Ctx) const = 0; | 100 virtual void emit(GlobalContext *Ctx) const = 0; |
95 virtual void dump(const Cfg *Func, Ostream &Str) const = 0; | 101 virtual void dump(const Cfg *Func, Ostream &Str) const = 0; |
96 | 102 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 Variable *LoVar; | 490 Variable *LoVar; |
485 Variable *HiVar; | 491 Variable *HiVar; |
486 // VarsReal (and Operand::Vars) are set up such that Vars[0] == | 492 // VarsReal (and Operand::Vars) are set up such that Vars[0] == |
487 // this. | 493 // this. |
488 Variable *VarsReal[1]; | 494 Variable *VarsReal[1]; |
489 }; | 495 }; |
490 | 496 |
491 } // end of namespace Ice | 497 } // end of namespace Ice |
492 | 498 |
493 #endif // SUBZERO_SRC_ICEOPERAND_H | 499 #endif // SUBZERO_SRC_ICEOPERAND_H |
OLD | NEW |