[PATCH] D27646: Refactor BitcodeReader: move Metadata and ValueId handling in their own class/file

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 09:05:48 PST 2016


mehdi_amini added inline comments.


================
Comment at: llvm/lib/Bitcode/Reader/BitcodeReader.cpp:3076
   TheModule = M;
+  MDLoader = MetadataLoader(Stream, *M, ValueList,
+                            [&](unsigned ID) { return getTypeByID(ID); });
----------------
tejohnson wrote:
> Why not create this within the BitcodeReader constructor instead? AFAICT we only ever invoke this right after we construct a BitcodeReader anyway (from within BitcodeModule::getModuleImpl).
The `MetadataLoader` needs a `Module`, which we only have here.


https://reviews.llvm.org/D27646





More information about the llvm-commits mailing list