Changeset 14c0f7b for src/SymTab


Ignore:
Timestamp:
Jul 31, 2023, 11:25:51 AM (16 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
f496046
Parents:
e0332dd
Message:

Added invariant to check that referenced declarations are in scope. This one took a while, I don't remember why forall pointer decay is involved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/GenImplicitCall.cpp

    re0332dd r14c0f7b  
    1616#include "GenImplicitCall.hpp"
    1717
     18#include "AST/Copy.hpp"                  // for deepCopy
    1819#include "AST/Decl.hpp"                  // for ObjectDecl
    1920#include "AST/Expr.hpp"                  // for ConstantExpr, UntypedExpr,...
     
    115116        std::string cmp, update;
    116117
     118        const ast::Expr * dimension = deepCopy( array->dimension );
    117119        if ( forward ) {
    118120                // generate: for ( int i = 0; i < N; ++i )
    119121                begin = ast::ConstantExpr::from_int( loc, 0 );
    120                 end = array->dimension;
     122                end = dimension;
    121123                cmp = "?<?";
    122124                update = "++?";
     
    124126                // generate: for ( int i = N-1; i >= 0; --i )
    125127                begin = ast::UntypedExpr::createCall( loc, "?-?",
    126                         { array->dimension, ast::ConstantExpr::from_int( loc, 1 ) } );
     128                        { dimension, ast::ConstantExpr::from_int( loc, 1 ) } );
    127129                end = ast::ConstantExpr::from_int( loc, 0 );
    128130                cmp = "?>=?";
Note: See TracChangeset for help on using the changeset viewer.