[PATCH] Refactor bitcode reader to simplify control.

Filipe Cabecinhas filcab+llvm.phabricator at gmail.com
Fri Jun 12 11:51:58 PDT 2015


Hi Karl,

Really sorry for the delay.
LGTM on my part, as long as you add the test for the error message and do the fix.

Thank you,

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 {
----------------
Nit: Put more words on the first line.

================
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) {
----------------
Nit: If it's for docs, it's probably best to start with an uppercase letter.

================
Comment at: lib/Bitcode/Reader/BitcodeReader.cpp:3229
@@ +3228,3 @@
+        // Give bit address where error is found, so that it can be
+        // easily repaired if is in an invalid test file.
+        std::string Buffer;
----------------
Thank you!

================
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);
----------------
errs()? Or StrBuf?
Please also add a test for this error message.

http://reviews.llvm.org/D8786

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






More information about the llvm-commits mailing list