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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 return; | 1079 return; |
1080 } | 1080 } |
1081 default: | 1081 default: |
1082 break; | 1082 break; |
1083 } | 1083 } |
1084 // If reached, don't know how to handle record. | 1084 // If reached, don't know how to handle record. |
1085 BlockParserBaseClass::ProcessRecord(); | 1085 BlockParserBaseClass::ProcessRecord(); |
1086 return; | 1086 return; |
1087 } | 1087 } |
1088 | 1088 |
1089 class FunctionValuesymtabParser; | |
1090 | |
1091 /// Parses function blocks in the bitcode file. | 1089 /// Parses function blocks in the bitcode file. |
1092 class FunctionParser : public BlockParserBaseClass { | 1090 class FunctionParser : public BlockParserBaseClass { |
1093 FunctionParser(const FunctionParser &) = delete; | 1091 FunctionParser(const FunctionParser &) = delete; |
1094 FunctionParser &operator=(const FunctionParser &) = delete; | 1092 FunctionParser &operator=(const FunctionParser &) = delete; |
1095 | 1093 |
1096 public: | 1094 public: |
1097 FunctionParser(unsigned BlockID, BlockParserBaseClass *EnclosingParser) | 1095 FunctionParser(unsigned BlockID, BlockParserBaseClass *EnclosingParser) |
1098 : BlockParserBaseClass(BlockID, EnclosingParser), | 1096 : BlockParserBaseClass(BlockID, EnclosingParser), |
1099 Timer(Ice::TimerStack::TT_parseFunctions, getTranslator().getContext()), | 1097 Timer(Ice::TimerStack::TT_parseFunctions, getTranslator().getContext()), |
1100 Func(isIRGenerationDisabled() | 1098 Func(isIRGenerationDisabled() |
(...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2656 // (FP->getOperand will create fatal error). | 2654 // (FP->getOperand will create fatal error). |
2657 if (Index < getFunctionParser()->getNumGlobalIDs()) { | 2655 if (Index < getFunctionParser()->getNumGlobalIDs()) { |
2658 reportUnableToAssign("instruction", Index, Name); | 2656 reportUnableToAssign("instruction", Index, Name); |
2659 // TODO(kschimpf) Remove error recovery once implementation complete. | 2657 // TODO(kschimpf) Remove error recovery once implementation complete. |
2660 return; | 2658 return; |
2661 } | 2659 } |
2662 if (isIRGenerationDisabled()) | 2660 if (isIRGenerationDisabled()) |
2663 return; | 2661 return; |
2664 Ice::Operand *Op = getFunctionParser()->getOperand(Index); | 2662 Ice::Operand *Op = getFunctionParser()->getOperand(Index); |
2665 if (Ice::Variable *V = dyn_cast<Ice::Variable>(Op)) { | 2663 if (Ice::Variable *V = dyn_cast<Ice::Variable>(Op)) { |
2666 std::string Nm(Name.data(), Name.size()); | 2664 if (ALLOW_DUMP) { |
2667 V->setName(Nm); | 2665 std::string Nm(Name.data(), Name.size()); |
| 2666 V->setName(getFunctionParser()->getFunc(), Nm); |
| 2667 } |
2668 } else { | 2668 } else { |
2669 reportUnableToAssign("variable", Index, Name); | 2669 reportUnableToAssign("variable", Index, Name); |
2670 } | 2670 } |
2671 } | 2671 } |
2672 | 2672 |
2673 void FunctionValuesymtabParser::setBbName(uint64_t Index, StringType &Name) { | 2673 void FunctionValuesymtabParser::setBbName(uint64_t Index, StringType &Name) { |
2674 if (isIRGenerationDisabled()) | 2674 if (isIRGenerationDisabled()) |
2675 return; | 2675 return; |
2676 if (Index >= getFunctionParser()->getFunc()->getNumNodes()) { | 2676 if (Index >= getFunctionParser()->getFunc()->getNumNodes()) { |
2677 reportUnableToAssign("block", Index, Name); | 2677 reportUnableToAssign("block", Index, Name); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2939 | 2939 |
2940 if (TopLevelBlocks != 1) { | 2940 if (TopLevelBlocks != 1) { |
2941 errs() << IRFilename | 2941 errs() << IRFilename |
2942 << ": Contains more than one module. Found: " << TopLevelBlocks | 2942 << ": Contains more than one module. Found: " << TopLevelBlocks |
2943 << "\n"; | 2943 << "\n"; |
2944 ErrorStatus = true; | 2944 ErrorStatus = true; |
2945 } | 2945 } |
2946 } | 2946 } |
2947 | 2947 |
2948 } // end of namespace Ice | 2948 } // end of namespace Ice |
OLD | NEW |