[cDAC] Add data descriptor field type annotations#126163
[cDAC] Add data descriptor field type annotations#126163max-charlamb wants to merge 3 commits intomainfrom
Conversation
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
This comment has been minimized.
This comment has been minimized.
Remove documentation for CDAC_DATADESCRIPTOR_INC override mechanism that was never implemented in wrappeddatadescriptor.inc. The include always uses 'datadescriptor.inc' resolved via build-configured include directories. Fix comment typo in datadescriptor.cpp: T(GCHandle) -> TYPE(GCHandle). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🤖 Copilot Code Review — PR #126163Note This review was generated by Copilot using Claude Opus 4.6. GPT-5.4 was launched as a parallel reviewer but did not complete within the 10-minute timeout. Holistic AssessmentMotivation: The PR addresses a real deficiency — field type annotations in Approach: The approach is well-designed and idiomatic for this codebase's preprocessor-heavy data descriptor infrastructure. The Summary: ✅ LGTM. The core type annotation system and validation logic are correct and well-structured. The prior review's two issues (undocumented Detailed Findings✅ Preprocessor Macro System — Correct Across All ConfigurationsVerified the full macro expansion chain in both debug and release builds:
The String pool size calculations ( ✅ Compile-Time Validation — Sound DesignThe two-pass approach in
Verified that no Verified all ✅ MSVC String Literal Splitting — CorrectThe chunking logic in
✅ Mechanical Conversion — Complete and ConsistentVerified that all 579 ✅ Prior Review Issues — FixedThe two issues flagged by the prior Copilot review have been addressed in commit
💡 Release Blob Behavioral Nuance — InformationalA few fields in the old code used bare (non-comment) type names (e.g., This is harmless — the managed reader's This is not blocking — just worth noting for awareness. ✅ Documentation — Comprehensive and AccurateThe README updates accurately describe the new type annotation system, including the macro reference table, compile-time validation mechanism, and examples. The
|
Summary
Add a type system to the cDAC data descriptor infrastructure. Field types in
CDAC_TYPE_FIELDthat were previously specified as C comments (/*uint32*/) are now expressed as preprocessor defines (T_UINT32,T_POINTER,TYPE(GCHandle), etc.).Changes
Native-side type defines (
wrappeddatadescriptor.inc):T_UINT8,T_UINT16,T_UINT32,T_UINT64,T_INT8...T_INT64,T_NUINT,T_NINT,T_POINTER,T_BOOLTYPE(name)for types declared withCDAC_TYPE_BEGINin the same descriptorEXTERN_TYPE(name)(not validated locally)T_ARRAY(type)(expands topointerin the blob)Compile-time validation (
cdactypevalidation.inc):TYPE(name)reference matches aCDAC_TYPE_BEGINdeclaration viastatic_assert.MSVC string literal splitting (
ContractDescriptorSourceFileEmitter.cs):Descriptor updates
datadescriptor.inc: All ~200 fields and ~50 globals converted to type definesdatadescriptor.inc: All fields and globals converted, withEXTERN_TYPE(GCAllocContext)for the one cross-descriptor referenceNote
This content was generated with the assistance of GitHub Copilot.