Consolidate duplicate isFloatVectorType predicates into TypeSemantics#35
Merged
Merged
Conversation
isFloatVectorType was defined three times (HIR.cpp HIRType overload, Intrinsics.cpp
string_view + HIRType overloads), each enumerating the float vector types
(vec2/vec3/vec4). Replace them with canonical crossgl::isFloatVectorType overloads
in TypeSemantics. Two file-local callers are made explicit (std::string_view{...})
since HIRType is implicitly constructible from a string. Continues #33/#34.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Round 3 of the type-predicate consolidation (#33, #34).
isFloatVectorTypewas defined three times with equivalent logic:HIR.cpp—isFloatVectorType(const HIRType&)(literalvec2/vec3/vec4, non-array)Intrinsics.cpp—isFloatVectorType(std::string_view)(computed:isVectorType && float-like scalar)Intrinsics.cpp—isFloatVectorType(const HIRType&)(delegates to the string_view form)They are replaced by canonical
crossgl::isFloatVectorTypeoverloads (std::string_view+const HIRType&) inTypeSemantics, the single source of truth for type classification.The two file-local string-argument callers are made explicit (
std::string_view{...}) to select the string_view overload, sinceHIRTypeis implicitly constructible from a string and both overloads are now visible together.Verification
Full suite green:
100% tests passed, 0 tests failed out of 2452.