Changeset 6a896b0


Ignore:
Timestamp:
Jul 18, 2022, 11:27:06 AM (2 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
efcd8f2
Parents:
847bb6f
Message:

Translated the Exception Declaration pass.

Location:
src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.cpp

    r847bb6f r6a896b0  
    272272        // Adjust the length of the string for the terminator.
    273273        const Expr * strSize = from_ulong( loc, str.size() + 1 );
    274         const Type * strType = new ArrayType( charType, strSize, FixedLen, StaticDim );
     274        const Type * strType = new ArrayType( charType, strSize, FixedLen, DynamicDim );
    275275        const std::string strValue = "\"" + str + "\"";
    276276        return new ConstantExpr( loc, strType, strValue, std::nullopt );
  • src/ControlStruct/ExceptDecl.h

    r847bb6f r6a896b0  
    99// Author           : Henry Xue
    1010// Created On       : Tue Jul 20 04:10:50 2021
    11 // Last Modified By : Henry Xue
    12 // Last Modified On : Tue Jul 20 04:10:50 2021
    13 // Update Count     : 1
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tue Jul 12 15:49:00 2022
     13// Update Count     : 2
    1414//
    1515
     
    2020class Declaration;
    2121
     22namespace ast {
     23        class TranslationUnit;
     24}
     25
    2226namespace ControlStruct {
    2327        void translateExcept( std::list< Declaration *> & translationUnit );
     28        void translateExcept( ast::TranslationUnit & translationUnit );
    2429}
  • src/ControlStruct/module.mk

    r847bb6f r6a896b0  
    1717SRC += \
    1818        ControlStruct/ExceptDecl.cc \
     19        ControlStruct/ExceptDeclNew.cpp \
    1920        ControlStruct/ExceptDecl.h \
    2021        ControlStruct/ExceptTranslateNew.cpp \
  • src/Virtual/Tables.h

    r847bb6f r6a896b0  
    1919#include "AST/Fwd.hpp"
    2020class Declaration;
     21class Expression;
     22class FunctionDecl;
     23class Initializer;
     24class ObjectDecl;
    2125class StructDecl;
    22 class Expression;
     26class StructInstType;
     27class Type;
    2328
    2429namespace Virtual {
  • src/main.cc

    r847bb6f r6a896b0  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue Jul 12 12:02:00 2022
    13 // Update Count     : 675
     12// Last Modified On : Mon Jul 18 11:08:00 2022
     13// Update Count     : 676
    1414//
    1515
     
    330330                Stats::Time::StopBlock();
    331331
    332                 PASS( "Translate Exception Declarations", ControlStruct::translateExcept( translationUnit ) );
    333                 if ( exdeclp ) {
    334                         dump( translationUnit );
    335                         return EXIT_SUCCESS;
    336                 } // if
    337 
    338                 CodeTools::fillLocations( translationUnit );
    339 
    340332                if( useNewAST ) {
    341                         CodeTools::fillLocations( translationUnit );
    342 
    343333                        if (Stats::Counters::enabled) {
    344334                                ast::pass_visitor_stats.avg = Stats::Counters::build<Stats::Counters::AverageCounter<double>>("Average Depth - New");
     
    348338
    349339                        forceFillCodeLocations( transUnit );
     340
     341                        PASS( "Translate Exception Declarations", ControlStruct::translateExcept( transUnit ) );
     342                        if ( exdeclp ) {
     343                                dump( move( transUnit ) );
     344                                return EXIT_SUCCESS;
     345                        }
    350346
    351347                        // Must happen before auto-gen, or anything that examines ops.
     
    473469                        translationUnit = convert( move( transUnit ) );
    474470                } else {
     471                        PASS( "Translate Exception Declarations", ControlStruct::translateExcept( translationUnit ) );
     472                        if ( exdeclp ) {
     473                                dump( translationUnit );
     474                                return EXIT_SUCCESS;
     475                        } // if
     476
    475477                        // add the assignment statement after the initialization of a type parameter
    476478                        PASS( "Validate", SymTab::validate( translationUnit ) );
Note: See TracChangeset for help on using the changeset viewer.