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

Unified Diff: lib/Bitcode/NaCl/Analysis/NaClBitcodeAnalyzer.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 | « include/llvm/Bitcode/NaCl/NaClObjDumpStream.h ('k') | lib/Bitcode/NaCl/Analysis/NaClCompress.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Bitcode/NaCl/Analysis/NaClBitcodeAnalyzer.cpp
diff --git a/lib/Bitcode/NaCl/Analysis/NaClBitcodeAnalyzer.cpp b/lib/Bitcode/NaCl/Analysis/NaClBitcodeAnalyzer.cpp
index 09c507822a4374a8fb97f4fc899b3d277fda8b69..3caab42e06d3067c258825071119ab50a6c9da48 100644
--- a/lib/Bitcode/NaCl/Analysis/NaClBitcodeAnalyzer.cpp
+++ b/lib/Bitcode/NaCl/Analysis/NaClBitcodeAnalyzer.cpp
@@ -30,13 +30,17 @@
// dumping records, and one for collecting distribution stats for
// printing. This should simplify the code.
-/// Error - All bitcode analysis errors go through this function, making this a
-/// good place to breakpoint if debugging.
-static bool Error(const llvm::Twine &Err) {
+namespace {
+
+// Generates an error message when outside parsing, and no
+// corresponding bit position is known.
+bool Error(const llvm::Twine &Err) {
llvm::errs() << Err << "\n";
return true;
}
+} // End of anonymous namespace.
+
namespace llvm {
// Parses all bitcode blocks, and collects distribution of records in
@@ -60,11 +64,6 @@ public:
virtual ~PNaClBitcodeAnalyzerParser() {}
- virtual bool Error(const std::string &Message) {
- // Use local error routine so that all errors are treated uniformly.
- return ::Error(Message);
- }
-
virtual bool ParseBlock(unsigned BlockID);
// Returns the string defining the indentation to use with respect
@@ -247,11 +246,6 @@ protected:
Indent = Context->GetIndentation();
}
- virtual bool Error(const std::string &Message) {
- // Use local error routine so that all errors are treated uniformly.
- return ::Error(Message);
- }
-
// Called once the block has been entered by the bitstream reader.
// Argument NumWords is set to the number of words in the
// corresponding block.
« no previous file with comments | « include/llvm/Bitcode/NaCl/NaClObjDumpStream.h ('k') | lib/Bitcode/NaCl/Analysis/NaClCompress.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698