File tree 1 file changed +4
-12
lines changed
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -2040,21 +2040,13 @@ namespace Slang
2040
2040
}
2041
2041
}
2042
2042
2043
- std::optional<TypeTag> varTypeTags;
2044
- auto getVarTypeTags = [&]()
2045
- {
2046
- if (!varTypeTags.has_value())
2047
- {
2048
- varTypeTags = getTypeTags(varDecl->getType());
2049
- }
2050
- return varTypeTags.value();
2051
- };
2043
+ TypeTag varTypeTags = getTypeTags(varDecl->getType());
2052
2044
auto parentDecl = as<AggTypeDecl>(getParentDecl(varDecl));
2053
2045
if (parentDecl)
2054
2046
{
2055
- parentDecl->addTag(getVarTypeTags() );
2047
+ parentDecl->addTag(varTypeTags );
2056
2048
auto unsizedMask = (int)TypeTag::Unsized;
2057
- bool isUnknownSize = (((int)getVarTypeTags() & unsizedMask) != 0);
2049
+ bool isUnknownSize = (((int)varTypeTags & unsizedMask) != 0);
2058
2050
if (isUnknownSize)
2059
2051
{
2060
2052
// Unsized decl must appear as the last member of the struct.
@@ -2079,7 +2071,7 @@ namespace Slang
2079
2071
(!parentDecl || isEffectivelyStatic(varDecl));
2080
2072
if (isGlobalOrLocalVar)
2081
2073
{
2082
- bool isUnsized = (((int)getVarTypeTags() & (int)TypeTag::Unsized) != 0);
2074
+ bool isUnsized = (((int)varTypeTags & (int)TypeTag::Unsized) != 0);
2083
2075
if (isUnsized)
2084
2076
{
2085
2077
getSink()->diagnose(varDecl, Diagnostics::varCannotBeUnsized);
You can’t perform that action at this time.
0 commit comments