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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 10:48:47 PDT 2017


pcc added inline comments.


================
Comment at: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:359
+          Callback(Summary);
+    } else {
+      for (auto &Summaries : Index)
----------------
tejohnson wrote:
> 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.
An object without symbol definitions may be part of the link if it is specified directly on the command line (i.e. not in an archive). Such an object may be semantically significant if it contains module inline asm.

I made this NFC by changing the first if condition.


https://reviews.llvm.org/D32470





More information about the llvm-commits mailing list