@@ -102,19 +102,25 @@ SLANG_FORCE_INLINE BasicTypeKey makeBasicTypeKey(
102
102
0 };
103
103
}
104
104
105
- inline BasicTypeKey makeBasicTypeKey (QualType typeIn, Expr* exprIn = nullptr )
105
+ inline BasicTypeKey makeBasicTypeKey (QualType typeIn)
106
106
{
107
107
if (auto basicType = as<BasicExpressionType>(typeIn))
108
108
{
109
109
auto rs = makeBasicTypeKey (basicType->getBaseType ());
110
- if (auto constInt = as<IntegerLiteralExpr>(exprIn))
110
+ rs.isLValue = typeIn.isLeftValue ? 1u : 0u ;
111
+ return rs;
112
+ }
113
+ else if (auto litType = as<IntLiteralType>(typeIn))
114
+ {
115
+ auto constInt = litType->getValue ();
116
+ auto baseType = as<BasicExpressionType>(constInt->getType ())->getBaseType ();
117
+ auto rs = makeBasicTypeKey (baseType);
118
+ if (constInt->getValue () < 0 &&
119
+ baseType != BaseType::UInt64 )
111
120
{
112
- if (constInt->value < 0 )
113
- {
114
- rs.knownNegative = 1 ;
115
- }
116
- rs.knownConstantBitCount = getIntValueBitSize (constInt->value );
121
+ rs.knownNegative = 1 ;
117
122
}
123
+ rs.knownConstantBitCount = getIntValueBitSize (constInt->getValue ());
118
124
rs.isLValue = typeIn.isLeftValue ? 1u : 0u ;
119
125
return rs;
120
126
}
@@ -195,7 +201,7 @@ struct OperatorOverloadCacheKey
195
201
196
202
for (Index i = 0 ; i < opExpr->arguments .getCount (); i++)
197
203
{
198
- auto key = makeBasicTypeKey (opExpr->arguments [i]->type , opExpr-> arguments [i] );
204
+ auto key = makeBasicTypeKey (opExpr->arguments [i]->type );
199
205
if (key.getRaw () == BasicTypeKey::invalid ().getRaw ())
200
206
{
201
207
return false ;
0 commit comments