[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 08:49:56 PST 2016

tejohnson accepted this revision.
tejohnson added a comment.
This revision is now accepted and ready to land.

LGTM, other than a nit and one suggestion below.

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

Comment at: llvm/lib/Bitcode/Reader/MetadataLoader.h:67
+  /// Perse a `METADATA_ATTACHMENT` block for a function.
+  Error parseMetadataAttachment(
Nit: s/Perse/Parse/


More information about the llvm-commits mailing list