[PATCH] D75486: [SVE] Make CompositeType not inherit from Type

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 3 15:33:38 PST 2020


efriedma added a comment.

It's possible to mess with the way "cast<>" actually casts values by specializing the function template in question.  That, plus an appropriate classof implementations, should allow you to avoid the whole CompositeType::get thing.  See, for example, https://github.com/llvm/llvm-project/blob/8cf76e913b867a98a9843aa1b3d782632ed5d930/clang/include/clang/AST/DeclBase.h#L2490 .

That said, both CompositeType and SequentialType are pretty useless.  CompositeType especially: really, code dealing with it wants to answer one of two question: "is it legal to GEP index into this type", or "is it legal to extractvalue index into this type".  I tried to quickly throw together a patch to get rid of CompositeType, and it was roughly 100 lines changed.  I'll post something soon.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75486





More information about the cfe-commits mailing list