Skip to content

Commit 28abcbb

Browse files
committed
Refactor and Break Down TypeSerializer
This class is a perennial source of bugs when we add new type nodes because there is no signal when you forget to update it since it's just comparing record IDs in the switch. Break this class down and add new macros that enforce structural checks and require exhaustiveness at compile time. This TYPE_LAYOUT(...) macro replaces the usual \c BCRecordLayout coding structure by enforcing structural checks for the definition of deserialization members. If you forget to define a TYPE_LAYOUT(...) for a TYPE(...) there will be a gnarly SFINAE error pointing at it in DeclTypeRecordNodes.def. This macro pairs with \c DESERIALIZE_TYPE(...) in Deserialization.cpp such that if you forget \c DESERIALIZE_TYPE(...) you will come up with a linker error.
1 parent f387076 commit 28abcbb

File tree

3 files changed

+1020
-1019
lines changed

3 files changed

+1020
-1019
lines changed

0 commit comments

Comments
 (0)