[PATCH] D61407: [MS] Change the metadata for heapallocsite calls when the function return type is cast.
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 2 11:13:16 PDT 2019
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.
lgtm, with a minor tweak
================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:2068
+ if (llvm::CallInst *CI = dyn_cast<llvm::CallInst>(Src))
+ if (CI->getMetadata("heapallocsite") && dyn_cast<ExplicitCastExpr>(CE))
+ CGF.getDebugInfo()->
----------------
It's more idiomatic to say `isa<ExplicitCastExpr>(CE)` than to use dyn_cast and test for nullness. The casting API actually has reasonably good documentation on it if you're curious:
http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61407/new/
https://reviews.llvm.org/D61407
More information about the llvm-commits
mailing list