[PATCH] D35334: ThinLTO Minimized Bitcode File Size Reduction

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 11:52:21 PDT 2017


pcc added inline comments.


================
Comment at: lib/Bitcode/Writer/BitcodeWriter.cpp:114
   /// If non-null, when GenerateHash is true, the resulting hash is written
   /// into ModHash. When GenerateHash is false, that specified value
   /// is used as the hash instead of computing from the generated bitcode.
----------------
This comment doesn't really make sense anymore in the context of the base class. I'd replace the ModHash field in this class with a ModHash field in both derived classes with their own comments, since they really serve different purposes in each class.


================
Comment at: lib/Bitcode/Writer/BitcodeWriter.cpp:4021
+  void writeModuleHash() {
+    Stream.EmitRecord(bitc::MODULE_CODE_HASH, ArrayRef<uint32_t>(*ModHash));
+  }
----------------
Inline into caller.


================
Comment at: lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:380
   // If a minimized bitcode module was requested for the thin link,
   // strip the debug info (the merged module was already stripped above)
   // and write it to the given OS.
----------------
Update comment


================
Comment at: lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:423
   // If a minimized bitcode module was requested for the thin link,
   // strip the debug info and write it to the given OS.
+  if (ThinLinkOS && Index)
----------------
Update comment


================
Comment at: test/Transforms/ThinLTOBitcodeWriter/no-type-md.ll:38
 
 ; CHECK: !llvm.dbg.cu
 !llvm.dbg.cu = !{}
----------------
You can remove everything from this line onwards I think.


================
Comment at: test/Transforms/ThinLTOBitcodeWriter/split.ll:46
 
 ; M0: !llvm.dbg.cu
 ; M1-NOT: !llvm.dbg.cu
----------------
Likewise.


https://reviews.llvm.org/D35334





More information about the llvm-commits mailing list