Chromium Code Reviews| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 void LoweringContext::init(CfgNode *N) { | 45 void LoweringContext::init(CfgNode *N) { |
| 46 Node = N; | 46 Node = N; |
| 47 Begin = getNode()->getInsts().begin(); | 47 Begin = getNode()->getInsts().begin(); |
| 48 Cur = Begin; | 48 Cur = Begin; |
| 49 End = getNode()->getInsts().end(); | 49 End = getNode()->getInsts().end(); |
| 50 skipDeleted(Cur); | 50 skipDeleted(Cur); |
| 51 Next = Cur; | 51 Next = Cur; |
| 52 advanceForward(Next); | 52 advanceForward(Next); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void LoweringContext::rewind() { | |
| 56 Begin = getNode()->getInsts().begin(); | |
|
jvoung (off chromium)
2014/10/27 22:12:21
It seems a bit unexpected that this isn't like ini
Jim Stichnoth
2014/10/28 01:20:14
Refactored init() to call rewind() - and added the
| |
| 57 Cur = Next = Begin; | |
| 58 } | |
| 59 | |
| 55 void LoweringContext::insert(Inst *Inst) { | 60 void LoweringContext::insert(Inst *Inst) { |
| 56 getNode()->getInsts().insert(Next, Inst); | 61 getNode()->getInsts().insert(Next, Inst); |
| 57 LastInserted = Inst; | 62 LastInserted = Inst; |
| 58 } | 63 } |
| 59 | 64 |
| 60 void LoweringContext::skipDeleted(InstList::iterator &I) const { | 65 void LoweringContext::skipDeleted(InstList::iterator &I) const { |
| 61 while (I != End && (*I)->isDeleted()) | 66 while (I != End && (*I)->isDeleted()) |
| 62 ++I; | 67 ++I; |
| 63 } | 68 } |
| 64 | 69 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 if (Target == Target_ARM64) | 254 if (Target == Target_ARM64) |
| 250 return IceTargetGlobalInitARM64::create(Ctx); | 255 return IceTargetGlobalInitARM64::create(Ctx); |
| 251 #endif | 256 #endif |
| 252 llvm_unreachable("Unsupported target"); | 257 llvm_unreachable("Unsupported target"); |
| 253 return NULL; | 258 return NULL; |
| 254 } | 259 } |
| 255 | 260 |
| 256 TargetGlobalInitLowering::~TargetGlobalInitLowering() {} | 261 TargetGlobalInitLowering::~TargetGlobalInitLowering() {} |
| 257 | 262 |
| 258 } // end of namespace Ice | 263 } // end of namespace Ice |
| OLD | NEW |