[PATCH] D134057: [clang][Interp] Start implementing record types
Timm Bäder via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 26 21:40:06 PDT 2022
tbaeder marked 2 inline comments as done.
tbaeder added inline comments.
================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:689
+ const Decl *Callee = CE->getCalleeDecl();
+ const Function *Func = P.getFunction(dyn_cast<FunctionDecl>(Callee));
+
----------------
aaron.ballman wrote:
> tbaeder wrote:
> > aaron.ballman wrote:
> > > What if this comes back as `nullptr` (does `getFunction()` handle that gracefully)?
> > It does not :) I was relying on a crash somewhere when I have a test case for it.
> I'd rather use an explicit `assert` for that instead of relying on a crash; it's easier to spot the `assert` in that case.
I forgot I hadn't posted this to phab yet, but https://reviews.llvm.org/D134699 introduces a `getFunction` that asserts that the given `FunctionDecl` is not null.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134057/new/
https://reviews.llvm.org/D134057
More information about the cfe-commits
mailing list