[PATCH] D100567: BPF: emit debuginfo for Function of DeclRefExpr if requested
David Blaikie via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 26 11:12:06 PDT 2021
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
More information about the cfe-commits
mailing list