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

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 09:07:22 PST 2016

tejohnson added inline comments.

Comment at: llvm/lib/Bitcode/Reader/BitcodeReader.cpp:3076
   TheModule = M;
+  MDLoader = MetadataLoader(Stream, *M, ValueList,
+                            [&](unsigned ID) { return getTypeByID(ID); });
mehdi_amini wrote:
> 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.
Oh, of course, that makes sense.


More information about the llvm-commits mailing list