[PATCH] D134057: [clang][Interp] Start implementing record types
Timm Bäder via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 21 10:39:28 PDT 2022
tbaeder marked an inline comment as done.
tbaeder added inline comments.
================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:642
+
+ for (const auto *Init : Ctor->inits()) {
+ const FieldDecl *Member = Init->getMember();
----------------
aaron.ballman wrote:
> Do we have to do anything special if the ctor is an inheriting ctor?
I have a feeling we do, but I'll tackle inheritance and virtual functions later.
================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:687
+ return true;
+ } else if (const CallExpr *CE = dyn_cast<CallExpr>(Initializer)) {
+ const Decl *Callee = CE->getCalleeDecl();
----------------
aaron.ballman wrote:
> `CXXMemberCallExpr` as well?
Yup, that's unhandled here right now it seems, I can add it to this patch or add it in a later one.
================
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:
> 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.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134057/new/
https://reviews.llvm.org/D134057
More information about the cfe-commits
mailing list