[PATCH] D110280: [modules] Fix IRGen assertion on accessing ObjC ivar inside a method.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 22 13:30:10 PDT 2021


vsapsai added inline comments.


================
Comment at: clang/lib/AST/DeclObjC.cpp:81-84
   lookup_result R = lookup(Id);
   for (lookup_iterator Ivar = R.begin(), IvarEnd = R.end();
        Ivar != IvarEnd; ++Ivar) {
+    if (auto *ivar = dyn_cast<ObjCIvarDecl>((*Ivar)->getCanonicalDecl()))
----------------
Don't really know what are the common patterns for name lookup and if this approach is acceptable. For C we call `LookupResult::resolveKind` to deal with multiple decls (and to avoid ambiguous lookup errors) but that's not available for `lookup_result` (aka `DeclContextLookupResult`).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110280



More information about the cfe-commits mailing list