Changeset 11df881


Ignore:
Timestamp:
Jul 20, 2022, 11:42:29 AM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
b585593
Parents:
0577df2
Message:

Updated documentation on pre-resolver passes, moving code to headers instead of uses. Note that some comments were just copied over, I don't know if they are accurate.

Location:
src
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/FixNames.cc

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FixNames.cc --
     7// FixNames.cc -- Adjustments to typed declarations.
    88//
    99// Author           : Richard C. Bilson
  • src/CodeGen/FixNames.h

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FixNames.h --
     7// FixNames.h -- Adjustments to typed declarations.
    88//
    99// Author           : Richard C. Bilson
     
    2626        /// mangles object and function names
    2727        void fixNames( std::list< Declaration* > & translationUnit );
    28         void fixNames( ast::TranslationUnit & translationUnit );
     28/// Sets scope levels and fills in main's default return.
     29void fixNames( ast::TranslationUnit & translationUnit );
    2930} // namespace CodeGen
    3031
  • src/Concurrency/Keywords.h

    r0577df2 r11df881  
    2828        void implementThreadStarter( std::list< Declaration * > & translationUnit );
    2929
    30 /// Implement the sue-like keywords and the suspend keyword.
     30/// Implement the sue-like keywords and the suspend keyword. Pre-Autogen
    3131void implementKeywords( ast::TranslationUnit & translationUnit );
    32 /// Implement the mutex parameters and mutex statement.
     32/// Implement the mutex parameters and mutex statement. Post-Autogen
    3333void implementMutex( ast::TranslationUnit & translationUnit );
    34 /// Add the thread starter code to constructors.
     34/// Add the thread starter code to constructors. Post-Autogen
    3535void implementThreadStarter( ast::TranslationUnit & translationUnit );
    3636};
  • src/ControlStruct/ExceptDecl.cc

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ExceptDecl.cc --
     7// ExceptDecl.cc -- Handles declarations of exception types.
    88//
    99// Author           : Henry Xue
  • src/ControlStruct/ExceptDecl.h

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ExceptDecl.h --
     7// ExceptDecl.h -- Handles declarations of exception types.
    88//
    99// Author           : Henry Xue
     
    2525
    2626namespace ControlStruct {
    27         void translateExcept( std::list< Declaration *> & translationUnit );
    28         void translateExcept( ast::TranslationUnit & translationUnit );
     27/// Unfold exception declarations into raw structure declarations.
     28/// Also builds vtable declarations and converts vtable types.
     29void translateExcept( std::list< Declaration *> & translationUnit );
     30void translateExcept( ast::TranslationUnit & translationUnit );
    2931}
  • src/ControlStruct/HoistControlDecls.hpp

    r0577df2 r11df881  
    2121
    2222namespace ControlStruct {
    23 // Hoist declarations out of control flow statements into compound statement.
     23/// Hoist declarations out of control flow statements into compound statement.
     24/// Must happen before auto-gen routines are added.
    2425void hoistControlDecls( ast::TranslationUnit & translationUnit );
    2526} // namespace ControlStruct
  • src/InitTweak/GenInit.cc

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // GenInit.cc --
     7// GenInit.cc -- Generate initializers, and other stuff.
    88//
    99// Author           : Rob Schluntz
  • src/InitTweak/GenInit.h

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // GenInit.h --
     7// GenInit.h -- Generate initializers, and other stuff.
    88//
    99// Author           : Rodolfo G. Esteves
     
    2929        void genInit( ast::TranslationUnit & translationUnit );
    3030
    31         /// Converts return statements into copy constructor calls on the hidden return variable
     31        /// Converts return statements into copy constructor calls on the hidden return variable.
     32        /// This pass must happen before auto-gen.
    3233        void fixReturnStatements( std::list< Declaration * > & translationUnit );
    3334        void fixReturnStatements( ast::TranslationUnit & translationUnit );
  • src/Tuples/Tuples.cc

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Tuples.h --
     7// Tuples.cc -- A collection of tuple operations.
    88//
    99// Author           : Andrew Beach
  • src/Tuples/Tuples.h

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Tuples.h --
     7// Tuples.h -- A collection of tuple operations.
    88//
    99// Author           : Rodolfo G. Esteves
  • src/Validate/Autogen.hpp

    r0577df2 r11df881  
    2222namespace Validate {
    2323
     24/// Generate routines for all data types in the translation unit.
     25/// A lot of passes have to happen either before or after this pass.
    2426void autogenerateRoutines( ast::TranslationUnit & translationUnit );
    2527
  • src/Validate/CompoundLiteral.hpp

    r0577df2 r11df881  
    2323
    2424/// Use variables to implement compound literals.
     25/// Must happen after auto-gen routines are added.
    2526void handleCompoundLiterals( ast::TranslationUnit & translationUnit );
    2627
  • src/Validate/EnumAndPointerDecay.cpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // EnumAndPointerDecay.cpp --
     7// EnumAndPointerDecay.cpp -- Normalizes enumerations and types in functions.
    88//
    99// Author           : Andrew Beach
  • src/Validate/EnumAndPointerDecay.hpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // EnumAndPointerDecay.hpp --
     7// EnumAndPointerDecay.hpp -- Normalizes enumerations and types in functions.
    88//
    99// Author           : Andrew Beach
     
    2222namespace Validate {
    2323
     24/// Fix the parameter and return types of functions. Also assigns types to
     25/// enumeration values. This must happen before Link Reference to Types,
     26/// it needs correct types for mangling, and before auto-gen.
    2427void decayEnumsAndPointers( ast::TranslationUnit & translationUnit );
    2528
  • src/Validate/FindSpecialDecls.h

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FindSpecialDeclarations.h --
     7// FindSpecialDeclarations.h -- Find special declarations used in the compiler.
    88//
    99// Author           : Rob Schluntz
     
    4343        void findSpecialDecls( std::list< Declaration * > & translationUnit );
    4444
    45 /// find and remember some of the special declarations that are useful for
     45/// Find and remember some of the special declarations that are useful for
    4646/// generating code, so that they do not have to be discovered multiple times.
    4747void findGlobalDecls( ast::TranslationUnit & translationUnit );
  • src/Validate/FixQualifiedTypes.cpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FixQualifiedTypes.cpp --
     7// FixQualifiedTypes.cpp -- Replace the qualified type with a direct type.
    88//
    99// Author           : Andrew Beach
     
    7676                                                        ret->qualifiers = type->qualifiers;
    7777                                                        ast::TypeSubstitution sub( aggr->params, instp->params );
    78                                                         // = parent->genericSubstitution();
    7978                                                        auto result = sub.apply(ret);
    8079                                                        return result.node.release();
  • src/Validate/FixQualifiedTypes.hpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FixQualifiedTypes.hpp --
     7// FixQualifiedTypes.hpp -- Replace the qualified type with a direct type.
    88//
    99// Author           : Andrew Beach
     
    2222namespace Validate {
    2323
     24/// Replaces qualified types with an unqualified NamedTypeDecl.
     25/// Must happen after Link References To Types,
     26/// because aggregate members are accessed.
    2427void fixQualifiedTypes( ast::TranslationUnit & translationUnit );
    2528
  • src/Validate/FixReturnTypes.cpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FixReturnTypes.cpp --
     7// FixReturnTypes.cpp -- Unifies the representation of return types.
    88//
    99// Author           : Andrew Beach
  • src/Validate/FixReturnTypes.hpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FixReturnTypes.hpp --
     7// FixReturnTypes.hpp -- Unifies the representation of return types.
    88//
    99// Author           : Andrew Beach
     
    2222namespace Validate {
    2323
    24 // This pass needs to happen early so that other passes can find tuple types
    25 // in the right places, especially for function return types.
     24/// This pass needs to happen early so that other passes can find tuple types
     25/// in the right places, especially for function return types.
     26/// Must happen before auto-gen.
    2627void fixReturnTypes( ast::TranslationUnit & translationUnit );
    2728
  • src/Validate/ForallPointerDecay.hpp

    r0577df2 r11df881  
    2929/// Also checks that operator names are used properly on functions and
    3030/// assigns unique IDs. This is a "legacy" pass.
     31/// Must be after implement concurrent keywords; because uniqueIds must be
     32/// set on declaration before resolution.
     33/// Must happen before auto-gen routines are added.
    3134void decayForallPointers( ast::TranslationUnit & transUnit );
    3235
  • src/Validate/GenericParameter.cpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // GenericParameter.hpp --
     7// GenericParameter.hpp -- Generic parameter related passes.
    88//
    99// Author           : Andrew Beach
  • src/Validate/GenericParameter.hpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // GenericParameter.hpp --
     7// GenericParameter.hpp -- Generic parameter related passes.
    88//
    99// Author           : Andrew Beach
     
    2323
    2424/// Perform substutions for generic parameters and fill in defaults.
     25/// Check as early as possible, but it can't happen before Link References to
     26/// Types and observed failing when attempted before eliminate typedef.
    2527void fillGenericParameters( ast::TranslationUnit & translationUnit );
    2628
  • src/Validate/HoistStruct.hpp

    r0577df2 r11df881  
    2222namespace Validate {
    2323
    24 /// Flattens nested type declarations.
     24/// Flattens nested type declarations. (Run right after Fix Qualified Types.)
    2525void hoistStruct( ast::TranslationUnit & translationUnit );
    2626
  • src/Validate/HoistTypeDecls.cpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // HoistTypeDecls.cpp --
     7// HoistTypeDecls.cpp -- Hoists declarations of implicitly declared types.
    88//
    99// Author           : Andrew Beach
  • src/Validate/HoistTypeDecls.hpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // HoistTypeDecls.hpp --
     7// HoistTypeDecls.hpp -- Hoists declarations of implicitly declared types.
    88//
    99// Author           : Andrew Beach
     
    2222namespace Validate {
    2323
     24/// There are some places where a type can be declared but are usually only
     25/// referenced (with an *InstType). This inserts the declarations before
     26/// they are referenced.
    2427void hoistTypeDecls( ast::TranslationUnit & translationUnit );
    2528
  • src/Validate/LabelAddressFixer.cpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // LabelAddressFixer.cpp --
     7// LabelAddressFixer.cpp -- Create label address expressions.
    88//
    99// Author           : Andrew Beach
  • src/Validate/LabelAddressFixer.hpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // LabelAddressFixer.hpp --
     7// LabelAddressFixer.hpp -- Create label address expressions.
    88//
    99// Author           : Andrew Beach
     
    2020namespace Validate {
    2121
     22/// Label addresses are not actually created in the parser, this pass finds
     23/// the patterns that represent the label address expression.
    2224void fixLabelAddresses( ast::TranslationUnit & translationUnit );
    2325
  • src/Validate/LinkReferenceToTypes.hpp

    r0577df2 r11df881  
    2222namespace Validate {
    2323
     24/// Fills in the base value of various instance types, and some related
     25/// adjustments, such as setting the sized flag.
     26/// Because of the sized flag, it must happen before auto-gen.
    2427void linkReferenceToTypes( ast::TranslationUnit & translationUnit );
    2528
  • src/Validate/ReplaceTypedef.cpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ReplaceTypedef.cpp --
     7// ReplaceTypedef.cpp -- Fill in all typedefs with the underlying type.
    88//
    99// Author           : Andrew Beach
  • src/Validate/ReplaceTypedef.hpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ReplaceTypedef.hpp --
     7// ReplaceTypedef.hpp -- Fill in all typedefs with the underlying type.
    88//
    99// Author           : Andrew Beach
     
    2222namespace Validate {
    2323
     24/// Uses of typedef are replaced with the type in the typedef.
    2425void replaceTypedef( ast::TranslationUnit & translationUnit );
    2526
  • src/Validate/VerifyCtorDtorAssign.cpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // VerifyCtorDtorAssign.cpp --
     7// VerifyCtorDtorAssign.cpp -- Check the form of operators.
    88//
    99// Author           : Andrew Beach
  • src/Validate/VerifyCtorDtorAssign.hpp

    r0577df2 r11df881  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // VerifyCtorDtorAssign.hpp --
     7// VerifyCtorDtorAssign.hpp -- Check the form of operators.
    88//
    99// Author           : Andrew Beach
     
    2222namespace Validate {
    2323
     24/// Check that constructors, destructors and assignments all have the correct
     25/// form. Must happen before auto-gen or anything that examines operators.
    2426void verifyCtorDtorAssign( ast::TranslationUnit & translationUnit );
    2527
  • src/main.cc

    r0577df2 r11df881  
    345345                        }
    346346
    347                         // Must happen before auto-gen, or anything that examines ops.
    348347                        PASS( "Verify Ctor, Dtor & Assign", Validate::verifyCtorDtorAssign( transUnit ) );
    349 
    350348                        PASS( "Hoist Type Decls", Validate::hoistTypeDecls( transUnit ) );
    351349                        // Hoist Type Decls pulls some declarations out of contexts where
     
    355353
    356354                        PASS( "Replace Typedefs", Validate::replaceTypedef( transUnit ) );
    357 
    358                         // Must happen before auto-gen.
    359355                        PASS( "Fix Return Types", Validate::fixReturnTypes( transUnit ) );
    360 
    361                         // Must happen before Link Reference to Types, it needs correct
    362                         // types for mangling.
    363356                        PASS( "Enum and Pointer Decay", Validate::decayEnumsAndPointers( transUnit ) );
    364357
    365                         // Must happen before auto-gen, because it uses the sized flag.
    366358                        PASS( "Link Reference To Types", Validate::linkReferenceToTypes( transUnit ) );
    367359
    368                         // Must happen after Link References To Types,
    369                         // because aggregate members are accessed.
    370360                        PASS( "Fix Qualified Types", Validate::fixQualifiedTypes( transUnit ) );
    371 
    372361                        PASS( "Hoist Struct", Validate::hoistStruct( transUnit ) );
    373362                        PASS( "Eliminate Typedef", Validate::eliminateTypedef( transUnit ) );
    374 
    375                         // Check as early as possible. Can't happen before
    376                         // LinkReferenceToType, observed failing when attempted
    377                         // before eliminateTypedef
    378363                        PASS( "Validate Generic Parameters", Validate::fillGenericParameters( transUnit ) );
    379 
    380364                        PASS( "Translate Dimensions", Validate::translateDimensionParameters( transUnit ) );
    381365                        PASS( "Check Function Returns", Validate::checkReturnStatements( transUnit ) );
    382 
    383                         // Must happen before Autogen.
    384366                        PASS( "Fix Return Statements", InitTweak::fixReturnStatements( transUnit ) );
    385 
    386367                        PASS( "Implement Concurrent Keywords", Concurrency::implementKeywords( transUnit ) );
    387 
    388                         // Must be after implement concurrent keywords; because uniqueIds
    389                         //   must be set on declaration before resolution.
    390                         // Must happen before autogen routines are added.
    391368                        PASS( "Forall Pointer Decay", Validate::decayForallPointers( transUnit ) );
    392 
    393                         // Must happen before autogen routines are added.
    394369                        PASS( "Hoist Control Declarations", ControlStruct::hoistControlDecls( transUnit ) );
    395370
    396                         // Must be after enum and pointer decay.
    397                         // Must be before compound literals.
    398371                        PASS( "Generate Autogen Routines", Validate::autogenerateRoutines( transUnit ) );
    399372
Note: See TracChangeset for help on using the changeset viewer.