[PATCH] D98884: [IR] Ignore bitcasts of function pointers which are only used as callees in callbase instruction
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 25 10:45:40 PDT 2021
arsenm added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/GlobalOpt.cpp:2167-2171
+ CallBase *CB = dyn_cast<CallBase>(U);
+ if (!CB) {
+ assert(false && "Expected CallBase");
+ return;
+ }
----------------
madhur13490 wrote:
> arsenm wrote:
> > Just use cast<>
> Are you suggesting to remove if (!CB) code block?
>
> If so, how would it work in release builds? If cast<> fails, in debug builds, the assert would fire but in release builds, the code will try to access the member function because we don't have "return" statement. Does failure on cast<> return?
cast<> asserts in a debug build. dyn_cast is when you are trying to handle the null case
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98884/new/
https://reviews.llvm.org/D98884
More information about the llvm-commits
mailing list