Instead of defining a custom iterator class, just use a function with a
callback, which is much easier to understand and less error prone.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Nice cleanup! One question below.
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | ||
---|---|---|
359 ↗ | (On Diff #96499) | 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. |
- Address review comment
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | ||
---|---|---|
359 ↗ | (On Diff #96499) | 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. |