summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-stmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-stmt.cpp')
-rw-r--r--source/slang/slang-check-stmt.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/slang/slang-check-stmt.cpp b/source/slang/slang-check-stmt.cpp
index 6f8ed9ff5..45be1d662 100644
--- a/source/slang/slang-check-stmt.cpp
+++ b/source/slang/slang-check-stmt.cpp
@@ -21,13 +21,10 @@ namespace Slang
{
public:
WithOuterStmt(SemanticsStmtVisitor* visitor, Stmt* outerStmt)
- : SemanticsStmtVisitor(*visitor)
+ : SemanticsStmtVisitor(visitor->withOuterStmts(&m_outerStmt))
{
- m_parentFunc = visitor->m_parentFunc;
-
- m_outerStmt.next = visitor->m_outerStmts;
+ m_outerStmt.next = visitor->getOuterStmts();
m_outerStmt.stmt = outerStmt;
- m_outerStmts = &m_outerStmt;
}
private:
@@ -35,10 +32,10 @@ namespace Slang
};
}
- void SemanticsVisitor::checkStmt(Stmt* stmt, FunctionDeclBase* parentDecl, OuterStmtInfo* outerStmts)
+ void SemanticsVisitor::checkStmt(Stmt* stmt, SemanticsContext const& context)
{
if (!stmt) return;
- dispatchStmt(stmt, parentDecl, outerStmts);
+ dispatchStmt(stmt, context);
checkModifiers(stmt);
}
@@ -72,7 +69,7 @@ namespace Slang
void SemanticsStmtVisitor::checkStmt(Stmt* stmt)
{
- SemanticsVisitor::checkStmt(stmt, m_parentFunc, m_outerStmts);
+ SemanticsVisitor::checkStmt(stmt, *this);
}
template<typename T>