-
Notifications
You must be signed in to change notification settings - Fork 807
Commit de1c363
[SYCL] SemaSYCL significant refactoring (#1517)
The integration header and OpenCL generation code has evolved over time to become convoluted and difficult to maintain. It doesn't properly handle the recursive nature of types in many cases as it seems to do so on a mostly ad-hoc basis. It also has a fairly sizable use of recursive lambdas that are both difficult to read and painful to modify. The variety of checks and processings are unfortunately mixed to the point where it is difficult to follow the path through the code.
This patch replaces the existing implementation with a series of visitor types and infrastructure with which to properly iterate and recurse through the kernel lambda objects. It also better splits up the responsibilities through the visitor types, with a separate one for type checking, kernel declaration generation, kernel body generation, and integration header generation. These types have minimal interaction between them.
The visitor pattern also vastly simplifies how each type is handled, since each type has its own handling function, it is only required for an implementer of the visitor to handle one type at a time.
Overall, we hope that this will result in a significantly easier to maintain, modify, and review infrastructure for this functionality.
Signed-off-by: Mariya Podchishchaeva <[email protected]>
Co-authored-by: Erich Keane <[email protected]>1 parent 5666107 commit de1c363Copy full SHA for de1c363
File tree
Expand file treeCollapse file tree
2 files changed
+805
-603
lines changedFilter options
- clang
- lib/Sema
- test/CodeGenSYCL
Expand file treeCollapse file tree
2 files changed
+805
-603
lines changed
0 commit comments