Changeset b859f59


Ignore:
Timestamp:
Sep 22, 2022, 4:08:06 PM (20 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
3f7e68b7
Parents:
5d8dae7
Message:

Reordered fields in FunctionDecl? and removed some trailing white-space.

Location:
src/AST
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.cpp

    r5d8dae7 rb859f59  
    5858        CompoundStmt * stmts, Storage::Classes storage, Linkage::Spec linkage,
    5959        std::vector<ptr<Attribute>>&& attrs, Function::Specs fs, bool isVarArgs)
    60 : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), params(std::move(params)), returns(std::move(returns)),
    61         type_params(std::move(forall)), stmts( stmts ) {
     60: DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ),
     61        type_params(std::move(forall)), assertions(),
     62        params(std::move(params)), returns(std::move(returns)), stmts( stmts ) {
    6263        FunctionType * ftype = new FunctionType(static_cast<ArgumentFlag>(isVarArgs));
    6364        for (auto & param : this->params) {
     
    8283        std::vector<ptr<Attribute>>&& attrs, Function::Specs fs, bool isVarArgs)
    8384: DeclWithType( location, name, storage, linkage, std::move(attrs), fs ),
     85                type_params( std::move( forall) ), assertions( std::move( assertions ) ),
    8486                params( std::move(params) ), returns( std::move(returns) ),
    85                 type_params( std::move( forall) ), assertions( std::move( assertions ) ),
    8687                type( nullptr ), stmts( stmts ) {
    8788        FunctionType * type = new FunctionType( (isVarArgs) ? VariableArgs : FixedArgs );
     
    162163
    163164        auto it = enumValues.find( enumerator->name );
    164        
     165
    165166        if ( it != enumValues.end() ) {
    166                        
     167
    167168                // Handle typed enum by casting the value in (C++) compiler
    168169                // if ( base ) { // A typed enum
     
    179180                //                      case BasicType::Kind::LongUnsignedInt: value = (long unsigned int) it->second; break;
    180181                //                      case BasicType::Kind::LongLongSignedInt: value = (long long signed int) it->second; break;
    181                 //                      case BasicType::Kind::LongLongUnsignedInt: value = (long long unsigned int) it->second; break; 
     182                //                      case BasicType::Kind::LongLongUnsignedInt: value = (long long unsigned int) it->second; break;
    182183                //                      // TODO: value should be able to handle long long unsigned int
    183184
  • src/AST/Decl.hpp

    r5d8dae7 rb859f59  
    125125class FunctionDecl : public DeclWithType {
    126126public:
     127        std::vector<ptr<TypeDecl>> type_params;
     128        std::vector<ptr<DeclWithType>> assertions;
    127129        std::vector<ptr<DeclWithType>> params;
    128130        std::vector<ptr<DeclWithType>> returns;
    129         std::vector<ptr<TypeDecl>> type_params;
    130         std::vector<ptr<DeclWithType>> assertions;
    131131        // declared type, derived from parameter declarations
    132132        ptr<FunctionType> type;
Note: See TracChangeset for help on using the changeset viewer.