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

Unified Diff: lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp

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 comment. 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
« no previous file with comments | « lib/Bitcode/NaCl/Analysis/NaClCompress.cpp ('k') | lib/Bitcode/NaCl/Analysis/NaClObjDumpStream.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp
diff --git a/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp b/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp
index d57caa9566ed92bddef4914df7eede2afebd7ff8..d56ee291ce38dda781633e76fc05ccd052f56f64 100644
--- a/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp
+++ b/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp
@@ -589,25 +589,14 @@ public:
}
/// Generates an error with the given message.
- bool ErrorAt(uint64_t Bit, const std::string &Message) final {
- // Use local error routine so that all errors are treated uniformly.
- ObjDump.Error(Bit) << Message << "\n";
+ bool ErrorAt(naclbitc::ErrorLevel Level, uint64_t Bit,
+ const std::string &Message) final {
+ ObjDump.ErrorAt(Level, Bit) << Message << "\n";
+ if (Level == naclbitc::Fatal)
+ ObjDump.FlushThenQuit();
return true;
}
- /// Flushes out objdump and then exits with fatal error.
- LLVM_ATTRIBUTE_NORETURN
- void Fatal() {
- NaClBitcodeParser::Fatal();
- }
-
- /// Flushes out objdump and then exits with fatal error, using
- /// the given message.
- LLVM_ATTRIBUTE_NORETURN
- void FatalAt(uint64_t Bit, const std::string &Message) final {
- ObjDump.Fatal(Bit, Message);
- }
-
/// Parses the top-level module block.
bool ParseBlock(unsigned BlockID) override;
@@ -1365,12 +1354,9 @@ protected:
return Context->Warnings();
}
- void Fatal() {
- return Context->Fatal();
- }
-
- void FatalAt(uint64_t Bit, const std::string &Message) override {
- return Context->FatalAt(Bit, Message);
+ bool ErrorAt(naclbitc::ErrorLevel Level, uint64_t Bit,
+ const std::string &Message) final {
+ return Context->ErrorAt(Level, Bit, Message);
}
const std::string &GetAssemblyIndent() const {
« no previous file with comments | « lib/Bitcode/NaCl/Analysis/NaClCompress.cpp ('k') | lib/Bitcode/NaCl/Analysis/NaClObjDumpStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698