[PATCH] D124285: [clang][NFC] In parts of Objective-C Sema use Obj-C-specific types instead of `Decl`.

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 26 04:39:20 PDT 2022


jansvoboda11 accepted this revision.
jansvoboda11 added a comment.
This revision is now accepted and ready to land.

LGTM with two minor questions.



================
Comment at: clang/include/clang/Sema/Sema.h:3300
 
-  Decl *ActOnObjCContainerStartDefinition(Decl *IDecl);
+  void ActOnObjCContainerStartDefinition(ObjCContainerDecl *IDecl);
 
----------------
Why the change in return type?


================
Comment at: clang/lib/Sema/SemaDecl.cpp:17067
+void Sema::ActOnObjCTemporaryExitContainerContext(ObjCContainerDecl *ObjCCtx) {
+  auto DC = cast<DeclContext>(ObjCCtx);
   assert(DC == CurContext && "Mismatch of container contexts");
----------------
Why the cast? We should be able to compare/assign `ObjCContainerDecl *` to `DeclContext *`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124285/new/

https://reviews.llvm.org/D124285



More information about the cfe-commits mailing list