| 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 /// \file | 10 /// \file |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 NumFunctionIDs(Context->getNumFunctionIDs()), | 938 NumFunctionIDs(Context->getNumFunctionIDs()), |
| 939 DummyGlobalVar( | 939 DummyGlobalVar( |
| 940 Ice::VariableDeclaration::create(getTranslator().getContext())), | 940 Ice::VariableDeclaration::create(getTranslator().getContext())), |
| 941 CurGlobalVar(DummyGlobalVar) {} | 941 CurGlobalVar(DummyGlobalVar) {} |
| 942 | 942 |
| 943 ~GlobalsParser() final = default; | 943 ~GlobalsParser() final = default; |
| 944 | 944 |
| 945 const char *getBlockName() const override { return "globals"; } | 945 const char *getBlockName() const override { return "globals"; } |
| 946 | 946 |
| 947 private: | 947 private: |
| 948 typedef std::unordered_map<NaClBcIndexSize_t, Ice::VariableDeclaration *> | 948 using GlobalVarsMapType = |
| 949 GlobalVarsMapType; | 949 std::unordered_map<NaClBcIndexSize_t, Ice::VariableDeclaration *>; |
| 950 | 950 |
| 951 Ice::TimerMarker Timer; | 951 Ice::TimerMarker Timer; |
| 952 | 952 |
| 953 // Holds global variables generated/referenced in the global variables block. | 953 // Holds global variables generated/referenced in the global variables block. |
| 954 GlobalVarsMapType GlobalVarsMap; | 954 GlobalVarsMapType GlobalVarsMap; |
| 955 | 955 |
| 956 // Holds the number of defined function IDs. | 956 // Holds the number of defined function IDs. |
| 957 NaClBcIndexSize_t NumFunctionIDs; | 957 NaClBcIndexSize_t NumFunctionIDs; |
| 958 | 958 |
| 959 // Holds the specified number of global variables by the count record in | 959 // Holds the specified number of global variables by the count record in |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1151 | 1151 |
| 1152 public: | 1152 public: |
| 1153 ValuesymtabParser(unsigned BlockID, BlockParserBaseClass *EnclosingParser) | 1153 ValuesymtabParser(unsigned BlockID, BlockParserBaseClass *EnclosingParser) |
| 1154 : BlockParserBaseClass(BlockID, EnclosingParser) {} | 1154 : BlockParserBaseClass(BlockID, EnclosingParser) {} |
| 1155 | 1155 |
| 1156 ~ValuesymtabParser() override = default; | 1156 ~ValuesymtabParser() override = default; |
| 1157 | 1157 |
| 1158 const char *getBlockName() const override { return "valuesymtab"; } | 1158 const char *getBlockName() const override { return "valuesymtab"; } |
| 1159 | 1159 |
| 1160 protected: | 1160 protected: |
| 1161 typedef SmallString<128> StringType; | 1161 using StringType = SmallString<128>; |
| 1162 | 1162 |
| 1163 // Associates Name with the value defined by the given Index. | 1163 // Associates Name with the value defined by the given Index. |
| 1164 virtual void setValueName(NaClBcIndexSize_t Index, StringType &Name) = 0; | 1164 virtual void setValueName(NaClBcIndexSize_t Index, StringType &Name) = 0; |
| 1165 | 1165 |
| 1166 // Associates Name with the value defined by the given Index; | 1166 // Associates Name with the value defined by the given Index; |
| 1167 virtual void setBbName(NaClBcIndexSize_t Index, StringType &Name) = 0; | 1167 virtual void setBbName(NaClBcIndexSize_t Index, StringType &Name) = 0; |
| 1168 | 1168 |
| 1169 private: | 1169 private: |
| 1170 void ProcessRecord() override; | 1170 void ProcessRecord() override; |
| 1171 | 1171 |
| (...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3171 } | 3171 } |
| 3172 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { | 3172 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { |
| 3173 ErrStream | 3173 ErrStream |
| 3174 << IRFilename | 3174 << IRFilename |
| 3175 << ": Bitcode stream should be a multiple of 4 bytes in length.\n"; | 3175 << ": Bitcode stream should be a multiple of 4 bytes in length.\n"; |
| 3176 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); | 3176 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); |
| 3177 } | 3177 } |
| 3178 } | 3178 } |
| 3179 | 3179 |
| 3180 } // end of namespace Ice | 3180 } // end of namespace Ice |
| OLD | NEW |