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

Unified Diff: include/llvm/Bitcode/NaCl/NaClBitstreamReader.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 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/NaClBitcodeParser.h ('k') | include/llvm/Bitcode/NaCl/NaClObjDumpStream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/Bitcode/NaCl/NaClBitstreamReader.h
diff --git a/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h b/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h
index 4aa827d3d7c8716c5de71a57d03974b837af60ff..db6eb6080b730e283e70a16615ff0fa1497d0f81 100644
--- a/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h
+++ b/include/llvm/Bitcode/NaCl/NaClBitstreamReader.h
@@ -27,6 +27,26 @@ namespace llvm {
class Deserializer;
+namespace naclbitc {
+
+/// Returns the Bit as a Byte:BitInByte string.
+std::string getBitAddress(uint64_t Bit);
+
+/// Severity levels for reporting errors.
+enum ErrorLevel {
+ Warning,
+ Error,
+ Fatal
+};
+
+// Basic printing routine to generate the beginning of an error
+// message. BitPosition is the bit position the error was found.
+// Level is the severity of the error.
+raw_ostream &ErrorAt(raw_ostream &Out, ErrorLevel Level,
+ uint64_t BitPosition);
+
+} // End namespace naclbitc.
+
/// This class is used to read from a NaCl bitcode wire format stream,
/// maintaining information that is global to decoding the entire file.
/// While a file is being read, multiple cursors can be independently
@@ -88,11 +108,6 @@ public:
return InitialAddress;
}
- /// Returns the Bit as a Byte:BitInByte string. MinByteWidth is the
- /// minimum number of characters to print out the Byte value (blank
- /// fills).
- static std::string getBitAddress(uint64_t Bit, unsigned MinByteWidth=1);
-
//===--------------------------------------------------------------------===//
// Block Manipulation
//===--------------------------------------------------------------------===//
@@ -327,10 +342,8 @@ public:
}
/// Returns the current bit address (string) of the bit cursor.
- /// MinByteWidth is the minimum number of characters to print out
- /// the Byte value (blank fills).
- std::string getCurrentBitAddress(unsigned MinByteWidth=1) const {
- return BitStream->getBitAddress(GetCurrentBitNo(), MinByteWidth);
+ std::string getCurrentBitAddress() const {
+ return naclbitc::getBitAddress(GetCurrentBitNo());
}
/// Flags that modify the behavior of advance().
« no previous file with comments | « include/llvm/Bitcode/NaCl/NaClBitcodeParser.h ('k') | include/llvm/Bitcode/NaCl/NaClObjDumpStream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698