OLD | NEW |
1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 LoweringContext(const LoweringContext &) = delete; | 72 LoweringContext(const LoweringContext &) = delete; |
73 LoweringContext &operator=(const LoweringContext &) = delete; | 73 LoweringContext &operator=(const LoweringContext &) = delete; |
74 | 74 |
75 public: | 75 public: |
76 LoweringContext() = default; | 76 LoweringContext() = default; |
77 ~LoweringContext() = default; | 77 ~LoweringContext() = default; |
78 void init(CfgNode *Node); | 78 void init(CfgNode *Node); |
79 Inst *getNextInst() const { | 79 Inst *getNextInst() const { |
80 if (Next == End) | 80 if (Next == End) |
81 return nullptr; | 81 return nullptr; |
82 return Next; | 82 return iteratorToInst(Next); |
83 } | 83 } |
84 Inst *getNextInst(InstList::iterator &Iter) const { | 84 Inst *getNextInst(InstList::iterator &Iter) const { |
85 advanceForward(Iter); | 85 advanceForward(Iter); |
86 if (Iter == End) | 86 if (Iter == End) |
87 return nullptr; | 87 return nullptr; |
88 return Iter; | 88 return iteratorToInst(Iter); |
89 } | 89 } |
90 CfgNode *getNode() const { return Node; } | 90 CfgNode *getNode() const { return Node; } |
91 bool atEnd() const { return Cur == End; } | 91 bool atEnd() const { return Cur == End; } |
92 InstList::iterator getCur() const { return Cur; } | 92 InstList::iterator getCur() const { return Cur; } |
93 InstList::iterator getNext() const { return Next; } | 93 InstList::iterator getNext() const { return Next; } |
94 InstList::iterator getEnd() const { return End; } | 94 InstList::iterator getEnd() const { return End; } |
95 void insert(Inst *Instr); | 95 void insert(Inst *Instr); |
96 template <typename Inst, typename... Args> Inst *insert(Args &&... A) { | 96 template <typename Inst, typename... Args> Inst *insert(Args &&... A) { |
97 auto *New = Inst::create(Node->getCfg(), std::forward<Args>(A)...); | 97 auto *New = Inst::create(Node->getCfg(), std::forward<Args>(A)...); |
98 insert(New); | 98 insert(New); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 virtual void lower() {} | 619 virtual void lower() {} |
620 | 620 |
621 protected: | 621 protected: |
622 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 622 explicit TargetHeaderLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
623 GlobalContext *Ctx; | 623 GlobalContext *Ctx; |
624 }; | 624 }; |
625 | 625 |
626 } // end of namespace Ice | 626 } // end of namespace Ice |
627 | 627 |
628 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 628 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |