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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 Ice::Type convertToIceTypeError(Type *LLVMTy); | 481 Ice::Type convertToIceTypeError(Type *LLVMTy); |
482 }; | 482 }; |
483 | 483 |
484 bool TopLevelParser::ErrorAt(naclbitc::ErrorLevel Level, uint64_t Bit, | 484 bool TopLevelParser::ErrorAt(naclbitc::ErrorLevel Level, uint64_t Bit, |
485 const std::string &Message) { | 485 const std::string &Message) { |
486 ErrorStatus.assign(Ice::EC_Bitcode); | 486 ErrorStatus.assign(Ice::EC_Bitcode); |
487 ++NumErrors; | 487 ++NumErrors; |
488 Ice::GlobalContext *Context = Translator.getContext(); | 488 Ice::GlobalContext *Context = Translator.getContext(); |
489 { // Lock while printing out error message. | 489 { // Lock while printing out error message. |
490 Ice::OstreamLocker L(Context); | 490 Ice::OstreamLocker L(Context); |
491 raw_ostream &OldErrStream = setErrStream(Context->getStrDump()); | 491 raw_ostream &OldErrStream = setErrStream(Context->getStrError()); |
492 NaClBitcodeParser::ErrorAt(Level, Bit, Message); | 492 NaClBitcodeParser::ErrorAt(Level, Bit, Message); |
493 setErrStream(OldErrStream); | 493 setErrStream(OldErrStream); |
494 } | 494 } |
495 if (Level >= naclbitc::Error && | 495 if (Level >= naclbitc::Error && |
496 !Translator.getFlags().getAllowErrorRecovery()) | 496 !Translator.getFlags().getAllowErrorRecovery()) |
497 Fatal(); | 497 Fatal(); |
498 return true; | 498 return true; |
499 } | 499 } |
500 | 500 |
501 void TopLevelParser::reportBadTypeIDAs(unsigned ID, const ExtendedType *Ty, | 501 void TopLevelParser::reportBadTypeIDAs(unsigned ID, const ExtendedType *Ty, |
(...skipping 2514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3016 } | 3016 } |
3017 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { | 3017 if (InputStreamFile.getBitcodeBytes().getExtent() % 4 != 0) { |
3018 errs() << IRFilename | 3018 errs() << IRFilename |
3019 << ": Bitcode stream should be a multiple of 4 bytes in length.\n"; | 3019 << ": Bitcode stream should be a multiple of 4 bytes in length.\n"; |
3020 ErrorStatus.assign(EC_Bitcode); | 3020 ErrorStatus.assign(EC_Bitcode); |
3021 return; | 3021 return; |
3022 } | 3022 } |
3023 } | 3023 } |
3024 | 3024 |
3025 } // end of namespace Ice | 3025 } // end of namespace Ice |
OLD | NEW |