Chromium Code Reviews| 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 |
| 11 // subclasses. The main classes are Variable, which represents an | 11 // subclasses. The main classes are Variable, which represents an |
| 12 // LLVM variable that is either register- or stack-allocated, and the | 12 // LLVM variable that is either register- or stack-allocated, and the |
| 13 // Constant hierarchy, which represents integer, floating-point, | 13 // Constant hierarchy, which represents integer, floating-point, |
| 14 // and/or symbolic constants. | 14 // and/or symbolic constants. |
| 15 // | 15 // |
| 16 //===----------------------------------------------------------------------===// | 16 //===----------------------------------------------------------------------===// |
| 17 | 17 |
| 18 #ifndef SUBZERO_SRC_ICEOPERAND_H | 18 #ifndef SUBZERO_SRC_ICEOPERAND_H |
| 19 #define SUBZERO_SRC_ICEOPERAND_H | 19 #define SUBZERO_SRC_ICEOPERAND_H |
| 20 | 20 |
| 21 #include "IceCfg.h" | |
| 21 #include "IceDefs.h" | 22 #include "IceDefs.h" |
| 23 #include "IceGlobalContext.h" | |
|
jvoung (off chromium)
2014/10/10 00:55:49
From the include "IceOperand.h" in assembler_ia32.
| |
| 22 #include "IceTypes.h" | 24 #include "IceTypes.h" |
| 23 | 25 |
| 24 namespace Ice { | 26 namespace Ice { |
| 25 | 27 |
| 26 class Operand { | 28 class Operand { |
| 27 public: | 29 public: |
| 28 static const size_t MaxTargetKinds = 10; | 30 static const size_t MaxTargetKinds = 10; |
| 29 enum OperandKind { | 31 enum OperandKind { |
| 30 kConst_Base, | 32 kConst_Base, |
| 31 kConstInteger32, | 33 kConstInteger32, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 // ConstantRelocatable represents a symbolic constant combined with | 202 // ConstantRelocatable represents a symbolic constant combined with |
| 201 // a fixed offset. | 203 // a fixed offset. |
| 202 class ConstantRelocatable : public Constant { | 204 class ConstantRelocatable : public Constant { |
| 203 public: | 205 public: |
| 204 static ConstantRelocatable *create(GlobalContext *Ctx, Type Ty, | 206 static ConstantRelocatable *create(GlobalContext *Ctx, Type Ty, |
| 205 const RelocatableTuple &Tuple, | 207 const RelocatableTuple &Tuple, |
| 206 uint32_t PoolEntryID) { | 208 uint32_t PoolEntryID) { |
| 207 return new (Ctx->allocate<ConstantRelocatable>()) ConstantRelocatable( | 209 return new (Ctx->allocate<ConstantRelocatable>()) ConstantRelocatable( |
| 208 Ty, Tuple.Offset, Tuple.Name, Tuple.SuppressMangling, PoolEntryID); | 210 Ty, Tuple.Offset, Tuple.Name, Tuple.SuppressMangling, PoolEntryID); |
| 209 } | 211 } |
| 212 // TODO(jvoung): offset should only be int32_t, since we are ILP32. | |
| 210 int64_t getOffset() const { return Offset; } | 213 int64_t getOffset() const { return Offset; } |
| 211 IceString getName() const { return Name; } | 214 IceString getName() const { return Name; } |
| 212 void setSuppressMangling(bool Value) { SuppressMangling = Value; } | 215 void setSuppressMangling(bool Value) { SuppressMangling = Value; } |
| 213 bool getSuppressMangling() const { return SuppressMangling; } | 216 bool getSuppressMangling() const { return SuppressMangling; } |
| 214 using Constant::emit; | 217 using Constant::emit; |
| 215 using Constant::dump; | 218 using Constant::dump; |
| 216 void emit(GlobalContext *Ctx) const override; | 219 void emit(GlobalContext *Ctx) const override; |
| 217 void dump(const Cfg *Func, Ostream &Str) const override; | 220 void dump(const Cfg *Func, Ostream &Str) const override; |
| 218 | 221 |
| 219 static bool classof(const Operand *Operand) { | 222 static bool classof(const Operand *Operand) { |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 579 const Cfg *Func; | 582 const Cfg *Func; |
| 580 std::vector<VariableTracking> Metadata; | 583 std::vector<VariableTracking> Metadata; |
| 581 const static InstDefList NoDefinitions; | 584 const static InstDefList NoDefinitions; |
| 582 VariablesMetadata(const VariablesMetadata &) = delete; | 585 VariablesMetadata(const VariablesMetadata &) = delete; |
| 583 VariablesMetadata &operator=(const VariablesMetadata &) = delete; | 586 VariablesMetadata &operator=(const VariablesMetadata &) = delete; |
| 584 }; | 587 }; |
| 585 | 588 |
| 586 } // end of namespace Ice | 589 } // end of namespace Ice |
| 587 | 590 |
| 588 #endif // SUBZERO_SRC_ICEOPERAND_H | 591 #endif // SUBZERO_SRC_ICEOPERAND_H |
| OLD | NEW |