[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
Tue Sep 28 20:08:05 PDT 2021


vsapsai updated this revision to Diff 375771.
vsapsai added a comment.

Rebase and add a test case with `always_inline`.

Interaction between `always_inline` function and `testAccessBitField` has
revealed that we cannot avoid having expressions referencing decls from "wrong"
module. So returning a canonical ivar in name lookup is not sufficient. Mimic
`CGRecordLayout` approach and use canonical ivar in
`ASTContext::lookupFieldBitOffset`, where we look up concrete layout data.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110280

Files:
  clang/include/clang/AST/DeclObjC.h
  clang/lib/AST/RecordLayoutBuilder.cpp
  clang/lib/Serialization/ASTReaderDecl.cpp
  clang/test/Modules/merge-objc-interface.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110280.375771.patch
Type: text/x-patch
Size: 4794 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210929/a7f935d5/attachment-0001.bin>


More information about the cfe-commits mailing list