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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D75486: [SVE... Christopher Tetreault via Phabricator via cfe-commits
    • [PATCH] D75486:... Christopher Tetreault via Phabricator via cfe-commits
    • [PATCH] D75486:... Eli Friedman via Phabricator via cfe-commits

Reply via email to