aprantl added a comment.

I'm afraid I'm going to give up on fixing the AST and return to my 
debuginfo-only patch.

While I was correct in figuring out that ObjCMethodDecl implementations are not 
linked up as redeclarations of ObjCMethodDecl decls in the interface, that 
wasn't the whole story: `ObjCMethodDecl::getNextRedeclarationImpl()` links them 
up *implicitly* by finding the implementation for a decl and vice versa by 
looking up the selector in the interface/implementation (See 
https://github.com/llvm/llvm-project/blob/244e738485445fa4b72bfef9b9b2f9625cee989e/clang/lib/AST/DeclObjC.cpp#L905).

I can make this mechanism work by adding the method to the 
ObjCImplementationDecl, so it gets found by getNextRedeclarationImpl(). But if 
I do that, CodeGen falls over completely, because the new property accessor 
redeclarations don't actually have any function bodies. CodeGen in several 
places special-cases property accessors to generate them on-the-fly. I think 
this may work neatly if we actually created an AST for the function body in 
SemaObjCProperty too, and remove the functionality from CodeGen, but that is 
beyond what I'm prepared to do.


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

https://reviews.llvm.org/D66121



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to