[PATCH] D100567: BPF: emit debuginfo for Function of DeclRefExpr if requested
Yonghong Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 26 12:06:48 PDT 2021
yonghong-song added inline comments.
================
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);
----------------
dblaikie wrote:
> 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)
Sorry. It is my fault. Tested with a slight different test case than this one in my actual test setup. Now the new test should reflect null Fn. Thanks!
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