| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 149 } |
| 150 return VarMap[V]; | 150 return VarMap[V]; |
| 151 } | 151 } |
| 152 | 152 |
| 153 Ice::Variable *mapValueToIceVar(const Value *V) { | 153 Ice::Variable *mapValueToIceVar(const Value *V) { |
| 154 return mapValueToIceVar(V, convertToIceType(V->getType())); | 154 return mapValueToIceVar(V, convertToIceType(V->getType())); |
| 155 } | 155 } |
| 156 | 156 |
| 157 Ice::CfgNode *mapBasicBlockToNode(const BasicBlock *BB) { | 157 Ice::CfgNode *mapBasicBlockToNode(const BasicBlock *BB) { |
| 158 if (NodeMap.find(BB) == NodeMap.end()) { | 158 if (NodeMap.find(BB) == NodeMap.end()) { |
| 159 NodeMap[BB] = Func->makeNode(BB->getName()); | 159 NodeMap[BB] = Func->makeNode(); |
| 160 if (ALLOW_DUMP) |
| 161 NodeMap[BB]->setName(BB->getName()); |
| 160 } | 162 } |
| 161 return NodeMap[BB]; | 163 return NodeMap[BB]; |
| 162 } | 164 } |
| 163 | 165 |
| 164 Ice::Type convertToIceType(Type *LLVMTy) const { | 166 Ice::Type convertToIceType(Type *LLVMTy) const { |
| 165 Ice::Type IceTy = TypeConverter.convertToIceType(LLVMTy); | 167 Ice::Type IceTy = TypeConverter.convertToIceType(LLVMTy); |
| 166 if (IceTy == Ice::IceType_NUM) | 168 if (IceTy == Ice::IceType_NUM) |
| 167 report_fatal_error(std::string("Invalid PNaCl type ") + | 169 report_fatal_error(std::string("Invalid PNaCl type ") + |
| 168 LLVMObjectAsString(LLVMTy)); | 170 LLVMObjectAsString(LLVMTy)); |
| 169 return IceTy; | 171 return IceTy; |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 Cfg *Fcn = FunctionConverter.convertFunction(&I); | 894 Cfg *Fcn = FunctionConverter.convertFunction(&I); |
| 893 translateFcn(Fcn); | 895 translateFcn(Fcn); |
| 894 if (ALLOW_DUMP && Ctx->getFlags().TimeEachFunction) | 896 if (ALLOW_DUMP && Ctx->getFlags().TimeEachFunction) |
| 895 Ctx->popTimer(TimerID, StackID); | 897 Ctx->popTimer(TimerID, StackID); |
| 896 } | 898 } |
| 897 | 899 |
| 898 emitConstants(); | 900 emitConstants(); |
| 899 } | 901 } |
| 900 | 902 |
| 901 } // end of namespace Ice | 903 } // end of namespace Ice |
| OLD | NEW |