Skip to content

Give the vtable SmallVectors an explicit inline size (Debug build C2338) - #713

Merged
ASDAlexander77 merged 1 commit into
mainfrom
fix-debug-smallvector-inline-size
Oct 28, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
fix-debug-smallvector-inline-size

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

The MSVC Debug build of MLIRTypeScript failed with SmallVector.h(1171): error C2338: ... sizeof(T) is really big!. Release and CI build fine.

MethodInfo holds three std::strings and two std::vectors. The MSVC Debug STL makes each of them 8 bytes bigger, so VirtualMethodOrFieldInfo and VirtualMethodOrInterfaceVTableInfo go past the 256-byte limit SmallVector<T> sets for a defaulted inline size, but only in Debug.

  • Every SmallVector of those two types now says , 1. That is what the default already came to for types this size, so Release is unchanged.
  • SmallVector<std::pair<mlir::Attribute, MethodInfo>> is exactly 256 bytes in Debug, so it gets , 1 too.
  • Dropped the comments in MethodInfo about keeping under that limit. They no longer apply.

Verified: the Debug build of MLIRTypeScript.vcxproj now succeeds.

🤖 Generated with Claude Code

MethodInfo holds three std::strings and two std::vectors, which MSVC's Debug
STL makes 8 bytes bigger each: VirtualMethodOrFieldInfo and
VirtualMethodOrInterfaceVTableInfo go past SmallVector<T>'s 256-byte limit
for a defaulted inline size, so the Debug build fails (C2338) while Release
and CI build. An explicit N of 1 is what the default came to for these
types, so nothing changes in Release; pair<Attribute, MethodInfo>, exactly
256 bytes in Debug, gets one too. MethodInfo's comments about keeping under
that limit no longer apply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit c325430 into main Oct 28, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the fix-debug-smallvector-inline-size branch October 28, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant