mizvekov wrote: > The only thing that "leaf type" means is that there's no point in doing > anything except `dyn_cast`ing the canonical type. It's not a real language > concept, and we don't use the type property for any purpose except these > `getAs` specializations. So if the specializations are wrong for some types, > either we should rip the concept out, or those types shouldn't be leaf types. > In particular, I suspect that RecordType should no longer be a leaf type > because of your changes to the representation of elaborated types.
Yeah, even though TagTypes are no longer a leaf type, I think leaf type is the wrong concept for this optimization. For example, TemplateTypeParmTypes were not changed recently, but the optimization was still wrong for them. You can see the patch fixes one bug in the ExtractAPI code, which used getAs on it but still expected the type to have a declaration. > > > The size of this PR is completely freaking Safari out. Can you make a PR that > just adds `getAsRecordDecl()` and changes a bunch of call sites to use it? > That would work perfectly as a standalone patch, and I assume that's like > half the lines in this PR. Yeah, I noticed. You can try clicking on the commit list and selecting the "meat and potatoes" commit, should be fairly small. If that doesn't work, I can split the PR tomorrow. https://github.com/llvm/llvm-project/pull/155028 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits