When building in debug mode, clang uses constructor type homing as an
optimization for debug info size. This means the debug info for types is
emitted at the same time as the constructor definition.
Some `*Descriptor` types in this file only have an inline constructor which is
never called (by design). Instead of properly constructing these objects, it
looks like memory is allocated elsewhere and then cast to the needed type. This
causes the compiler to never emit neither the inline constructor definition nor
the debug info for these types, which harms the debugger experience (it is also
technically undefined behavior).
This change moves their definitions out of line to the .cc file. This doesn't
solve the UB but it makes the compiler emit the definitions for the
constructors somewhere, and thus the debug info too.
PiperOrigin-RevId: 533579527
pull/12863/head
Jorge Gorbe Moya2 years agocommitted byCopybara-Service