Skip to content

Commit

Permalink
refactor: comment out canVisitXXX methods in ast_const_folding
Browse files Browse the repository at this point in the history
  • Loading branch information
profelis committed Dec 23, 2024
1 parent 5a39d7b commit 051ea00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/ast/ast_const_folding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ namespace das {

class NoSideEffectVisitor : public Visitor {
protected:
virtual bool canVisitStructureFieldInit ( Structure * ) override { return false; }
virtual bool canVisitArgumentInit ( Function * , const VariablePtr &, Expression * ) override { return false; }
virtual bool canVisitQuoteSubexpression ( ExprQuote * ) override { return false; }
// virtual bool canVisitStructureFieldInit ( Structure * ) override { return false; }
// virtual bool canVisitArgumentInit ( Function * , const VariablePtr &, Expression * ) override { return false; }
// virtual bool canVisitQuoteSubexpression ( ExprQuote * ) override { return false; }
// make block
virtual void preVisit ( ExprMakeBlock * expr ) override {
Visitor::preVisit(expr);
Expand Down Expand Up @@ -453,9 +453,9 @@ namespace das {
return nullptr;
}
protected:
virtual bool canVisitStructureFieldInit ( Structure * ) override { return false; }
virtual bool canVisitArgumentInit ( Function * , const VariablePtr &, Expression * ) override { return false; }
virtual bool canVisitQuoteSubexpression ( ExprQuote * ) override { return false; }
// virtual bool canVisitStructureFieldInit ( Structure * ) override { return false; }
// virtual bool canVisitArgumentInit ( Function * , const VariablePtr &, Expression * ) override { return false; }
// virtual bool canVisitQuoteSubexpression ( ExprQuote * ) override { return false; }
// swizzle
virtual ExpressionPtr visit ( ExprSwizzle * expr ) override {
if ( expr->type->baseType == expr->value->type->baseType ) {
Expand Down
2 changes: 1 addition & 1 deletion src/ast/ast_infer_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@ namespace das {
}
}
}
if ( decl.parentType ) {
if ( decl.parentType && st->parent ) {
auto pf = st->parent->findField(decl.name);
if ( !pf->type->isAutoOrAlias() ) {
decl.type = make_smart<TypeDecl>(*pf->type);
Expand Down

0 comments on commit 051ea00

Please sign in to comment.