[PATCH] D32470: Bitcode: Simplify how we enumerate summaries in the index. NFCI.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 07:42:46 PDT 2017


tejohnson added a comment.

Nice cleanup! One question below.



================
Comment at: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:359
+          Callback(Summary);
+    } else {
+      for (auto &Summaries : Index)
----------------
To be NFC this should be "else if !ModuleToSummariesForIndex" (see the constructor of the old iterator), to handle empty partial indexes the same as before. I guess this could happen for a module with no global defs, otherwise there should be at least one summary from the module whose index is being written even if it doesn't import anything,  although I would think that the linker would not select it for inclusion. If we think this case shouldn't happen, then change the earlier if to not check for an empty ModuleToSummariesForIndex and make it an assert instead.


https://reviews.llvm.org/D32470





More information about the llvm-commits mailing list