[PATCH] D14825: [ThinLTO] Add MODULE_CODE_METADATA_VALUES record

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 09:30:56 PST 2015


tejohnson marked 3 inline comments as done.
tejohnson added a comment.

Thanks, comments addressed and will upload new patch in a moment.


================
Comment at: lib/Bitcode/Reader/BitcodeReader.cpp:1922
@@ -1916,1 +1921,3 @@
   unsigned NextMDValueNo = MDValueList.size();
+  if (ModuleLevel && SeenModuleValuesRecord) {
+    // Now that we are parsing the module level metadata, we want to restart
----------------
joker.eph wrote:
> Is it possible to have `NextMDValueNo != 0` and `SeenModuleValuesRecord`? It there some redundancy here?
Yes when ModuleLevel=true because we always initialize the MDValueList size when we read the MODULE_CODE_METADATA_VALUES record (where we set SeenModuleValuesRecord). This reset ensures that we assign MD value numbers here properly for module level metadata.

================
Comment at: lib/Bitcode/Reader/BitcodeReader.cpp:3292
@@ -3269,3 +3291,3 @@
         break;
-      case bitc::METADATA_BLOCK_ID:
+      case bitc::METADATA_BLOCK_ID: {
         if (ShouldLazyLoadMetadata && !IsMetadataMaterialized) {
----------------
joker.eph wrote:
> This change does not seem necessary here
Removed. Leftover from prior approach.


http://reviews.llvm.org/D14825





More information about the llvm-commits mailing list