mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-11 04:06:20 +00:00
![Alex Zinenko](/assets/img/avatar_default.png)
LLVM dialect type parsing and printing have been using a local stack object forwarded between recursive functions responsible for parsing or printing specific types. This stack is necessary to intercept (mutually) recursive structure types and avoid inifinite recursion. This approach works only thanks to the closedness of the LLVM dialect type system: types that don't belong to the dialect are not allowed. Switch the approach to using a `thread_local` stack inside the functions parsing the structure types. This makes the code slightly cleaner by avoiding the need to pass the stack object around and, more importantly, makes it possible to reconsider the closedness of the LLVM dialect type system. As a nice side effect of this change, container LLVM dialect types now support type aliases in their body (although it is currently impossible to also use the alises when printing). Depends On D93713 Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D93714