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 /// \file | 10 /// \file |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 LLVM2ICEFunctionConverter() = delete; | 82 LLVM2ICEFunctionConverter() = delete; |
83 LLVM2ICEFunctionConverter(const LLVM2ICEFunctionConverter &) = delete; | 83 LLVM2ICEFunctionConverter(const LLVM2ICEFunctionConverter &) = delete; |
84 LLVM2ICEFunctionConverter & | 84 LLVM2ICEFunctionConverter & |
85 operator=(const LLVM2ICEFunctionConverter &) = delete; | 85 operator=(const LLVM2ICEFunctionConverter &) = delete; |
86 | 86 |
87 public: | 87 public: |
88 explicit LLVM2ICEFunctionConverter(Ice::Converter &Converter) | 88 explicit LLVM2ICEFunctionConverter(Ice::Converter &Converter) |
89 : LLVM2ICEConverter(Converter), Func(nullptr) {} | 89 : LLVM2ICEConverter(Converter), Func(nullptr) {} |
90 | 90 |
91 void convertFunction(const Function *F) { | 91 void convertFunction(const Function *F) { |
92 if (Ctx->isIRGenerationDisabled()) | |
93 return; | |
94 Func = Ice::Cfg::create(Ctx, Converter.getNextSequenceNumber()); | 92 Func = Ice::Cfg::create(Ctx, Converter.getNextSequenceNumber()); |
95 Ice::Cfg::setCurrentCfg(Func.get()); | 93 Ice::Cfg::setCurrentCfg(Func.get()); |
96 | 94 |
97 VarMap.clear(); | 95 VarMap.clear(); |
98 NodeMap.clear(); | 96 NodeMap.clear(); |
99 Func->setFunctionName(F->getName()); | 97 Func->setFunctionName(F->getName()); |
100 Func->setReturnType(convertToIceType(F->getReturnType())); | 98 Func->setReturnType(convertToIceType(F->getReturnType())); |
101 Func->setInternal(F->hasInternalLinkage()); | 99 Func->setInternal(F->hasInternalLinkage()); |
102 Ice::TimerMarker T(Ice::TimerStack::TT_llvmConvert, Func.get()); | 100 Ice::TimerMarker T(Ice::TimerStack::TT_llvmConvert, Func.get()); |
103 | 101 |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 Ctx->pushTimer(TimerID, StackID); | 916 Ctx->pushTimer(TimerID, StackID); |
919 } | 917 } |
920 LLVM2ICEFunctionConverter FunctionConverter(*this); | 918 LLVM2ICEFunctionConverter FunctionConverter(*this); |
921 FunctionConverter.convertFunction(&I); | 919 FunctionConverter.convertFunction(&I); |
922 if (TimeThisFunction) | 920 if (TimeThisFunction) |
923 Ctx->popTimer(TimerID, StackID); | 921 Ctx->popTimer(TimerID, StackID); |
924 } | 922 } |
925 } | 923 } |
926 | 924 |
927 } // end of namespace Ice | 925 } // end of namespace Ice |
OLD | NEW |