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

Unified Diff: include/llvm/Bitcode/NaCl/NaClBitcodeParser.h

Issue 986453002: Additional clean ups on errors in bitcode parsing. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix nits. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: include/llvm/Bitcode/NaCl/NaClBitcodeParser.h
diff --git a/include/llvm/Bitcode/NaCl/NaClBitcodeParser.h b/include/llvm/Bitcode/NaCl/NaClBitcodeParser.h
index 06ad98a92ff1d5d18bc62165b0246c83020386c5..d4e06e062279060dfa7fb91a1aad41a23e3eaa15 100644
--- a/include/llvm/Bitcode/NaCl/NaClBitcodeParser.h
+++ b/include/llvm/Bitcode/NaCl/NaClBitcodeParser.h
@@ -499,8 +499,14 @@ public:
// Called when an error occurs. BitPosition is the bit position the
// error was found, and Message is the error to report. Always
- // returns true (the error return value of Parse).
- virtual bool ErrorAt(uint64_t BitPosition, const std::string &Message);
+ // returns true (the error return value of Parse). Level is
+ // the severity of the error.
+ virtual bool ErrorAt(naclbitc::ErrorLevel Level, uint64_t BitPosition,
+ const std::string &Message);
+
+ bool ErrorAt(uint64_t BitPosition, const std::string &Message) {
+ return ErrorAt(naclbitc::Error, BitPosition, Message);
+ }
// Called when an error occurs. Message is the error to
// report. Always returns true (the error return value of Parse).
@@ -512,7 +518,10 @@ public:
// the error was found, and Message is the error to report. Does not
// return.
LLVM_ATTRIBUTE_NORETURN
- virtual void FatalAt(uint64_t BitPosition, const std::string &Message);
+ void FatalAt(uint64_t BitPosition, const std::string &Message) {
+ ErrorAt(naclbitc::Fatal, BitPosition, Message);
+ llvm_unreachable("Fatal errors should not return");
+ }
// Called when a fatal error occurs. Message is the error to
// report. Does not return.
« no previous file with comments | « no previous file | include/llvm/Bitcode/NaCl/NaClBitstreamReader.h » ('j') | include/llvm/Bitcode/NaCl/NaClBitstreamReader.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698