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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 | 139 |
140 private: | 140 private: |
141 // LLVM values (instructions, etc.) are mapped directly to ICE variables. | 141 // LLVM values (instructions, etc.) are mapped directly to ICE variables. |
142 // mapValueToIceVar has a version that forces an ICE type on the variable, | 142 // mapValueToIceVar has a version that forces an ICE type on the variable, |
143 // and a version that just uses convertToIceType on V. | 143 // and a version that just uses convertToIceType on V. |
144 Ice::Variable *mapValueToIceVar(const Value *V, Ice::Type IceTy) { | 144 Ice::Variable *mapValueToIceVar(const Value *V, Ice::Type IceTy) { |
145 if (IceTy == Ice::IceType_void) | 145 if (IceTy == Ice::IceType_void) |
146 return nullptr; | 146 return nullptr; |
147 if (VarMap.find(V) == VarMap.end()) { | 147 if (VarMap.find(V) == VarMap.end()) { |
148 VarMap[V] = Func->makeVariable(IceTy, V->getName()); | 148 VarMap[V] = Func->makeVariable(IceTy); |
| 149 if (ALLOW_DUMP) |
| 150 VarMap[V]->setName(Func, V->getName()); |
149 } | 151 } |
150 return VarMap[V]; | 152 return VarMap[V]; |
151 } | 153 } |
152 | 154 |
153 Ice::Variable *mapValueToIceVar(const Value *V) { | 155 Ice::Variable *mapValueToIceVar(const Value *V) { |
154 return mapValueToIceVar(V, convertToIceType(V->getType())); | 156 return mapValueToIceVar(V, convertToIceType(V->getType())); |
155 } | 157 } |
156 | 158 |
157 Ice::CfgNode *mapBasicBlockToNode(const BasicBlock *BB) { | 159 Ice::CfgNode *mapBasicBlockToNode(const BasicBlock *BB) { |
158 if (NodeMap.find(BB) == NodeMap.end()) { | 160 if (NodeMap.find(BB) == NodeMap.end()) { |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 Cfg *Fcn = FunctionConverter.convertFunction(&I); | 896 Cfg *Fcn = FunctionConverter.convertFunction(&I); |
895 translateFcn(Fcn); | 897 translateFcn(Fcn); |
896 if (ALLOW_DUMP && Ctx->getFlags().TimeEachFunction) | 898 if (ALLOW_DUMP && Ctx->getFlags().TimeEachFunction) |
897 Ctx->popTimer(TimerID, StackID); | 899 Ctx->popTimer(TimerID, StackID); |
898 } | 900 } |
899 | 901 |
900 emitConstants(); | 902 emitConstants(); |
901 } | 903 } |
902 | 904 |
903 } // end of namespace Ice | 905 } // end of namespace Ice |
OLD | NEW |