| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 operator=(const LLVM2ICEFunctionConverter &) = delete; | 76 operator=(const LLVM2ICEFunctionConverter &) = delete; |
| 77 | 77 |
| 78 public: | 78 public: |
| 79 LLVM2ICEFunctionConverter(Ice::Converter &Converter) | 79 LLVM2ICEFunctionConverter(Ice::Converter &Converter) |
| 80 : LLVM2ICEConverter(Converter), Func(nullptr) {} | 80 : LLVM2ICEConverter(Converter), Func(nullptr) {} |
| 81 | 81 |
| 82 // Caller is expected to delete the returned Ice::Cfg object. | 82 // Caller is expected to delete the returned Ice::Cfg object. |
| 83 Ice::Cfg *convertFunction(const Function *F) { | 83 Ice::Cfg *convertFunction(const Function *F) { |
| 84 VarMap.clear(); | 84 VarMap.clear(); |
| 85 NodeMap.clear(); | 85 NodeMap.clear(); |
| 86 Func = new Ice::Cfg(Ctx); | 86 Func = Ice::Cfg::create(Ctx); |
| 87 Func->setFunctionName(F->getName()); | 87 Func->setFunctionName(F->getName()); |
| 88 Func->setReturnType(convertToIceType(F->getReturnType())); | 88 Func->setReturnType(convertToIceType(F->getReturnType())); |
| 89 Func->setInternal(F->hasInternalLinkage()); | 89 Func->setInternal(F->hasInternalLinkage()); |
| 90 Ice::TimerMarker T(Ice::TimerStack::TT_llvmConvert, Func); | 90 Ice::TimerMarker T(Ice::TimerStack::TT_llvmConvert, Func); |
| 91 | 91 |
| 92 // The initial definition/use of each arg is the entry node. | 92 // The initial definition/use of each arg is the entry node. |
| 93 for (auto ArgI = F->arg_begin(), ArgE = F->arg_end(); ArgI != ArgE; | 93 for (auto ArgI = F->arg_begin(), ArgE = F->arg_end(); ArgI != ArgE; |
| 94 ++ArgI) { | 94 ++ArgI) { |
| 95 Func->addArg(mapValueToIceVar(ArgI)); | 95 Func->addArg(mapValueToIceVar(ArgI)); |
| 96 } | 96 } |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 Cfg *Fcn = FunctionConverter.convertFunction(&I); | 894 Cfg *Fcn = FunctionConverter.convertFunction(&I); |
| 895 translateFcn(Fcn); | 895 translateFcn(Fcn); |
| 896 if (ALLOW_DUMP && Ctx->getFlags().TimeEachFunction) | 896 if (ALLOW_DUMP && Ctx->getFlags().TimeEachFunction) |
| 897 Ctx->popTimer(TimerID, StackID); | 897 Ctx->popTimer(TimerID, StackID); |
| 898 } | 898 } |
| 899 | 899 |
| 900 emitConstants(); | 900 emitConstants(); |
| 901 } | 901 } |
| 902 | 902 |
| 903 } // end of namespace Ice | 903 } // end of namespace Ice |
| OLD | NEW |