| 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 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 uint64_t Offset = 0; | 1204 uint64_t Offset = 0; |
| 1205 if (Values.size() == 2) { | 1205 if (Values.size() == 2) { |
| 1206 Offset = Values[1]; | 1206 Offset = Values[1]; |
| 1207 if (Offset > std::numeric_limits<uint32_t>::max()) { | 1207 if (Offset > std::numeric_limits<uint32_t>::max()) { |
| 1208 std::string Buffer; | 1208 std::string Buffer; |
| 1209 raw_string_ostream StrBuf(Buffer); | 1209 raw_string_ostream StrBuf(Buffer); |
| 1210 StrBuf << "Addend of global reloc record too big: " << Offset; | 1210 StrBuf << "Addend of global reloc record too big: " << Offset; |
| 1211 Error(StrBuf.str()); | 1211 Error(StrBuf.str()); |
| 1212 } | 1212 } |
| 1213 } | 1213 } |
| 1214 Ice::GlobalContext *Ctx = getTranslator().getContext(); |
| 1214 CurGlobalVar->addInitializer( | 1215 CurGlobalVar->addInitializer( |
| 1215 Ice::VariableDeclaration::RelocInitializer::create( | 1216 Ice::VariableDeclaration::RelocInitializer::create( |
| 1216 getGlobalDeclByID(Index), Offset)); | 1217 getGlobalDeclByID(Index), {Ice::RelocOffset::create(Ctx, Offset)})); |
| 1217 return; | 1218 return; |
| 1218 } | 1219 } |
| 1219 default: | 1220 default: |
| 1220 BlockParserBaseClass::ProcessRecord(); | 1221 BlockParserBaseClass::ProcessRecord(); |
| 1221 return; | 1222 return; |
| 1222 } | 1223 } |
| 1223 } | 1224 } |
| 1224 | 1225 |
| 1225 /// Base class for parsing a valuesymtab block in the bitcode file. | 1226 /// Base class for parsing a valuesymtab block in the bitcode file. |
| 1226 class ValuesymtabParser : public BlockParserBaseClass { | 1227 class ValuesymtabParser : public BlockParserBaseClass { |
| (...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3202 raw_string_ostream StrBuf(Buffer); | 3203 raw_string_ostream StrBuf(Buffer); |
| 3203 StrBuf << IRFilename << ": Does not contain a module!"; | 3204 StrBuf << IRFilename << ": Does not contain a module!"; |
| 3204 llvm::report_fatal_error(StrBuf.str()); | 3205 llvm::report_fatal_error(StrBuf.str()); |
| 3205 } | 3206 } |
| 3206 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { | 3207 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { |
| 3207 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); | 3208 llvm::report_fatal_error("Bitcode stream should be a multiple of 4 bytes"); |
| 3208 } | 3209 } |
| 3209 } | 3210 } |
| 3210 | 3211 |
| 3211 } // end of namespace Ice | 3212 } // end of namespace Ice |
| OLD | NEW |