AST: Add GenericTypeParamType::getWeight()

This is currently always 0, but can be set to 1.
This commit is contained in:
Slava Pestov
2025-04-29 12:36:37 -04:00
parent 115ba5c54f
commit e1fc29193d
7 changed files with 68 additions and 29 deletions

View File

@@ -7621,12 +7621,13 @@ DESERIALIZE_TYPE(GENERIC_TYPE_PARAM_TYPE)(
unsigned rawParamKind;
bool hasDecl;
unsigned depth;
unsigned weight;
unsigned index;
DeclID declOrIdentifier;
TypeID valueTypeID;
decls_block::GenericTypeParamTypeLayout::readRecord(
scratch, rawParamKind, hasDecl, depth, index, declOrIdentifier,
scratch, rawParamKind, hasDecl, depth, weight, index, declOrIdentifier,
valueTypeID);
auto paramKind = getActualParamKind(rawParamKind);
@@ -7655,10 +7656,11 @@ DESERIALIZE_TYPE(GENERIC_TYPE_PARAM_TYPE)(
return valueType.takeError();
if (declOrIdentifier == 0) {
return GenericTypeParamType::get(*paramKind, depth, index, *valueType,
return GenericTypeParamType::get(*paramKind, depth, index, weight, *valueType,
MF.getContext());
}
ASSERT(weight == 0);
auto name = MF.getDeclBaseName(declOrIdentifier).getIdentifier();
return GenericTypeParamType::get(name, *paramKind, depth, index, *valueType,
MF.getContext());