[PATCH] D16440: [ThinLTO] Link in only necessary DICompileUnit operands

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 09:07:46 PST 2016


tejohnson added inline comments.

================
Comment at: lib/Linker/IRMover.cpp:1374
@@ +1373,3 @@
+                    &GValMaterializer);
+    std::vector<DICompositeType *> RetainWorklist;
+    if (!IsMetadataLinkingPostpass) {
----------------
ahatanak wrote:
> While I was building a project using thin-LTO, I found out that the call to MapMetadata here causes an assert if CU-getSubprograms().get() returns null (the assert is triggered in MapMetadataImpl when isa<MDString> is called on a null ptr). Should we check whether CU->getSubprograms() is empty before calling the function? Mehdi also suggested that we can do the check inside MapMetadaImpl and have it return null if the first argument is null. That might be better if there are other call sites that passes a null pointer as the first argument.
Yes, either of those sound like they would fix this. I am traveling all week and won't be able to make any changes until early next week. Will see if I can make the change in MapMetadataImpl then, otherwise here.


http://reviews.llvm.org/D16440





More information about the llvm-commits mailing list