dblaikie added a comment.

(ah, sorry, failed to submit comment)



================
Comment at: clang/lib/CodeGen/CGExpr.cpp:2843-2844
+      CGDebugInfo *DI = CGM.getModuleDebugInfo();
+      auto *Fn = dyn_cast<llvm::Function>(LV.getPointer(*this));
+      if (DI && Fn && !Fn->getSubprogram())
+        DI->EmitFunctionDecl(FD, FD->getLocation(), T, Fn);
----------------
It looks like there isn't any test coverage for the case where Fn is null here 
(I added an assertion that Fn is non-null and it didn't fire when running 
check-clang) - please add some to this patch. (I'd like to then look at those 
cases to better understand when they come up and whether there's a 
different/better way to phrase this code to handle those cases)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100567/new/

https://reviews.llvm.org/D100567

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to