[PATCH] D14825: [ThinLTO] Add MODULE_CODE_METADATA_VALUES record

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 15:28:57 PST 2015


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

LGTM (with one question)


================
Comment at: lib/Bitcode/Reader/BitcodeReader.cpp:1924
@@ -1916,1 +1923,3 @@
   unsigned NextMDValueNo = MDValueList.size();
+  if (ModuleLevel && SeenModuleValuesRecord) {
+    // Now that we are parsing the module level metadata, we want to restart
----------------
I got a typo in my question, I meant: is it possible to have `NextMDValueNo != 0` and *not* `SeenModuleValuesRecord`?

In the end my question is: do we need to check `SeenModuleValuesRecord` here? Is there a difference between this check and the following:

```
unsigned NextMDValueNo = ModuleLevel ? 0 : MDValueList.size();
```

(Not saying you should write it this way, but what about `if (ModuleLevel) {`)





http://reviews.llvm.org/D14825





More information about the llvm-commits mailing list