diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-06-05 18:20:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-05 18:20:09 -0400 |
| commit | 43c146794aab638924d2ab838d10f8af2ebf02a7 (patch) | |
| tree | 520eed8f2ae02c6953cf2aee7c87959a0008badc /source/slang/slang-check-stmt.cpp | |
| parent | e3e1cf2045f14837cfecb14e252c0e1083787b93 (diff) | |
ASTNodes use MemoryArena (#1376)
* Add a ASTBuilder to a Module
Only construct on valid ASTBuilder (was being called on nullptr on occassion)
* Add nodes to ASTBuilder.
* Compiles with RefPtr removed from AST node types.
* Initialize all AST node pointer variables in headers to nullptr;
* Initialize AST node variables as nullptr.
Make ASTBuilder keep a ref on node types.
Make SyntaxParseCallback returns a NodeBase
* Don't release canonicalType on dtor (managed by ASTBuilder).
* Give ASTBuilders a name and id, to help in debugging.
For now destroy the session TypeCache, to stop it holding things released when the compile request destroys ASTBuilders.
* Moved the TypeCheckingCache over to Linkage from Session.
* NodeBase no longer derived from RefObject.
* Only add/dtor nodes that need destruction.
First pass compile on linux.
Diffstat (limited to 'source/slang/slang-check-stmt.cpp')
| -rw-r--r-- | source/slang/slang-check-stmt.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/slang/slang-check-stmt.cpp b/source/slang/slang-check-stmt.cpp index 71cf97396..2d01086f1 100644 --- a/source/slang/slang-check-stmt.cpp +++ b/source/slang/slang-check-stmt.cpp @@ -108,9 +108,9 @@ namespace Slang stmt->parentStmt = outer; } - RefPtr<Expr> SemanticsVisitor::checkPredicateExpr(Expr* expr) + Expr* SemanticsVisitor::checkPredicateExpr(Expr* expr) { - RefPtr<Expr> e = expr; + Expr* e = expr; e = CheckTerm(e); e = coerce(m_astBuilder->getBoolType(), e); return e; @@ -140,7 +140,7 @@ namespace Slang subContext.checkStmt(stmt->statement); } - RefPtr<Expr> SemanticsVisitor::checkExpressionAndExpectIntegerConstant(RefPtr<Expr> expr, RefPtr<IntVal>* outIntVal) + Expr* SemanticsVisitor::checkExpressionAndExpectIntegerConstant(Expr* expr, IntVal** outIntVal) { expr = CheckExpr(expr); auto intVal = CheckIntegerConstantExpression(expr); @@ -157,8 +157,8 @@ namespace Slang addModifier(stmt->varDecl, m_astBuilder->create<ConstModifier>()); stmt->varDecl->setCheckState(DeclCheckState::Checked); - RefPtr<IntVal> rangeBeginVal; - RefPtr<IntVal> rangeEndVal; + IntVal* rangeBeginVal = nullptr; + IntVal* rangeEndVal = nullptr; if (stmt->rangeBeginExpr) { @@ -166,7 +166,7 @@ namespace Slang } else { - RefPtr<ConstantIntVal> rangeBeginConst = m_astBuilder->create<ConstantIntVal>(); + ConstantIntVal* rangeBeginConst = m_astBuilder->create<ConstantIntVal>(); rangeBeginConst->value = 0; rangeBeginVal = rangeBeginConst; } |
