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 // This file declares the TargetLowering and LoweringContext | 10 // This file declares the TargetLowering and LoweringContext |
(...skipping 19 matching lines...) Expand all Loading... |
30 // instructions in a node, and insert new (lowered) instructions at | 30 // instructions in a node, and insert new (lowered) instructions at |
31 // the current point. Along with the instruction list container and | 31 // the current point. Along with the instruction list container and |
32 // associated iterators, it holds the current node, which is needed | 32 // associated iterators, it holds the current node, which is needed |
33 // when inserting new instructions in order to track whether variables | 33 // when inserting new instructions in order to track whether variables |
34 // are used as single-block or multi-block. | 34 // are used as single-block or multi-block. |
35 class LoweringContext { | 35 class LoweringContext { |
36 LoweringContext(const LoweringContext &) = delete; | 36 LoweringContext(const LoweringContext &) = delete; |
37 LoweringContext &operator=(const LoweringContext &) = delete; | 37 LoweringContext &operator=(const LoweringContext &) = delete; |
38 | 38 |
39 public: | 39 public: |
40 LoweringContext() : Node(NULL), LastInserted(NULL) {} | 40 LoweringContext() : Node(nullptr), LastInserted(nullptr) {} |
41 ~LoweringContext() {} | 41 ~LoweringContext() {} |
42 void init(CfgNode *Node); | 42 void init(CfgNode *Node); |
43 Inst *getNextInst() const { | 43 Inst *getNextInst() const { |
44 if (Next == End) | 44 if (Next == End) |
45 return NULL; | 45 return nullptr; |
46 return Next; | 46 return Next; |
47 } | 47 } |
48 Inst *getNextInst(InstList::iterator &Iter) const { | 48 Inst *getNextInst(InstList::iterator &Iter) const { |
49 advanceForward(Iter); | 49 advanceForward(Iter); |
50 if (Iter == End) | 50 if (Iter == End) |
51 return NULL; | 51 return nullptr; |
52 return Iter; | 52 return Iter; |
53 } | 53 } |
54 CfgNode *getNode() const { return Node; } | 54 CfgNode *getNode() const { return Node; } |
55 bool atEnd() const { return Cur == End; } | 55 bool atEnd() const { return Cur == End; } |
56 InstList::iterator getCur() const { return Cur; } | 56 InstList::iterator getCur() const { return Cur; } |
57 InstList::iterator getNext() const { return Next; } | 57 InstList::iterator getNext() const { return Next; } |
58 InstList::iterator getEnd() const { return End; } | 58 InstList::iterator getEnd() const { return End; } |
59 void insert(Inst *Inst); | 59 void insert(Inst *Inst); |
60 Inst *getLastInserted() const; | 60 Inst *getLastInserted() const; |
61 void advanceCur() { Cur = Next; } | 61 void advanceCur() { Cur = Next; } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 virtual void lower(const VariableDeclaration &Var) = 0; | 262 virtual void lower(const VariableDeclaration &Var) = 0; |
263 | 263 |
264 protected: | 264 protected: |
265 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} | 265 TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {} |
266 GlobalContext *Ctx; | 266 GlobalContext *Ctx; |
267 }; | 267 }; |
268 | 268 |
269 } // end of namespace Ice | 269 } // end of namespace Ice |
270 | 270 |
271 #endif // SUBZERO_SRC_ICETARGETLOWERING_H | 271 #endif // SUBZERO_SRC_ICETARGETLOWERING_H |
OLD | NEW |