[PATCH] D96416: [TableGen] Improve algorithms for processing template arguments; add type checking
Paul C. Anagnostopoulos via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 10 07:04:34 PST 2021
Paul-C-Anagnostopoulos created this revision.
Paul-C-Anagnostopoulos added reviewers: lattner, RKSimon, craig.topper, simoll, arsenm, foad, pengfei.
Herald added a subscriber: hiraditya.
Paul-C-Anagnostopoulos requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
The initial goal of this revision was to improve the algorithms for resolving the template arguments of classes and multiclasses. However, along the way I discovered that the type checking of template arguments was inconsistent.
- Template argument values passed to inherited classes were type-checked and cast if necessary.
- Template argument values to anonymous class instantiations were type-checked but not cast.
- Template argument values to multiclasses were not type-checked at all.
Adding type checking for multiclasses revealed many invalid template argument values. These have been corrected in the various target TableGen files. See https://reviews.llvm.org/D95874.
So this revision improves the algorithms and type-checks/casts all template arguments.
While this revision is being reviewed, I will add a large test for all the template argument checking.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D96416
Files:
llvm/include/llvm/TableGen/Record.h
llvm/lib/TableGen/Record.cpp
llvm/lib/TableGen/TGParser.cpp
llvm/lib/TableGen/TGParser.h
llvm/test/TableGen/self-reference-typeerror.td
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96416.322674.patch
Type: text/x-patch
Size: 22286 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210210/3a0d16f0/attachment.bin>
More information about the llvm-commits
mailing list