Changeset b66d14a for src/AST


Ignore:
Timestamp:
Jan 11, 2021, 10:10:33 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
20207c0
Parents:
2501ae5
Message:

add new type kinds DStype and ALtype

Location:
src/AST
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.cpp

    r2501ae5 rb66d14a  
    1010// Created On       : Thu May 9 10:00:00 2019
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Dec 13 16:23:15 2019
    13 // Update Count     : 20
     12// Last Modified On : Mon Jan 11 20:53:23 2021
     13// Update Count     : 21
    1414//
    1515
     
    7878
    7979const char * TypeDecl::typeString() const {
    80         static const char * kindNames[] = { "sized data type", "sized object type", "sized function type", "sized tuple type" };
    81         static_assert( sizeof(kindNames)/sizeof(kindNames[0]) == TypeDecl::NUMBER_OF_KINDS, "typeString: kindNames is out of sync." );
     80        static const char * kindNames[] = { "data type", "sized data type", "sized object type", "sized function type", "sized tuple type", "array length type" };
     81        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." );
    8383        return sized ? kindNames[ kind ] : &kindNames[ kind ][ sizeof("sized") ]; // sizeof includes '\0'
     
    8585
    8686const char * TypeDecl::genTypeString() const {
    87         static const char * kindNames[] = { "dtype", "otype", "ftype", "ttype" };
    88         static_assert( sizeof(kindNames)/sizeof(kindNames[0]) == TypeDecl::NUMBER_OF_KINDS, "genTypeString: kindNames is out of sync." );
     87        static const char * kindNames[] = { "T &", "T *", "T", "(*)", "T ...", "[T]" };
     88        static_assert( sizeof(kindNames) / sizeof(kindNames[0]) == TypeDecl::NUMBER_OF_KINDS, "genTypeString: kindNames is out of sync." );
    8989        assertf( kind < TypeDecl::NUMBER_OF_KINDS, "TypeDecl kind is out of bounds." );
    9090        return kindNames[ kind ];
  • src/AST/Decl.hpp

    r2501ae5 rb66d14a  
    1010// Created On       : Thu May 9 10:00:00 2019
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Dec 13 17:38:33 2019
    13 // Update Count     : 29
     12// Last Modified On : Mon Jan 11 20:48:38 2021
     13// Update Count     : 30
    1414//
    1515
     
    175175class TypeDecl final : public NamedTypeDecl {
    176176  public:
    177         enum Kind { Dtype, Otype, Ftype, Ttype, NUMBER_OF_KINDS };
     177        enum Kind { Dtype, DStype, Otype, Ftype, Ttype, ALtype, NUMBER_OF_KINDS };
    178178
    179179        Kind kind;
Note: See TracChangeset for help on using the changeset viewer.