[PATCH] D105658: [AttrBuilder] Make handling of type attributes more generic (NFCI)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 14:23:54 PDT 2021


nikic created this revision.
nikic added a reviewer: opaque-pointers.
Herald added subscribers: dexonsmith, jdoerfert, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

While working on the `elementtype` attribute, I felt that the type attribute handling in AttrBuilder is overly repetitive. This patch converts the separate `Type*` members into an `std::array<Type*>`, so that all type attribute kinds can be handled generically.

There's more room for improvement here (especially when it comes to converting the AttrBuilder to an Attribute), but this seems like a good starting point.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105658

Files:
  llvm/include/llvm/AsmParser/LLParser.h
  llvm/include/llvm/IR/Attributes.h
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/IR/Attributes.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105658.357360.patch
Type: text/x-patch
Size: 13345 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210708/55941feb/attachment.bin>


More information about the llvm-commits mailing list