Changeset 81da3da4 for src/ControlStruct


Ignore:
Timestamp:
Dec 11, 2023, 4:18:13 AM (22 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
21ce2c7, 2554f24
Parents:
5ddb8bf (diff), 1c85ffc (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/ControlStruct
Files:
4 edited
4 moved

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/ExceptDecl.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ExceptDeclNew.cpp --
     7// ExceptDecl.cpp --
    88//
    99// Author           : Andrew Beach
  • src/ControlStruct/ExceptDecl.h

    r5ddb8bf r81da3da4  
    1616#pragma once
    1717
    18 #include <list>  // for list
    19 
    20 class Declaration;
    21 
    2218namespace ast {
    2319        class TranslationUnit;
     
    2521
    2622namespace ControlStruct {
     23
    2724/// Unfold exception declarations into raw structure declarations.
    2825/// Also builds vtable declarations and converts vtable types.
    29 void translateExcept( std::list< Declaration *> & translationUnit );
    3026void translateExcept( ast::TranslationUnit & translationUnit );
     27
    3128}
  • src/ControlStruct/ExceptTranslate.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ExceptTranslateNew.cpp -- Conversion of exception control flow structures.
     7// ExceptTranslate.cpp -- Conversion of exception control flow structures.
    88//
    99// Author           : Andrew Beach
     
    2626namespace {
    2727
    28         typedef std::list<ast::CatchClause*> CatchList;
    29 
    30         void appendDeclStmt( ast::CompoundStmt * block, ast::DeclWithType * item ) {
    31                 block->push_back(new ast::DeclStmt(block->location, item));
    32         }
     28typedef std::list<ast::CatchClause*> CatchList;
     29
     30void appendDeclStmt( ast::CompoundStmt * block, ast::DeclWithType * item ) {
     31        block->push_back( new ast::DeclStmt( block->location, item ) );
     32}
    3333
    3434class TranslateThrowsCore final : public ast::WithGuards {
     
    253253                location,
    254254                "try",
    255                 {}, //forall
    256255                {}, //no param
    257256                {}, //no return
     
    267266                location,
    268267                "catch",
    269                 {}, //forall
    270268                { make_index_object( location ), make_exception_object( location ) },
    271269                {}, //return void
     
    281279                location,
    282280                "match",
    283                 {}, //forall
    284281                { make_exception_object( location ) },
    285282                { make_unused_index_object( location ) },
     
    295292                location,
    296293                "handle",
    297                 {}, //forall
    298294                { make_exception_object( location ) },
    299295                { make_bool_object( location ) },
     
    309305                location,
    310306                "finally",
    311                 {}, //forall
    312307                { make_voidptr_object( location ) },
    313308                {}, //return void
  • src/ControlStruct/ExceptTranslate.h

    r5ddb8bf r81da3da4  
    1616#pragma once
    1717
    18 #include <list>  // for list
    19 
    20 class Declaration;
    2118namespace ast {
    2219        class TranslationUnit;
     
    2421
    2522namespace ControlStruct {
    26         void translateThrows( std::list< Declaration *> & translationUnit );
    27         void translateThrows( ast::TranslationUnit & transUnit );
    28         /* Replaces all throw & throwResume statements with function calls.
    29          * These still need to be resolved, so call this before the reslover.
    30          */
    3123
    32         void translateTries( std::list< Declaration *> & translationUnit );
    33         void translateTries( ast::TranslationUnit & transUnit );
    34         /* Replaces all try blocks (and their many clauses) with function definitions and calls.
    35          * This uses the exception built-ins to produce typed output and should take place after
    36          * the resolver. It also produces virtual casts and should happen before they are expanded.
    37          */
     24void translateThrows( ast::TranslationUnit & transUnit );
     25/* Replaces all throw & throwResume statements with function calls.
     26 * These still need to be resolved, so call this before the reslover.
     27 */
     28
     29void translateTries( ast::TranslationUnit & transUnit );
     30/* Replaces all try blocks (and their many clauses) with function definitions and calls.
     31 * This uses the exception built-ins to produce typed output and should take place after
     32 * the resolver. It also produces virtual casts and should happen before they are expanded.
     33 */
     34
    3835}
    3936
  • src/ControlStruct/LabelGenerator.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // LabelGeneratorNew.cpp --
     7// LabelGenerator.cpp --
    88//
    99// Author           : Peter A. Buhr
     
    1414//
    1515
    16 #include "LabelGeneratorNew.hpp"
     16#include "LabelGenerator.hpp"
    1717
    1818#include "AST/Attribute.hpp"
  • src/ControlStruct/LabelGenerator.hpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // LabelGenerator.h --
     7// LabelGenerator.hpp --
    88//
    99// Author           : Rodolfo G. Esteves
     
    2626
    2727namespace ControlStruct {
    28         ast::Label newLabel( const std::string &, const ast::Stmt * );
    29         ast::Label newLabel( const std::string &, const CodeLocation & );
     28
     29ast::Label newLabel( const std::string &, const ast::Stmt * );
     30ast::Label newLabel( const std::string &, const CodeLocation & );
     31
    3032} // namespace ControlStruct
    3133
  • src/ControlStruct/MultiLevelExit.cpp

    r5ddb8bf r81da3da4  
    1616#include "MultiLevelExit.hpp"
    1717
     18#include <set>
     19
    1820#include "AST/Pass.hpp"
    1921#include "AST/Stmt.hpp"
    20 #include "LabelGeneratorNew.hpp"
    21 
    22 #include <set>
     22#include "LabelGenerator.hpp"
     23
    2324using namespace std;
    2425using namespace ast;
  • src/ControlStruct/module.mk

    r5ddb8bf r81da3da4  
    1616
    1717SRC += \
    18         ControlStruct/ExceptDeclNew.cpp \
     18        ControlStruct/ExceptDecl.cpp \
    1919        ControlStruct/ExceptDecl.h \
    20         ControlStruct/ExceptTranslateNew.cpp \
     20        ControlStruct/ExceptTranslate.cpp \
    2121        ControlStruct/ExceptTranslate.h \
    2222        ControlStruct/FixLabels.cpp \
     
    2424        ControlStruct/HoistControlDecls.cpp \
    2525        ControlStruct/HoistControlDecls.hpp \
    26         ControlStruct/LabelGeneratorNew.cpp \
    27         ControlStruct/LabelGeneratorNew.hpp \
     26        ControlStruct/LabelGenerator.cpp \
     27        ControlStruct/LabelGenerator.hpp \
    2828        ControlStruct/MultiLevelExit.cpp \
    2929        ControlStruct/MultiLevelExit.hpp
Note: See TracChangeset for help on using the changeset viewer.