OLD | NEW |
---|---|
1 //===- subzero/src/IceConverter.cpp - Converts LLVM to Ice ---------------===// | 1 //===- subzero/src/IceConverter.cpp - Converts LLVM to Ice ---------------===// |
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 LLVM to ICE converter. | 10 // This file implements the LLVM to ICE converter. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 } | 125 } |
126 | 126 |
127 private: | 127 private: |
128 // LLVM values (instructions, etc.) are mapped directly to ICE variables. | 128 // LLVM values (instructions, etc.) are mapped directly to ICE variables. |
129 // mapValueToIceVar has a version that forces an ICE type on the variable, | 129 // mapValueToIceVar has a version that forces an ICE type on the variable, |
130 // and a version that just uses convertToIceType on V. | 130 // and a version that just uses convertToIceType on V. |
131 Ice::Variable *mapValueToIceVar(const Value *V, Ice::Type IceTy) { | 131 Ice::Variable *mapValueToIceVar(const Value *V, Ice::Type IceTy) { |
132 if (IceTy == Ice::IceType_void) | 132 if (IceTy == Ice::IceType_void) |
133 return NULL; | 133 return NULL; |
134 if (VarMap.find(V) == VarMap.end()) { | 134 if (VarMap.find(V) == VarMap.end()) { |
135 assert(CurrentNode); | 135 VarMap[V] = Func->makeVariable(IceTy, V->getName()); |
jvoung (off chromium)
2014/09/22 17:07:29
It seems like CurrentNode is not read anymore, so
Jim Stichnoth
2014/09/22 21:00:46
Nice! Done.
| |
136 VarMap[V] = Func->makeVariable(IceTy, CurrentNode, V->getName()); | |
137 } | 136 } |
138 return VarMap[V]; | 137 return VarMap[V]; |
139 } | 138 } |
140 | 139 |
141 Ice::Variable *mapValueToIceVar(const Value *V) { | 140 Ice::Variable *mapValueToIceVar(const Value *V) { |
142 return mapValueToIceVar(V, convertToIceType(V->getType())); | 141 return mapValueToIceVar(V, convertToIceType(V->getType())); |
143 } | 142 } |
144 | 143 |
145 Ice::CfgNode *mapBasicBlockToNode(const BasicBlock *BB) { | 144 Ice::CfgNode *mapBasicBlockToNode(const BasicBlock *BB) { |
146 if (NodeMap.find(BB) == NodeMap.end()) { | 145 if (NodeMap.find(BB) == NodeMap.end()) { |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
687 << Fcn->getFunctionName() << ": " << TConvert.getElapsedSec() | 686 << Fcn->getFunctionName() << ": " << TConvert.getElapsedSec() |
688 << " sec\n"; | 687 << " sec\n"; |
689 } | 688 } |
690 translateFcn(Fcn); | 689 translateFcn(Fcn); |
691 } | 690 } |
692 | 691 |
693 emitConstants(); | 692 emitConstants(); |
694 } | 693 } |
695 | 694 |
696 } // end of namespace Ice | 695 } // end of namespace Ice |
OLD | NEW |