Skip to content

Commit

Permalink
[draft]: experiment change needs to run CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhangNV committed Oct 4, 2024
1 parent 82c05f4 commit d21db8e
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions source/slang/slang-check-decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8476,7 +8476,7 @@ namespace Slang
{
getSink()->diagnose(aggTypeDecl->loc, Diagnostics::cannotExportIncompleteType, aggTypeDecl);
}

auto structDecl = as<StructDecl>(aggTypeDecl);
if (!structDecl)
return;
Expand Down Expand Up @@ -8530,8 +8530,8 @@ namespace Slang
for (auto ctor : structDeclInfo.ctorList)
{
auto seqStmt = _ensureCtorBodyIsSeqStmt(m_astBuilder, ctor);
auto seqStmtChild = m_astBuilder->create<SeqStmt>();
seqStmtChild->stmts.reserve(inheritanceDefaultCtorList.getCount());
auto seqStmtChildForBase = m_astBuilder->create<SeqStmt>();
seqStmtChildForBase->stmts.reserve(inheritanceDefaultCtorList.getCount());
for (auto& declInfo : inheritanceDefaultCtorList)
{
if (!declInfo.defaultCtor)
Expand All @@ -8557,25 +8557,26 @@ namespace Slang
stmt->expression = assign;
stmt->loc = ctor->loc;

seqStmtChild->stmts.add(stmt);
seqStmtChildForBase->stmts.add(stmt);
}

if (seqStmtChild->stmts.getCount() == 0)
if (seqStmtChildForBase->stmts.getCount() != 0)
{
seqStmt->stmts.insert(0, seqStmtChildForBase);
insertOffset = 1;
continue;

seqStmt->stmts.insert(0, seqStmtChild);
insertOffset = 1;
}

for (auto ctor : structDeclInfo.ctorList)
{
}
// }
//
// for (auto ctor : structDeclInfo.ctorList)
// {
ThisExpr* thisExpr = m_astBuilder->create<ThisExpr>();
thisExpr->scope = ctor->ownedScope;
thisExpr->type = ctor->returnType.type;

auto seqStmt = _ensureCtorBodyIsSeqStmt(m_astBuilder, ctor);
auto seqStmtChild = m_astBuilder->create<SeqStmt>();
seqStmtChild->stmts.reserve(structDecl->members.getCount());
// auto seqStmt = _ensureCtorBodyIsSeqStmt(m_astBuilder, ctor);
auto seqStmtChildForMember = m_astBuilder->create<SeqStmt>();
seqStmtChildForMember->stmts.reserve(structDecl->members.getCount());
for (auto& m : structDecl->members)
{
auto varDeclBase = as<VarDeclBase>(m);
Expand Down Expand Up @@ -8614,11 +8615,11 @@ namespace Slang
if (!checkedMemberVarExpr->type.isLeftValue)
continue;

seqStmtChild->stmts.add(stmt);
seqStmtChildForMember->stmts.add(stmt);
}
if (seqStmtChild->stmts.getCount() == 0)
if (seqStmtChildForMember->stmts.getCount() == 0)
continue;
seqStmt->stmts.insert(insertOffset, seqStmtChild);
seqStmt->stmts.insert(insertOffset, seqStmtChildForMember);
}

if (structDeclInfo.defaultCtor)
Expand Down

0 comments on commit d21db8e

Please sign in to comment.