[PATCH] D104883: [CodeGen] Add ParmVarDecls to FunctionDecls that are created to generate ObjC property getter/setter functions
Akira Hatanaka via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 25 16:15:36 PDT 2021
ahatanak added a comment.
I see `assert(DC && "This decl is not contained in a translation unit!");` fail in `Decl::getTranslationUnitDecl` when `DeclRefExpr` is constructed. That's because the `ImplicitParamDecl` passed to `DeclRefExpr`'s constructor doesn't have a decl context if I delete `FD`. So it looks like `FD` is needed in these cases.
================
Comment at: clang/lib/CodeGen/CGObjC.cpp:3702
+ /*DefArg=*/nullptr);
+ args.push_back(Params[0] = DstDecl);
+ ParmVarDecl *SrcDecl = ParmVarDecl::Create(
----------------
aprantl wrote:
> Does this compile without warnings?
Yes, clang compiles this without any warnings. I don't know whether other compilers warn.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104883/new/
https://reviews.llvm.org/D104883
More information about the cfe-commits
mailing list