Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(690)

Side by Side Diff: include/llvm/Bitcode/NaCl/NaClObjDumpStream.h

Issue 932953002: Fix the NaCl bitstream reader to report fatal errors. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix formatting. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===- NaClObjDumpStream.h --------------------------------------*- C++ -*-===// 1 //===- NaClObjDumpStream.h --------------------------------------*- C++ -*-===//
2 // Models an objdump stream (bitcode records/assembly code). 2 // Models an objdump stream (bitcode records/assembly code).
3 // 3 //
4 // The LLVM Compiler Infrastructure 4 // The LLVM Compiler Infrastructure
5 // 5 //
6 // This file is distributed under the University of Illinois Open Source 6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details. 7 // License. See LICENSE.TXT for details.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 10
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 837
838 /// Prints "Error(Bit/8:Bit%8): " onto the comments stream, records 838 /// Prints "Error(Bit/8:Bit%8): " onto the comments stream, records
839 /// that an error has occurred, and then returns the comments 839 /// that an error has occurred, and then returns the comments
840 /// stream. In general errors will be printed after the next record, 840 /// stream. In general errors will be printed after the next record,
841 /// unless a call to Flush is made. 841 /// unless a call to Flush is made.
842 raw_ostream &Error(uint64_t Bit); 842 raw_ostream &Error(uint64_t Bit);
843 843
844 /// Write a fatal error message to the dump stream, and then 844 /// Write a fatal error message to the dump stream, and then
845 /// stop the executable. If any assembly, comments, or errors have 845 /// stop the executable. If any assembly, comments, or errors have
846 /// been buffered, they will be printed first. 846 /// been buffered, they will be printed first.
847 LLVM_ATTRIBUTE_NORETURN
847 void Fatal(const std::string &Message) { 848 void Fatal(const std::string &Message) {
848 Fatal(LastKnownBit, Message); 849 Fatal(LastKnownBit, Message);
849 } 850 }
850 851
851 /// Write a fatal error message to the dump stream, and then 852 /// Write a fatal error message to the dump stream, and then
852 /// stop the executable. If any assembly, comments, or errors have 853 /// stop the executable. If any assembly, comments, or errors have
853 /// been buffered, they will be printed first. Associates fatal error 854 /// been buffered, they will be printed first. Associates fatal error
854 /// Message with the given Bit. 855 /// Message with the given Bit.
856 LLVM_ATTRIBUTE_NORETURN
855 void Fatal(uint64_t Bit, const std::string &Message); 857 void Fatal(uint64_t Bit, const std::string &Message);
856 858
857 /// Write a fatal error message to the dump stream, and then 859 /// Write a fatal error message to the dump stream, and then
858 /// stop the executable. If any assembly, comments, or errors have 860 /// stop the executable. If any assembly, comments, or errors have
859 /// been buffered, they will be printed first, along with the given record. 861 /// been buffered, they will be printed first, along with the given record.
862 LLVM_ATTRIBUTE_NORETURN
860 void Fatal(uint64_t Bit, 863 void Fatal(uint64_t Bit,
861 const llvm::NaClBitcodeRecordData &Record, 864 const llvm::NaClBitcodeRecordData &Record,
862 const std::string &Message); 865 const std::string &Message);
863 866
864 /// Dumps a record (at the given bit), along with all buffered assembly, 867 /// Dumps a record (at the given bit), along with all buffered assembly,
865 /// comments, and errors, into the objdump stream. 868 /// comments, and errors, into the objdump stream.
866 void Write(uint64_t Bit, 869 void Write(uint64_t Bit,
867 const llvm::NaClBitcodeRecordData &Record, 870 const llvm::NaClBitcodeRecordData &Record,
868 int32_t AbbrevIndex = ABBREV_INDEX_NOT_SPECIFIED) { 871 int32_t AbbrevIndex = ABBREV_INDEX_NOT_SPECIFIED) {
869 LastKnownBit = Bit; 872 LastKnownBit = Bit;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 // Returns the message stream with 'Label(Bit/8:Bit%8): '. 1000 // Returns the message stream with 'Label(Bit/8:Bit%8): '.
998 raw_ostream &PrintMessagePrefix(const char *Label, uint64_t Bit) { 1001 raw_ostream &PrintMessagePrefix(const char *Label, uint64_t Bit) {
999 return Comments() << Label << "(" << ObjDumpAddress(Bit) << "): "; 1002 return Comments() << Label << "(" << ObjDumpAddress(Bit) << "): ";
1000 } 1003 }
1001 }; 1004 };
1002 1005
1003 } 1006 }
1004 } 1007 }
1005 1008
1006 #endif 1009 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698