OLD | NEW |
1 //===- subzero/src/PNaClTranslator.cpp - ICE from bitcode -----------------===// | 1 //===- subzero/src/PNaClTranslator.cpp - ICE from bitcode -----------------===// |
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 PNaCl bitcode file to Ice, to machine code | 10 // This file implements the PNaCl bitcode file to Ice, to machine code |
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 : BlockParserBaseClass(BlockID, EnclosingParser), | 1105 : BlockParserBaseClass(BlockID, EnclosingParser), |
1106 Timer(Ice::TimerStack::TT_parseFunctions, getTranslator().getContext()), | 1106 Timer(Ice::TimerStack::TT_parseFunctions, getTranslator().getContext()), |
1107 Func(isIRGenerationDisabled() | 1107 Func(isIRGenerationDisabled() |
1108 ? nullptr | 1108 ? nullptr |
1109 : new Ice::Cfg(getTranslator().getContext())), | 1109 : new Ice::Cfg(getTranslator().getContext())), |
1110 CurrentBbIndex(0), FcnId(Context->getNextFunctionBlockValueID()), | 1110 CurrentBbIndex(0), FcnId(Context->getNextFunctionBlockValueID()), |
1111 FuncDecl(Context->getFunctionByID(FcnId)), | 1111 FuncDecl(Context->getFunctionByID(FcnId)), |
1112 CachedNumGlobalValueIDs(Context->getNumGlobalIDs()), | 1112 CachedNumGlobalValueIDs(Context->getNumGlobalIDs()), |
1113 NextLocalInstIndex(Context->getNumGlobalIDs()), | 1113 NextLocalInstIndex(Context->getNumGlobalIDs()), |
1114 InstIsTerminating(false) { | 1114 InstIsTerminating(false) { |
1115 if (getFlags().TimeEachFunction) | 1115 if (ALLOW_DUMP && getFlags().TimeEachFunction) |
1116 getTranslator().getContext()->pushTimer( | 1116 getTranslator().getContext()->pushTimer( |
1117 getTranslator().getContext()->getTimerID( | 1117 getTranslator().getContext()->getTimerID( |
1118 Ice::GlobalContext::TSK_Funcs, FuncDecl->getName()), | 1118 Ice::GlobalContext::TSK_Funcs, FuncDecl->getName()), |
1119 Ice::GlobalContext::TSK_Funcs); | 1119 Ice::GlobalContext::TSK_Funcs); |
1120 // TODO(kschimpf) Clean up API to add a function signature to | 1120 // TODO(kschimpf) Clean up API to add a function signature to |
1121 // a CFG. | 1121 // a CFG. |
1122 const Ice::FuncSigType &Signature = FuncDecl->getSignature(); | 1122 const Ice::FuncSigType &Signature = FuncDecl->getSignature(); |
1123 if (isIRGenerationDisabled()) { | 1123 if (isIRGenerationDisabled()) { |
1124 CurrentNode = nullptr; | 1124 CurrentNode = nullptr; |
1125 for (Ice::Type ArgType : Signature.getArgList()) { | 1125 for (Ice::Type ArgType : Signature.getArgList()) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 // Holds the index within LocalOperands corresponding to the next | 1203 // Holds the index within LocalOperands corresponding to the next |
1204 // instruction that generates a value. | 1204 // instruction that generates a value. |
1205 uint32_t NextLocalInstIndex; | 1205 uint32_t NextLocalInstIndex; |
1206 // True if the last processed instruction was a terminating | 1206 // True if the last processed instruction was a terminating |
1207 // instruction. | 1207 // instruction. |
1208 bool InstIsTerminating; | 1208 bool InstIsTerminating; |
1209 // Upper limit of alignment power allowed by LLVM | 1209 // Upper limit of alignment power allowed by LLVM |
1210 static const uint64_t AlignPowerLimit = 29; | 1210 static const uint64_t AlignPowerLimit = 29; |
1211 | 1211 |
1212 void popTimerIfTimingEachFunction() const { | 1212 void popTimerIfTimingEachFunction() const { |
1213 if (getFlags().TimeEachFunction) { | 1213 if (ALLOW_DUMP && getFlags().TimeEachFunction) { |
1214 getTranslator().getContext()->popTimer( | 1214 getTranslator().getContext()->popTimer( |
1215 getTranslator().getContext()->getTimerID( | 1215 getTranslator().getContext()->getTimerID( |
1216 Ice::GlobalContext::TSK_Funcs, Func->getFunctionName()), | 1216 Ice::GlobalContext::TSK_Funcs, Func->getFunctionName()), |
1217 Ice::GlobalContext::TSK_Funcs); | 1217 Ice::GlobalContext::TSK_Funcs); |
1218 } | 1218 } |
1219 } | 1219 } |
1220 | 1220 |
1221 // Extracts the corresponding Alignment to use, given the AlignPower | 1221 // Extracts the corresponding Alignment to use, given the AlignPower |
1222 // (i.e. 2**AlignPower, or 0 if AlignPower == 0). InstName is the | 1222 // (i.e. 2**AlignPower, or 0 if AlignPower == 0). InstName is the |
1223 // name of the instruction the alignment appears in. | 1223 // name of the instruction the alignment appears in. |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2942 | 2942 |
2943 if (TopLevelBlocks != 1) { | 2943 if (TopLevelBlocks != 1) { |
2944 errs() << IRFilename | 2944 errs() << IRFilename |
2945 << ": Contains more than one module. Found: " << TopLevelBlocks | 2945 << ": Contains more than one module. Found: " << TopLevelBlocks |
2946 << "\n"; | 2946 << "\n"; |
2947 ErrorStatus = true; | 2947 ErrorStatus = true; |
2948 } | 2948 } |
2949 } | 2949 } |
2950 | 2950 |
2951 } // end of namespace Ice | 2951 } // end of namespace Ice |
OLD | NEW |