Skip to content

Consolidate duplicate isFloatVectorType predicates into TypeSemantics#35

Merged
NripeshN merged 1 commit into
mainfrom
hir/consolidate-float-vector-predicate
Jun 21, 2026
Merged

Consolidate duplicate isFloatVectorType predicates into TypeSemantics#35
NripeshN merged 1 commit into
mainfrom
hir/consolidate-float-vector-predicate

Conversation

@NripeshN

Copy link
Copy Markdown
Member

Summary

Round 3 of the type-predicate consolidation (#33, #34). isFloatVectorType was defined three times with equivalent logic:

  • HIR.cppisFloatVectorType(const HIRType&) (literal vec2/vec3/vec4, non-array)
  • Intrinsics.cppisFloatVectorType(std::string_view) (computed: isVectorType && float-like scalar)
  • Intrinsics.cppisFloatVectorType(const HIRType&) (delegates to the string_view form)

They are replaced by canonical crossgl::isFloatVectorType overloads (std::string_view + const HIRType&) in TypeSemantics, 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, since HIRType is 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.

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.
@NripeshN NripeshN merged commit 50b4bf1 into main Jun 21, 2026
7 checks passed
@NripeshN NripeshN deleted the hir/consolidate-float-vector-predicate branch June 21, 2026 14:03
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