[PATCH] Refactor bitcode reader to simplify control.

Karl Schimpf kschimpf at google.com
Mon Jun 15 09:17:23 PDT 2015


Fixed issues raised by Filipe.


================
Comment at: lib/Bitcode/Reader/BitcodeReader.cpp:772
@@ -717,2 +771,3 @@
+  /// A class for maintaining the slot number definition
   /// as a placeholder for the actual definition for forward constants defs.
   class ConstantPlaceHolder : public ConstantExpr {
----------------
filcab wrote:
> Nit: Put more words on the first line.
Done.

================
Comment at: lib/Bitcode/Reader/BitcodeReader.cpp:776
@@ -720,3 +775,3 @@
   public:
-    // allocate space for exactly one operand
+    /// allocate space for exactly one operand
     void *operator new(size_t s) {
----------------
filcab wrote:
> Nit: If it's for docs, it's probably best to start with an uppercase letter.
Done.

================
Comment at: lib/Bitcode/Reader/BitcodeReader.cpp:3233
@@ +3232,3 @@
+        uint64_t Bit = Stream.GetCurrentBitNo();
+        errs() << "Malformed IR file at bit " << format("%x", (Bit / CHAR_BIT))
+               << ":" << (Bit % CHAR_BIT);
----------------
filcab wrote:
> errs()? Or StrBuf?
> Please also add a test for this error message.
Good catch. I meant StrBuf, so that we can use the same API for all errors.

http://reviews.llvm.org/D8786

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list