Changeset 7a780ad for src/CodeGen


Ignore:
Timestamp:
Apr 18, 2024, 5:19:17 PM (3 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
38093ae
Parents:
60c5b6d
Message:

Moved ast::BasicType::Kind to ast::BasicKind? in its own hearder. This is more consistent with other utility enums (although we still use this as a enum class) and reduces what some files need to include. Also did a upgrade in a comment with MAX_INTEGER_TYPE, it is now part of the enum.

Location:
src/CodeGen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/FixMain.cc

    r60c5b6d r7a780ad  
    5252ast::ObjectDecl * makeIntObj(){
    5353        return new ast::ObjectDecl( CodeLocation(), "",
    54                 new ast::BasicType( ast::BasicType::SignedInt ) );
     54                new ast::BasicType( ast::BasicKind::SignedInt ) );
    5555}
    5656
     
    5959                new ast::PointerType(
    6060                        new ast::PointerType(
    61                                 new ast::BasicType( ast::BasicType::Char ) ) ) );
     61                                new ast::BasicType( ast::BasicKind::Char ) ) ) );
    6262}
    6363
  • src/CodeGen/GenType.cc

    r60c5b6d r7a780ad  
    8787
    8888void GenType::postvisit( ast::BasicType const * type ) {
    89         ast::BasicType::Kind kind = type->kind;
    90         assert( 0 <= kind && kind < ast::BasicType::NUMBER_OF_BASIC_TYPES );
     89        ast::BasicKind kind = type->kind;
     90        assert( 0 <= kind && kind < ast::BasicKind::NUMBER_OF_BASIC_TYPES );
    9191        result = std::string( ast::BasicType::typeNames[kind] ) + " " + result;
    9292        handleQualifiers( type );
Note: See TracChangeset for help on using the changeset viewer.