OLD | NEW |
1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// | 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// |
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 implements the skeleton of the TargetLowering class, | 10 // This file implements the skeleton of the TargetLowering class, |
(...skipping 20 matching lines...) Expand all Loading... |
31 skipDeleted(Cur); | 31 skipDeleted(Cur); |
32 Next = Cur; | 32 Next = Cur; |
33 advance(Next); | 33 advance(Next); |
34 } | 34 } |
35 | 35 |
36 void LoweringContext::insert(Inst *Inst) { | 36 void LoweringContext::insert(Inst *Inst) { |
37 getNode()->getInsts().insert(Next, Inst); | 37 getNode()->getInsts().insert(Next, Inst); |
38 Inst->updateVars(getNode()); | 38 Inst->updateVars(getNode()); |
39 } | 39 } |
40 | 40 |
41 void LoweringContext::skipDeleted(InstList::iterator &I) { | 41 void LoweringContext::skipDeleted(InstList::iterator &I) const { |
42 while (I != End && (*I)->isDeleted()) | 42 while (I != End && (*I)->isDeleted()) |
43 ++I; | 43 ++I; |
44 } | 44 } |
45 | 45 |
46 void LoweringContext::advance(InstList::iterator &I) { | 46 void LoweringContext::advance(InstList::iterator &I) const { |
47 if (I != End) { | 47 if (I != End) { |
48 ++I; | 48 ++I; |
49 skipDeleted(I); | 49 skipDeleted(I); |
50 } | 50 } |
51 } | 51 } |
52 | 52 |
53 TargetLowering *TargetLowering::createLowering(TargetArch Target, Cfg *Func) { | 53 TargetLowering *TargetLowering::createLowering(TargetArch Target, Cfg *Func) { |
54 // These statements can be #ifdef'd to specialize the code generator | 54 // These statements can be #ifdef'd to specialize the code generator |
55 // to a subset of the available targets. TODO: use CRTP. | 55 // to a subset of the available targets. TODO: use CRTP. |
56 if (Target == Target_X8632) | 56 if (Target == Target_X8632) |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 if (Target == Target_ARM64) | 194 if (Target == Target_ARM64) |
195 return IceTargetGlobalInitARM64::create(Ctx); | 195 return IceTargetGlobalInitARM64::create(Ctx); |
196 #endif | 196 #endif |
197 llvm_unreachable("Unsupported target"); | 197 llvm_unreachable("Unsupported target"); |
198 return NULL; | 198 return NULL; |
199 } | 199 } |
200 | 200 |
201 TargetGlobalInitLowering::~TargetGlobalInitLowering() {} | 201 TargetGlobalInitLowering::~TargetGlobalInitLowering() {} |
202 | 202 |
203 } // end of namespace Ice | 203 } // end of namespace Ice |
OLD | NEW |