From 4eb7a27ac4532a49b9d383d2b0d80bc0ec317b4c Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 19 Mar 2025 11:44:04 -0700 Subject: Fix reinterpret and bitcast and generic arg parsing. (#6627) * Fix reinterpret and bitcast. * Fix warning. * Fix. * Fix. --------- Co-authored-by: Ellie Hermaszewska --- source/slang/slang-ir-lower-reinterpret.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'source/slang/slang-ir-lower-reinterpret.cpp') diff --git a/source/slang/slang-ir-lower-reinterpret.cpp b/source/slang/slang-ir-lower-reinterpret.cpp index 88c288f28..6624b5f1a 100644 --- a/source/slang/slang-ir-lower-reinterpret.cpp +++ b/source/slang/slang-ir-lower-reinterpret.cpp @@ -61,10 +61,8 @@ struct ReinterpretLoweringContext auto fromType = operand->getDataType(); auto toType = inst->getDataType(); SlangInt fromTypeSize = getAnyValueSize(fromType); - bool cantPack = false; if (fromTypeSize < 0) { - cantPack = true; sink->diagnose( inst->sourceLoc, Slang::Diagnostics::typeCannotBePackedIntoAnyValue, @@ -73,22 +71,11 @@ struct ReinterpretLoweringContext SlangInt toTypeSize = getAnyValueSize(toType); if (toTypeSize < 0) { - cantPack = true; sink->diagnose( inst->sourceLoc, Slang::Diagnostics::typeCannotBePackedIntoAnyValue, toType); } - if (fromTypeSize != toTypeSize && !cantPack && !as(fromType)) - { - sink->diagnose( - inst->sourceLoc, - Slang::Diagnostics::notEqualReinterpretCastSize, - fromType, - fromTypeSize, - toType, - toTypeSize); - } SlangInt anyValueSize = Math::Max(fromTypeSize, toTypeSize); IRBuilder builder(module); -- cgit v1.2.3