Changeset 6e50a6b for src/AST


Ignore:
Timestamp:
Jun 18, 2021, 12:20:59 PM (3 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c7d8696a
Parents:
dcbfcbc
Message:

Implementing language-provided syntax for (array) dimensions.

Former z(i) and Z(N) macros are eliminated.

Location:
src/AST
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    rdcbfcbc r6e50a6b  
    24152415        }
    24162416
     2417        virtual void visit( const DimensionExpr * old ) override final {
     2418                // DimensionExpr gets desugared away in Validate.
     2419                // As long as new-AST passes don't use it, this cheap-cheerful error
     2420                // detection helps ensure that these occurrences have been compiled
     2421                // away, as expected.  To move the DimensionExpr boundary downstream
     2422                // or move the new-AST translation boundary upstream, implement
     2423                // DimensionExpr in the new AST and implement a conversion.
     2424                (void) old;
     2425                assert(false && "DimensionExpr should not be present at new-AST boundary");
     2426        }
     2427
    24172428        virtual void visit( const AsmExpr * old ) override final {
    24182429                this->node = visitBaseExpr( old,
  • src/AST/Decl.cpp

    rdcbfcbc r6e50a6b  
    7878
    7979const char * TypeDecl::typeString() const {
    80         static const char * kindNames[] = { "sized data type", "sized data type", "sized object type", "sized function type", "sized tuple type", "sized array length type" };
     80        static const char * kindNames[] = { "sized data type", "sized data type", "sized object type", "sized function type", "sized tuple type", "sized length value" };
    8181        static_assert( sizeof(kindNames) / sizeof(kindNames[0]) == TypeDecl::NUMBER_OF_KINDS, "typeString: kindNames is out of sync." );
    8282        assertf( kind < TypeDecl::NUMBER_OF_KINDS, "TypeDecl kind is out of bounds." );
  • src/AST/Decl.hpp

    rdcbfcbc r6e50a6b  
    175175class TypeDecl final : public NamedTypeDecl {
    176176  public:
    177         enum Kind { Dtype, DStype, Otype, Ftype, Ttype, ALtype, NUMBER_OF_KINDS };
     177        enum Kind { Dtype, DStype, Otype, Ftype, Ttype, Dimension, NUMBER_OF_KINDS };
    178178
    179179        Kind kind;
Note: See TracChangeset for help on using the changeset viewer.