Changeset 81da3da4


Ignore:
Timestamp:
Dec 11, 2023, 4:18:13 AM (2 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

Files:
1 added
1 deleted
49 edited
21 moved

Legend:

Unmodified
Added
Removed
  • .gitignore

    r5ddb8bf r81da3da4  
    3939driver/cfa-cpp
    4040driver/cc1
     41driver/demangler
    4142
    4243libcfa/prelude/bootloader.c
     
    5960src/Parser/parser.h
    6061src/Parser/parser.hh
    61 src/demangler
    6262
    6363tools/prettyprinter/parser.output
  • configure.ac

    r5ddb8bf r81da3da4  
    244244if test "x$enable_demangler" == xyes; then
    245245        LIBDEMANGLE="libdemangle.a"
    246         DEMANGLER="demangler"
     246        DEMANGLER="../driver/demangler"
    247247else
    248248        LIBDEMANGLE=""
     
    273273        libcfa/Makefile:libcfa/Makefile.dist.in
    274274        tests/Makefile
    275         ])
     275])
    276276
    277277# Some of our makefile don't need to be distributed
  • libcfa/src/bits/random.hfa

    r5ddb8bf r81da3da4  
    1010// Created On       : Fri Jan 14 07:18:11 2022
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Sep  2 18:04:12 2023
    13 // Update Count     : 187
     12// Last Modified On : Tue Dec  5 08:58:52 2023
     13// Update Count     : 190
    1414//
    1515
     
    2222
    2323// Set default PRNG for architecture size.
    24 #if defined( __x86_64__ ) || defined( __arm_64__ )              // 64-bit architecture
     24#if defined( __x86_64__ ) || defined( __aarch64__ )             // 64-bit architecture
    2525        // 64-bit generators
    2626        //#define LEHMER64
     
    112112
    113113// Default PRNG used by runtime.
    114 #if defined( __x86_64__ ) || defined( __arm_64__ )              // 64-bit architecture
     114#if defined( __x86_64__ ) || defined( __aarch64__ )             // 64-bit architecture
    115115#define PRNG_NAME PRNG_NAME_64
    116116#define PRNG_STATE_T PRNG_STATE_64_T
  • src/AST/Chain.hpp

    r5ddb8bf r81da3da4  
    3333        template<typename actual_node_t, typename child_t>
    3434        auto operator()( child_t actual_node_t::*child ) {
    35                 auto n = mutate(base.get());
     35                node_t * n = base.get_and_mutate();
    3636                actual_node_t * node = strict_dynamic_cast<actual_node_t *>(n);
    37                 base = node;
    3837                return _chain_mutator< typename std::remove_reference< decltype(node->*child) >::type >{node->*child};
    3938        }
    4039
    4140        node_t * operator->() {
    42                 auto n = mutate(base.get());
    43                 base = n;
    44                 return n;
     41                return base.get_and_mutate();
    4542        }
    4643};
  • src/AST/Decl.cpp

    r5ddb8bf r81da3da4  
    2121
    2222#include "Common/Eval.h"       // for eval
     23#include "Common/SemanticError.h"
    2324
    2425#include "Fwd.hpp"             // for UniqueId
     
    4142
    4243FunctionDecl::FunctionDecl( const CodeLocation & loc, const std::string & name,
    43         std::vector<ptr<TypeDecl>>&& forall,
    4444        std::vector<ptr<DeclWithType>>&& params, std::vector<ptr<DeclWithType>>&& returns,
    4545        CompoundStmt * stmts, Storage::Classes storage, Linkage::Spec linkage,
    4646        std::vector<ptr<Attribute>>&& attrs, Function::Specs fs, ArgumentFlag isVarArgs )
    47 : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ),
    48         type_params(std::move(forall)), assertions(),
    49         params(std::move(params)), returns(std::move(returns)), stmts( stmts ) {
    50         FunctionType * ftype = new FunctionType( isVarArgs );
    51         for (auto & param : this->params) {
    52                 ftype->params.emplace_back(param->get_type());
    53         }
    54         for (auto & ret : this->returns) {
    55                 ftype->returns.emplace_back(ret->get_type());
    56         }
    57         for (auto & tp : this->type_params) {
    58                 ftype->forall.emplace_back(new TypeInstType(tp));
    59                 for (auto & ap: tp->assertions) {
    60                         ftype->assertions.emplace_back(new VariableExpr(loc, ap));
    61                 }
    62         }
    63         this->type = ftype;
     47: FunctionDecl( loc, name, {}, {}, std::move(params), std::move(returns),
     48                stmts, storage, linkage, std::move(attrs), fs, isVarArgs ) {
    6449}
    6550
  • src/AST/Decl.hpp

    r5ddb8bf r81da3da4  
    3030#include "Visitor.hpp"
    3131#include "Common/utility.h"
    32 #include "Common/SemanticError.h"                                               // error_str
    3332
    3433// Must be included in *all* AST classes; should be #undef'd at the end of the file
     
    135134        std::vector< ptr<Expr> > withExprs;
    136135
    137         // The difference between the two constructors is in how they handle
    138         // assertions. The first constructor uses the assertions from the type
    139         // parameters, in the style of the old ast, and puts them on the type.
    140         // The second takes an explicite list of assertions and builds a list of
    141         // references to them on the type.
    142 
    143         FunctionDecl( const CodeLocation & loc, const std::string & name, std::vector<ptr<TypeDecl>>&& forall,
     136        /// Monomorphic Function Constructor:
     137        FunctionDecl( const CodeLocation & locaction, const std::string & name,
    144138                std::vector<ptr<DeclWithType>>&& params, std::vector<ptr<DeclWithType>>&& returns,
    145139                CompoundStmt * stmts, Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::Cforall,
    146140                std::vector<ptr<Attribute>>&& attrs = {}, Function::Specs fs = {}, ArgumentFlag isVarArgs = FixedArgs );
    147141
     142        /// Polymorphic Function Constructor:
    148143        FunctionDecl( const CodeLocation & location, const std::string & name,
    149144                std::vector<ptr<TypeDecl>>&& forall, std::vector<ptr<DeclWithType>>&& assertions,
  • src/AST/Expr.cpp

    r5ddb8bf r81da3da4  
    222222}
    223223
    224 MemberExpr::MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg,
    225     MemberExpr::NoOpConstruction overloadSelector )
    226 : Expr( loc ), member( mem ), aggregate( agg ) {
    227         assert( member );
    228         assert( aggregate );
    229         assert( aggregate->result );
    230         (void) overloadSelector;
    231 }
    232 
    233224bool MemberExpr::get_lvalue() const {
    234225        // This is actually wrong by C, but it works with our current set-up.
     
    388379        stmts.emplace_back( new ExprStmt{ loc, tupleExpr } );
    389380        stmtExpr = new StmtExpr{ loc, new CompoundStmt{ loc, std::move(stmts) } };
    390 }
    391 
    392 TupleAssignExpr::TupleAssignExpr(
    393         const CodeLocation & loc, const Type * result, const StmtExpr * s )
    394 : Expr( loc, result ), stmtExpr() {
    395         stmtExpr = s;
    396381}
    397382
  • src/AST/Expr.hpp

    r5ddb8bf r81da3da4  
    3535        template<typename node_t> friend node_t * shallowCopy(const node_t * node);
    3636
    37 
    38 class ConverterOldToNew;
    39 class ConverterNewToOld;
    40 
    4137namespace ast {
    4238
     
    439435        MemberExpr * clone() const override { return new MemberExpr{ *this }; }
    440436        MUTATE_FRIEND
    441 
    442         // Custructor overload meant only for AST conversion
    443         enum NoOpConstruction { NoOpConstructionChosen };
    444         MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg,
    445             NoOpConstruction overloadSelector );
    446         friend class ::ConverterOldToNew;
    447         friend class ::ConverterNewToOld;
    448437};
    449438
     
    458447        ConstantExpr(
    459448                const CodeLocation & loc, const Type * ty, const std::string & r,
    460                         std::optional<unsigned long long> i )
    461         : Expr( loc, ty ), rep( r ), ival( i ), underlyer(ty) {}
     449                        const std::optional<unsigned long long> & i )
     450        : Expr( loc, ty ), rep( r ), ival( i ) {}
    462451
    463452        /// Gets the integer value of this constant, if one is appropriate to its type.
     
    483472
    484473        std::optional<unsigned long long> ival;
    485 
    486         // Intended only for legacy support of roundtripping the old AST.
    487         // Captures the very-locally inferred type, before the resolver modifies the type of this ConstantExpression.
    488         // In the old AST it's constExpr->constant.type
    489         ptr<Type> underlyer;
    490         friend class ::ConverterOldToNew;
    491         friend class ::ConverterNewToOld;
    492474};
    493475
     
    779761        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
    780762
    781         friend class ::ConverterOldToNew;
    782 
    783763private:
    784764        TupleAssignExpr * clone() const override { return new TupleAssignExpr{ *this }; }
    785     TupleAssignExpr( const CodeLocation & loc, const Type * result, const StmtExpr * s );
    786 
    787765        MUTATE_FRIEND
    788766};
  • src/CodeGen/CodeGenerator.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // CodeGeneratorNew.cpp --
     7// CodeGenerator.cpp --
    88//
    99// Author           : Andrew Beach
     
    1414//
    1515
    16 #include "CodeGeneratorNew.hpp"
     16#include "CodeGenerator.hpp"
    1717
    1818#include "AST/Print.hpp"
  • src/CodeGen/CodeGenerator.hpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // CodeGeneratorNew.hpp --
     7// CodeGenerator.hpp --
    88//
    99// Author           : Andrew Beach
  • src/CodeGen/GenType.cc

    r5ddb8bf r81da3da4  
    2121#include "AST/Print.hpp"          // for print
    2222#include "AST/Vector.hpp"         // for vector
    23 #include "CodeGeneratorNew.hpp"   // for CodeGenerator
     23#include "CodeGenerator.hpp"      // for CodeGenerator
    2424#include "Common/UniqueName.h"    // for UniqueName
    2525
  • src/CodeGen/GenType.h

    r5ddb8bf r81da3da4  
    2020#include "CodeGen/Options.h" // for Options
    2121
    22 class Type;
    2322namespace ast {
    2423        class Type;
     
    2625
    2726namespace CodeGen {
    28         std::string genType( Type *type, const std::string &baseString, const Options &options );
    29         std::string genType( Type *type, const std::string &baseString, bool pretty = false, bool genC = false, bool lineMarks = false );
    30         std::string genPrettyType( Type * type, const std::string & baseString );
    3127
    3228std::string genType( ast::Type const * type, const std::string & base, const Options & options );
  • src/CodeGen/Generate.cc

    r5ddb8bf r81da3da4  
    1919#include <string>                    // for operator<<
    2020
    21 #include "CodeGeneratorNew.hpp"      // for CodeGenerator, doSemicolon, ...
     21#include "CodeGenerator.hpp"         // for CodeGenerator, doSemicolon, ...
    2222#include "GenType.h"                 // for genPrettyType
    2323
  • src/CodeGen/module.mk

    r5ddb8bf r81da3da4  
    1616
    1717SRC_CODEGEN = \
    18         CodeGen/CodeGeneratorNew.cpp \
    19         CodeGen/CodeGeneratorNew.hpp \
     18        CodeGen/CodeGenerator.cpp \
     19        CodeGen/CodeGenerator.hpp \
    2020        CodeGen/GenType.cc \
    2121        CodeGen/GenType.h \
  • src/Common/Assert.cc

    r5ddb8bf r81da3da4  
    1010// Created On       : Thu Aug 18 13:26:59 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 19 17:07:08 2016
    13 // Update Count     : 10
     12// Last Modified On : Mon Nov 20 22:57:18 2023
     13// Update Count     : 11
    1414//
    1515
     
    3939}
    4040
    41 void abort(const char *fmt, ... ) noexcept __attribute__((noreturn, format(printf, 1, 2)));
    42 void abort(const char *fmt, ... ) noexcept {
     41void abort(const char *fmt, ... ) noexcept __attribute__((noreturn, format(printf, 1, 2)));
     42void abort(const char *fmt, ... ) noexcept {
    4343        va_list args;
    4444        va_start( args, fmt );
  • src/Concurrency/Actors.cpp

    r5ddb8bf r81da3da4  
    265265                decl->location,
    266266                "__CFA_receive_wrap",
    267                 {},                     // forall
    268267                {
    269268                    new ObjectDecl(
     
    288287                    )
    289288                },                      // params
    290                 { 
     289                {
    291290                    new ObjectDecl(
    292291                        decl->location,
     
    400399                                )
    401400                        ));
    402            
     401
    403402            // Generates: return receiver;
    404403            sendBody->push_back( new ReturnStmt( decl->location, new NameExpr( decl->location, "receiver" ) ) );
     
    408407                decl->location,
    409408                "?|?",
    410                 {},                     // forall
    411409                {
    412410                    new ObjectDecl(
     
    421419                    )
    422420                },                      // params
    423                 { 
     421                {
    424422                    new ObjectDecl(
    425423                        decl->location,
     
    434432                { Function::Inline }
    435433            );
    436            
     434
    437435            // forward decls to resolve use before decl problem for '|' routines
    438436            forwardDecls.insertDecl( *actorIter, *messageIter , ast::deepCopy( sendOperatorFunction ) );
  • src/Concurrency/Corun.cpp

    r5ddb8bf r81da3da4  
    113113            new FunctionDecl( loc,
    114114                fnName,                                             // name
    115                 {},                                                 // forall
    116115                {
    117116                    new ObjectDecl( loc,
     
    261260            new FunctionDecl( loc,
    262261                fnName,                                             // name
    263                 {},                                                 // forall
    264262                {},                                                 // params
    265263                {},                                                 // return
  • src/Concurrency/Keywords.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // KeywordsNew.cpp -- Implement concurrency constructs from their keywords.
     7// Keywords.cpp -- Implement concurrency constructs from their keywords.
    88//
    99// Author           : Andrew Beach
     
    1414//
    1515
     16#include "Concurrency/Keywords.h"
     17
    1618#include <iostream>
    17 
    18 #include "Concurrency/Keywords.h"
    1919
    2020#include "AST/Copy.hpp"
     
    3030#include "Common/utility.h"
    3131#include "Common/UniqueName.h"
    32 #include "ControlStruct/LabelGeneratorNew.hpp"
     32#include "ControlStruct/LabelGenerator.hpp"
    3333#include "InitTweak/InitTweak.h"
    3434#include "Virtual/Tables.h"
     
    482482                location,
    483483                getter_name,
    484                 {}, // forall
    485484                { this_decl }, // params
    486485                { ret_decl }, // returns
     
    499498                        location,
    500499                        "main",
    501                         {},
    502500                        { ast::deepCopy( this_decl ) },
    503501                        {},
     
    575573                location,
    576574                "lock",
    577                 { /* forall */ },
    578575                {
    579576                        // Copy the declaration of this.
     
    607604                location,
    608605                "unlock",
    609                 { /* forall */ },
    610606                {
    611607                        // Last use, consume the declaration of this.
  • src/Concurrency/Waitfor.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // WaitforNew.cpp -- Expand waitfor clauses into code.
     7// Waitfor.cpp -- Expand waitfor clauses into code.
    88//
    99// Author           : Andrew Beach
  • src/Concurrency/Waituntil.cpp

    r5ddb8bf r81da3da4  
    553553    return new FunctionDecl( loc,
    554554        predName,
    555         {},                     // forall
    556555        {
    557556            new ObjectDecl( loc,
     
    560559            )
    561560        },
    562         { 
     561        {
    563562            new ObjectDecl( loc,
    564563                "sat_ret",
  • src/Concurrency/module.mk

    r5ddb8bf r81da3da4  
    2020        Concurrency/Corun.cpp \
    2121        Concurrency/Corun.hpp \
    22         Concurrency/KeywordsNew.cpp \
     22        Concurrency/Keywords.cpp \
    2323        Concurrency/Keywords.h \
    24         Concurrency/WaitforNew.cpp \
     24        Concurrency/Waitfor.cpp \
    2525        Concurrency/Waitfor.h \
    2626        Concurrency/Waituntil.cpp \
  • 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
  • src/GenPoly/Box.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // BoxNew.cpp -- Implement polymorphic function calls and types.
     7// Box.cpp -- Implement polymorphic function calls and types.
    88//
    99// Author           : Andrew Beach
     
    3232#include "GenPoly/Lvalue.h"            // for generalizedLvalue
    3333#include "GenPoly/ScopedSet.h"         // for ScopedSet
    34 #include "GenPoly/ScrubTyVars.h"       // for scrubTypeVars, scrubAllTypeVars
     34#include "GenPoly/ScrubTypeVars.hpp"   // for scrubTypeVars, scrubAllTypeVars
    3535#include "ResolvExpr/Unify.h"          // for typesCompatible
    3636#include "SymTab/Mangler.h"            // for mangle, mangleType
     
    3939
    4040namespace {
     41
     42/// The layout type is used to represent sizes, alignments and offsets.
     43ast::BasicType * makeLayoutType() {
     44        return new ast::BasicType( ast::BasicType::LongUnsignedInt );
     45}
     46
     47/// Fixed version of layout type (just adding a 'C' in C++ style).
     48ast::BasicType * makeLayoutCType() {
     49        return new ast::BasicType( ast::BasicType::LongUnsignedInt,
     50                ast::CV::Qualifiers( ast::CV::Const ) );
     51}
    4152
    4253// --------------------------------------------------------------------------
     
    6071        }
    6172        return sizedParams;
    62 }
    63 
    64 ast::BasicType * makeSizeAlignType() {
    65         return new ast::BasicType( ast::BasicType::LongUnsignedInt );
    6673}
    6774
     
    7683                        sizedParam->location,
    7784                        sizeofName( paramName ),
    78                         makeSizeAlignType()
     85                        makeLayoutCType()
    7986                ) );
    8087                params.emplace_back( new ast::ObjectDecl(
    8188                        sizedParam->location,
    8289                        alignofName( paramName ),
    83                         makeSizeAlignType()
     90                        makeLayoutCType()
    8491                ) );
    8592        }
    8693}
    8794
    88 ast::Type * makeSizeAlignOutType() {
    89         return new ast::PointerType( makeSizeAlignType() );
     95ast::Type * makeLayoutOutType() {
     96        return new ast::PointerType( makeLayoutType() );
    9097}
    9198
     
    104111                location,
    105112                sizeofName( aggr->name ),
    106                 makeSizeAlignOutType()
     113                makeLayoutOutType()
    107114        );
    108115        ast::ObjectDecl * alignParam = new ast::ObjectDecl(
    109116                location,
    110117                alignofName( aggr->name ),
    111                 makeSizeAlignOutType()
     118                makeLayoutOutType()
    112119        );
    113120        ast::ObjectDecl * offsetParam = nullptr;
     
    117124                        location,
    118125                        offsetofName( aggr->name ),
    119                         makeSizeAlignOutType()
     126                        makeLayoutOutType()
    120127                );
    121128                params.push_back( offsetParam );
     
    13721379};
    13731380
    1374 // size/align/offset parameters may not be used, so add the unused attribute.
    13751381ast::ObjectDecl * makeObj(
    13761382                CodeLocation const & location, std::string const & name ) {
     1383        // The size/align parameters may be unused, so add the unused attribute.
    13771384        return new ast::ObjectDecl( location, name,
    1378                 makeSizeAlignType(),
     1385                makeLayoutCType(),
    13791386                nullptr, ast::Storage::Classes(), ast::Linkage::C, nullptr,
    13801387                { new ast::Attribute( "unused" ) } );
     1388}
     1389
     1390/// A modified and specialized version of ast::add_qualifiers.
     1391ast::Type const * addConst( ast::Type const * type ) {
     1392        ast::CV::Qualifiers cvq = { ast::CV::Const };
     1393        if ( ( type->qualifiers & cvq ) != 0 ) return type;
     1394        auto mutType = ast::mutate( type );
     1395        mutType->qualifiers |= cvq;
     1396        return mutType;
    13811397}
    13821398
     
    14181434        }
    14191435        for ( ast::ptr<ast::DeclWithType> & assert : mutDecl->assertions ) {
     1436                ast::DeclWithType * mutAssert = ast::mutate( assert.get() );
    14201437                // Assertion parameters may not be used in body,
    14211438                // pass along with unused attribute.
    1422                 assert.get_and_mutate()->attributes.push_back(
    1423                         new ast::Attribute( "unused" ) );
    1424                 inferredParams.push_back( assert );
     1439                mutAssert->attributes.push_back( new ast::Attribute( "unused" ) );
     1440                mutAssert->set_type( addConst( mutAssert->get_type() ) );
     1441                inferredParams.emplace_back( mutAssert );
    14251442        }
    14261443        mutDecl->assertions.clear();
     
    16091626
    16101627/// Converts polymorphic type into a suitable monomorphic representation.
    1611 /// Currently: __attribute__((aligned(8) )) char[size_T];
     1628/// Currently: __attribute__(( aligned(8) )) char[size_T];
    16121629ast::Type * polyToMonoType( CodeLocation const & location,
    16131630                ast::Type const * declType ) {
     
    16151632        auto size = new ast::NameExpr( location,
    16161633                sizeofName( Mangle::mangleType( declType ) ) );
    1617         auto aligned = new ast::Attribute( "aligned",
    1618                 { ast::ConstantExpr::from_int( location, 8 ) } );
    16191634        auto ret = new ast::ArrayType( charType, size,
    16201635                ast::VariableLen, ast::DynamicDim, ast::CV::Qualifiers() );
    1621         ret->attributes.push_back( aligned );
     1636        ret->attributes.emplace_back( new ast::Attribute( "aligned",
     1637                { ast::ConstantExpr::from_int( location, 8 ) } ) );
    16221638        return ret;
    16231639}
     
    16451661        ast::TypeInstType inst( decl->name, decl );
    16461662        std::string typeName = Mangle::mangleType( &inst );
    1647         ast::Type * layoutType = new ast::BasicType(
    1648                 ast::BasicType::LongUnsignedInt );
    16491663
    16501664        ast::ObjectDecl * sizeDecl = new ast::ObjectDecl( decl->location,
    1651                 sizeofName( typeName ), layoutType,
     1665                sizeofName( typeName ), makeLayoutCType(),
    16521666                new ast::SingleInit( decl->location,
    16531667                        new ast::SizeofExpr( decl->location, deepCopy( base ) )
     
    16551669        );
    16561670        ast::ObjectDecl * alignDecl = new ast::ObjectDecl( decl->location,
    1657                 alignofName( typeName ), layoutType,
     1671                alignofName( typeName ), makeLayoutCType(),
    16581672                new ast::SingleInit( decl->location,
    16591673                        new ast::AlignofExpr( decl->location, deepCopy( base ) )
     
    17521766long findMember( ast::DeclWithType const * memberDecl,
    17531767                const ast::vector<ast::Decl> & baseDecls ) {
    1754         for ( auto pair : enumerate( baseDecls ) ) {
    1755                 if ( isMember( memberDecl, pair.val.get() ) ) {
    1756                         return pair.idx;
     1768        for ( auto const & [index, value] : enumerate( baseDecls ) ) {
     1769                if ( isMember( memberDecl, value.get() ) ) {
     1770                        return index;
    17571771                }
    17581772        }
     
    19121926        knownOffsets.insert( offsetName );
    19131927
    1914         auto baseMembers = type->base->members;
    1915         ast::Type const * offsetType = new ast::BasicType(
    1916                 ast::BasicType::LongUnsignedInt );
    1917 
    19181928        // Build initializer list for offset array.
    19191929        ast::vector<ast::Init> inits;
    1920         for ( ast::ptr<ast::Decl> & member : baseMembers ) {
     1930        for ( ast::ptr<ast::Decl> const & member : type->base->members ) {
    19211931                auto memberDecl = member.as<ast::DeclWithType>();
    19221932                assertf( memberDecl, "Requesting offset of non-DWT member: %s",
     
    19321942        auto offsetArray = makeVar( expr->location, offsetName,
    19331943                new ast::ArrayType(
    1934                         offsetType,
    1935                         ast::ConstantExpr::from_ulong( expr->location, baseMembers.size() ),
     1944                        makeLayoutType(),
     1945                        ast::ConstantExpr::from_ulong( expr->location, inits.size() ),
    19361946                        ast::FixedLen,
    19371947                        ast::DynamicDim
     
    20122022                // parameters to the layout call.
    20132023                knownLayouts.insert( typeName );
    2014                 ast::Type const * layoutType = makeSizeAlignType();
    20152024
    20162025                int memberCount = inst->base->members.size();
     
    20182027                        // All empty structures have the same layout (size 1, align 1).
    20192028                        makeVar( location,
    2020                                 sizeofName( typeName ), layoutType,
     2029                                sizeofName( typeName ), makeLayoutType(),
    20212030                                new ast::SingleInit( location,
    20222031                                                ast::ConstantExpr::from_ulong( location, 1 ) ) );
    20232032                        makeVar( location,
    2024                                 alignofName( typeName ), ast::deepCopy( layoutType ),
     2033                                alignofName( typeName ), makeLayoutType(),
    20252034                                new ast::SingleInit( location,
    20262035                                                ast::ConstantExpr::from_ulong( location, 1 ) ) );
     
    20282037                } else {
    20292038                        ast::ObjectDecl const * sizeofVar = makeVar( location,
    2030                                 sizeofName( typeName ), deepCopy( layoutType ), nullptr );
     2039                                sizeofName( typeName ), makeLayoutType(), nullptr );
    20312040                        ast::ObjectDecl const * alignofVar = makeVar( location,
    2032                                 alignofName( typeName ), deepCopy( layoutType ), nullptr );
     2041                                alignofName( typeName ), makeLayoutType(), nullptr );
    20332042                        ast::ObjectDecl const * offsetofVar = makeVar( location,
    20342043                                offsetofName( typeName ),
    20352044                                new ast::ArrayType(
    2036                                         layoutType,
     2045                                        makeLayoutType(),
    20372046                                        ast::ConstantExpr::from_int( location, memberCount ),
    20382047                                        ast::FixedLen,
     
    20782087                // parameters to the layout call.
    20792088                knownLayouts.insert( typeName );
    2080                 ast::Type const * layoutType = makeSizeAlignType();
    20812089
    20822090                ast::ObjectDecl * sizeofVar = makeVar( location,
    2083                         sizeofName( typeName ), layoutType );
     2091                        sizeofName( typeName ), makeLayoutType() );
    20842092                ast::ObjectDecl * alignofVar = makeVar( location,
    2085                         alignofName( typeName ), ast::deepCopy( layoutType ) );
     2093                        alignofName( typeName ), makeLayoutType() );
    20862094
    20872095                ast::UntypedExpr * layoutCall = new ast::UntypedExpr( location,
  • src/GenPoly/FindFunction.cc

    r5ddb8bf r81da3da4  
    2222#include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::iterator
    2323#include "GenPoly/GenPoly.h"            // for TyVarMap
    24 #include "ScrubTyVars.h"                // for ScrubTyVars
     24#include "ScrubTypeVars.hpp"            // for scrubTypeVars
    2525
    2626namespace GenPoly {
  • src/GenPoly/InstantiateGeneric.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // InstantiateGenericNew.cpp -- Create concrete instances of generic types.
     7// InstantiateGeneric.cpp -- Create concrete instances of generic types.
    88//
    99// Author           : Andrew Beach
     
    3131#include "Common/UniqueName.h"         // for UniqueName
    3232#include "GenPoly/GenPoly.h"           // for isPolyType, typesPolyCompatible
    33 #include "GenPoly/ScrubTyVars.h"       // for scrubAll
     33#include "GenPoly/ScrubTypeVars.hpp"   // for scrubAllTypeVars
    3434#include "ResolvExpr/AdjustExprType.hpp"  // for adjustExprType
    3535#include "ResolvExpr/Unify.h"          // for typesCompatible
  • src/GenPoly/Lvalue.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // LvalueNew.cpp -- Clean up lvalues and remove references.
     7// Lvalue.cpp -- Clean up lvalues and remove references.
    88//
    99// Author           : Andrew Beach
  • src/GenPoly/ScrubTypeVars.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ScrubTyVars.cc -- Remove polymorphic types.
     7// ScrubTypeVars.cpp -- Remove polymorphic types.
    88//
    99// Author           : Richard C. Bilson
     
    1414//
    1515
     16#include "ScrubTypeVars.hpp"
     17
    1618#include <utility>                      // for pair
    1719
     
    1921#include "GenPoly.h"                    // for mangleType, TyVarMap, alignof...
    2022#include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::const_it...
    21 #include "ScrubTyVars.h"
    2223#include "SymTab/Mangler.h"             // for mangleType
    2324
  • src/GenPoly/ScrubTypeVars.hpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ScrubTyVars.h -- Remove polymorphic types.
     7// ScrubTypeVars.hpp -- Remove polymorphic types.
    88//
    99// Author           : Richard C. Bilson
     
    1616#pragma once
    1717
    18 #include <cassert>            // for assert
     18#include <cassert>            // for strict_dynamic_cast
    1919
    2020#include "AST/Fwd.hpp"        // for Node
    21 #include "GenPoly.h"          // for TypeVarMap, isPolyType, isDynType
     21#include "GenPoly.h"          // for TypeVarMap
    2222
    2323namespace GenPoly {
  • src/GenPoly/Specialize.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // SpecializeNew.cpp -- Generate thunks to specialize polymorphic functions.
     7// Specialize.cpp -- Generate thunks to specialize polymorphic functions.
    88//
    99// Author           : Andrew Beach
  • src/GenPoly/module.mk

    r5ddb8bf r81da3da4  
    2222
    2323SRC += $(SRC_GENPOLY) \
    24         GenPoly/BoxNew.cpp \
     24        GenPoly/Box.cpp \
    2525        GenPoly/Box.h \
    2626        GenPoly/ErasableScopedMap.h \
    2727        GenPoly/FindFunction.cc \
    2828        GenPoly/FindFunction.h \
    29         GenPoly/InstantiateGenericNew.cpp \
     29        GenPoly/InstantiateGeneric.cpp \
    3030        GenPoly/InstantiateGeneric.h \
    31         GenPoly/LvalueNew.cpp \
     31        GenPoly/Lvalue.cpp \
    3232        GenPoly/ScopedSet.h \
    33         GenPoly/ScrubTyVars.cc \
    34         GenPoly/ScrubTyVars.h \
    35         GenPoly/SpecializeNew.cpp \
     33        GenPoly/ScrubTypeVars.cpp \
     34        GenPoly/ScrubTypeVars.hpp \
     35        GenPoly/Specialize.cpp \
    3636        GenPoly/Specialize.h
    3737
  • src/InitTweak/FixGlobalInit.cc

    r5ddb8bf r81da3da4  
    8484                if (inLibrary) ctorParams.emplace_back(ast::ConstantExpr::from_int(location, 200));
    8585                auto initFunction = new ast::FunctionDecl(location,
    86                         "__global_init__", {}, {}, {},
     86                        "__global_init__", {}, {}, {}, {},
    8787                        new ast::CompoundStmt(location, std::move(fixer.core.initStmts)),
    8888                        ast::Storage::Static, ast::Linkage::C,
     
    9696                if (inLibrary) dtorParams.emplace_back(ast::ConstantExpr::from_int(location, 200));
    9797                auto destroyFunction = new ast::FunctionDecl( location,
    98                         "__global_destroy__", {}, {}, {},
     98                        "__global_destroy__", {}, {}, {}, {},
    9999                        new ast::CompoundStmt(location, std::move(fixer.core.destroyStmts)),
    100100                        ast::Storage::Static, ast::Linkage::C,
  • src/InitTweak/FixInit.cpp

    r5ddb8bf r81da3da4  
    7474                fname,
    7575                std::move(typeParams),
     76                {},
    7677                {dstParam},
    7778                {},
     
    899900
    900901                                        // void __objName_dtor_atexitN(...) {...}
    901                                         ast::FunctionDecl * dtorCaller = new ast::FunctionDecl(loc, objDecl->mangleName + dtorCallerNamer.newName(), {}, {}, {}, new ast::CompoundStmt(loc, {dtor}), ast::Storage::Static, ast::Linkage::C );
     902                                        ast::FunctionDecl * dtorCaller = new ast::FunctionDecl(loc, objDecl->mangleName + dtorCallerNamer.newName(), {}, {}, {}, {}, new ast::CompoundStmt(loc, {dtor}), ast::Storage::Static, ast::Linkage::C );
    902903                                        dtorCaller->fixUniqueId();
    903904                                        // dtorCaller->stmts->push_back( dtor );
  • src/InitTweak/InitTweak.cc

    r5ddb8bf r81da3da4  
    342342        if (!assign) {
    343343                auto td = new ast::TypeDecl(CodeLocation(), "T", {}, nullptr, ast::TypeDecl::Dtype, true);
    344                 assign = new ast::FunctionDecl(CodeLocation(), "?=?", {td},
     344                assign = new ast::FunctionDecl(CodeLocation(), "?=?", {td}, {},
    345345                { new ast::ObjectDecl(CodeLocation(), "_dst", new ast::ReferenceType(new ast::TypeInstType("T", td))),
    346346                  new ast::ObjectDecl(CodeLocation(), "_src", new ast::TypeInstType("T", td))},
  • src/InitTweak/module.mk

    r5ddb8bf r81da3da4  
    2424        InitTweak/FixGlobalInit.cc \
    2525        InitTweak/FixGlobalInit.h \
    26         InitTweak/FixInit.h \
    27         InitTweak/FixInitNew.cpp
     26        InitTweak/FixInit.cpp \
     27        InitTweak/FixInit.h
    2828
    2929SRCDEMANGLE += $(SRC_INITTWEAK)
  • src/MakeLibCfa.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // MakeLibCfaNew.cpp --
     7// MakeLibCfa.cpp --
    88//
    99// Author           : Henry Xue
  • src/Makefile.am

    r5ddb8bf r81da3da4  
    2222        CompilationState.cc \
    2323        CompilationState.h \
    24         MakeLibCfaNew.cpp \
     24        MakeLibCfa.cpp \
    2525        MakeLibCfa.h
    2626
     
    7272
    7373cfa_cpplib_PROGRAMS += $(DEMANGLER)
    74 EXTRA_PROGRAMS = demangler
    75 demangler_SOURCES = SymTab/demangler.cc # test driver for the demangler, also useful as a sanity check that libdemangle.a is complete
    76 demangler_LDADD = libdemangle.a -ldl                    # yywrap
     74EXTRA_PROGRAMS = ../driver/demangler
     75___driver_demangler_SOURCES = SymTab/demangler.cc # test driver for the demangler, also useful as a sanity check that libdemangle.a is complete
     76___driver_demangler_LDADD = libdemangle.a -ldl                  # yywrap
    7777noinst_LIBRARIES = $(LIBDEMANGLE)
    7878EXTRA_LIBRARIES = libdemangle.a
  • src/Parser/ParseNode.h

    r5ddb8bf r81da3da4  
    3333#include "Parser/parserutility.h"  // for maybeBuild, maybeCopy
    3434
    35 class Attribute;
    36 class Declaration;
    3735struct DeclarationNode;
    38 class DeclarationWithType;
    39 class Initializer;
    4036class InitializerNode;
    4137class ExpressionNode;
  • src/Parser/TypeData.h

    r5ddb8bf r81da3da4  
    133133        ast::Init * init = nullptr, std::vector<ast::ptr<ast::Attribute>> && attributes = std::vector<ast::ptr<ast::Attribute>>() );
    134134ast::FunctionType * buildFunctionType( const TypeData * );
    135 ast::Decl * addEnumBase( Declaration *, const TypeData * );
    136135void buildKRFunction( const TypeData::Function_t & function );
    137136
  • src/ResolvExpr/CandidateFinder.cpp

    r5ddb8bf r81da3da4  
    105105
    106106                        // CandidateFinder finder{ symtab, env };
    107                         // finder.find( arg, ResolvMode::withAdjustment() );
     107                        // finder.find( arg, ResolveMode::withAdjustment() );
    108108                        // assertf( finder.candidates.size() > 0,
    109109                        //      "Somehow castable expression failed to find alternatives." );
     
    974974                // xxx - is it possible that handleTupleAssignment and main finder both produce candidates?
    975975                // this means there exists ctor/assign functions with a tuple as first parameter.
    976                 ResolvMode mode = {
     976                ResolveMode mode = {
    977977                        true, // adjust
    978978                        !untypedExpr->func.as<ast::NameExpr>(), // prune if not calling by name
     
    989989                CandidateFinder opFinder( context, tenv );
    990990                // okay if there aren't any function operations
    991                 opFinder.find( opExpr, ResolvMode::withoutFailFast() );
     991                opFinder.find( opExpr, ResolveMode::withoutFailFast() );
    992992                PRINT(
    993993                        std::cerr << "known function ops:" << std::endl;
     
    11751175                if ( castExpr->kind == ast::CastExpr::Return ) {
    11761176                        finder.strictMode = true;
    1177                         finder.find( castExpr->arg, ResolvMode::withAdjustment() );
     1177                        finder.find( castExpr->arg, ResolveMode::withAdjustment() );
    11781178
    11791179                        // return casts are eliminated (merely selecting an overload, no actual operation)
    11801180                        candidates = std::move(finder.candidates);
    11811181                }
    1182                 finder.find( castExpr->arg, ResolvMode::withAdjustment() );
     1182                finder.find( castExpr->arg, ResolveMode::withAdjustment() );
    11831183
    11841184                if ( !finder.candidates.empty() ) reason.code = NoMatch;
     
    12511251                CandidateFinder finder( context, tenv );
    12521252                // don't prune here, all alternatives guaranteed to have same type
    1253                 finder.find( castExpr->arg, ResolvMode::withoutPrune() );
     1253                finder.find( castExpr->arg, ResolveMode::withoutPrune() );
    12541254                for ( CandidateRef & r : finder.candidates ) {
    12551255                        addCandidate(
     
    12981298
    12991299                        // don't prune here, since it's guaranteed all alternatives will have the same type
    1300                         finder.find( tech1.get(), ResolvMode::withoutPrune() );
     1300                        finder.find( tech1.get(), ResolveMode::withoutPrune() );
    13011301                        pick_alternatives(finder.candidates, false);
    13021302
     
    13071307                std::unique_ptr<const ast::Expr> fallback { ast::UntypedExpr::createDeref(loc,  new ast::UntypedExpr(loc, new ast::NameExpr(loc, castExpr->concrete_target.getter), { castExpr->arg })) };
    13081308                // don't prune here, since it's guaranteed all alternatives will have the same type
    1309                 finder.find( fallback.get(), ResolvMode::withoutPrune() );
     1309                finder.find( fallback.get(), ResolveMode::withoutPrune() );
    13101310
    13111311                pick_alternatives(finder.candidates, true);
     
    13161316        void Finder::postvisit( const ast::UntypedMemberExpr * memberExpr ) {
    13171317                CandidateFinder aggFinder( context, tenv );
    1318                 aggFinder.find( memberExpr->aggregate, ResolvMode::withAdjustment() );
     1318                aggFinder.find( memberExpr->aggregate, ResolveMode::withAdjustment() );
    13191319                for ( CandidateRef & agg : aggFinder.candidates ) {
    13201320                        // it's okay for the aggregate expression to have reference type -- cast it to the
     
    14751475        void Finder::postvisit( const ast::LogicalExpr * logicalExpr ) {
    14761476                CandidateFinder finder1( context, tenv );
    1477                 finder1.find( logicalExpr->arg1, ResolvMode::withAdjustment() );
     1477                finder1.find( logicalExpr->arg1, ResolveMode::withAdjustment() );
    14781478                if ( finder1.candidates.empty() ) return;
    14791479
    14801480                CandidateFinder finder2( context, tenv );
    1481                 finder2.find( logicalExpr->arg2, ResolvMode::withAdjustment() );
     1481                finder2.find( logicalExpr->arg2, ResolveMode::withAdjustment() );
    14821482                if ( finder2.candidates.empty() ) return;
    14831483
     
    15051505                // candidates for condition
    15061506                CandidateFinder finder1( context, tenv );
    1507                 finder1.find( conditionalExpr->arg1, ResolvMode::withAdjustment() );
     1507                finder1.find( conditionalExpr->arg1, ResolveMode::withAdjustment() );
    15081508                if ( finder1.candidates.empty() ) return;
    15091509
     
    15111511                CandidateFinder finder2( context, tenv );
    15121512                finder2.allowVoid = true;
    1513                 finder2.find( conditionalExpr->arg2, ResolvMode::withAdjustment() );
     1513                finder2.find( conditionalExpr->arg2, ResolveMode::withAdjustment() );
    15141514                if ( finder2.candidates.empty() ) return;
    15151515
     
    15171517                CandidateFinder finder3( context, tenv );
    15181518                finder3.allowVoid = true;
    1519                 finder3.find( conditionalExpr->arg3, ResolvMode::withAdjustment() );
     1519                finder3.find( conditionalExpr->arg3, ResolveMode::withAdjustment() );
    15201520                if ( finder3.candidates.empty() ) return;
    15211521
     
    15701570
    15711571                CandidateFinder finder2( context, env );
    1572                 finder2.find( commaExpr->arg2, ResolvMode::withAdjustment() );
     1572                finder2.find( commaExpr->arg2, ResolveMode::withAdjustment() );
    15731573
    15741574                for ( const CandidateRef & r2 : finder2.candidates ) {
     
    15841584                CandidateFinder finder( context, tenv );
    15851585                finder.allowVoid = true;
    1586                 finder.find( ctorExpr->callExpr, ResolvMode::withoutPrune() );
     1586                finder.find( ctorExpr->callExpr, ResolveMode::withoutPrune() );
    15871587                for ( CandidateRef & r : finder.candidates ) {
    15881588                        addCandidate( *r, new ast::ConstructorExpr{ ctorExpr->location, r->expr } );
     
    15931593                // resolve low and high, accept candidates where low and high types unify
    15941594                CandidateFinder finder1( context, tenv );
    1595                 finder1.find( rangeExpr->low, ResolvMode::withAdjustment() );
     1595                finder1.find( rangeExpr->low, ResolveMode::withAdjustment() );
    15961596                if ( finder1.candidates.empty() ) return;
    15971597
    15981598                CandidateFinder finder2( context, tenv );
    1599                 finder2.find( rangeExpr->high, ResolvMode::withAdjustment() );
     1599                finder2.find( rangeExpr->high, ResolveMode::withAdjustment() );
    16001600                if ( finder2.candidates.empty() ) return;
    16011601
     
    16731673        void Finder::postvisit( const ast::UniqueExpr * unqExpr ) {
    16741674                CandidateFinder finder( context, tenv );
    1675                 finder.find( unqExpr->expr, ResolvMode::withAdjustment() );
     1675                finder.find( unqExpr->expr, ResolveMode::withAdjustment() );
    16761676                for ( CandidateRef & r : finder.candidates ) {
    16771677                        // ensure that the the id is passed on so that the expressions are "linked"
     
    16991699                        // only open for the duration of resolving the UntypedExpr.
    17001700                        CandidateFinder finder( context, tenv, toType );
    1701                         finder.find( initExpr->expr, ResolvMode::withAdjustment() );
     1701                        finder.find( initExpr->expr, ResolveMode::withAdjustment() );
    17021702
    17031703                        Cost minExprCost = Cost::infinity;
     
    18891889}
    18901890
    1891 void CandidateFinder::find( const ast::Expr * expr, ResolvMode mode ) {
     1891void CandidateFinder::find( const ast::Expr * expr, ResolveMode mode ) {
    18921892        // Find alternatives for expression
    18931893        ast::Pass<Finder> finder{ *this };
     
    20042004        for ( const auto & x : xs ) {
    20052005                out.emplace_back( context, env );
    2006                 out.back().find( x, ResolvMode::withAdjustment() );
     2006                out.back().find( x, ResolveMode::withAdjustment() );
    20072007
    20082008                PRINT(
  • src/ResolvExpr/CandidateFinder.hpp

    r5ddb8bf r81da3da4  
    1717
    1818#include "Candidate.hpp"
    19 #include "ResolvMode.h"
     19#include "ResolveMode.hpp"
    2020#include "AST/Fwd.hpp"
    2121#include "AST/Node.hpp"
     
    4343
    4444        /// Fill candidates with feasible resolutions for `expr`
    45         void find( const ast::Expr * expr, ResolvMode mode = {} );
     45        void find( const ast::Expr * expr, ResolveMode mode = {} );
    4646        bool pruneCandidates( CandidateList & candidates, CandidateList & out, std::vector<std::string> & errors );
    4747
  • src/ResolvExpr/CandidatePrinter.cpp

    r5ddb8bf r81da3da4  
    1616#include "CandidatePrinter.hpp"
    1717
     18#include <iostream>
     19
    1820#include "AST/Expr.hpp"
    1921#include "AST/Pass.hpp"
     
    2325#include "ResolvExpr/CandidateFinder.hpp"
    2426#include "ResolvExpr/Resolver.h"
    25 
    26 #include <iostream>
    2727
    2828namespace ResolvExpr {
     
    3939                ast::TypeEnvironment env;
    4040                CandidateFinder finder( { symtab, transUnit().global }, env );
    41                 finder.find( stmt->expr, ResolvMode::withAdjustment() );
     41                finder.find( stmt->expr, ResolveMode::withAdjustment() );
    4242                int count = 1;
    4343                os << "There are " << finder.candidates.size() << " candidates\n";
  • src/ResolvExpr/CurrentObject.cc

    r5ddb8bf r81da3da4  
    498498                PRINT( std::cerr << "____untyped: " << expr << std::endl; )
    499499                auto dit = desigAlts.begin();
     500                auto nexpr = dynamic_cast< const NameExpr * >( expr );
    500501
    501502                for ( const Type * t : curTypes ) {
    502503                        assert( dit != desigAlts.end() );
    503504                        DesignatorChain & d = *dit;
    504                         if ( auto nexpr = dynamic_cast< const NameExpr *>( expr ) ) {
     505                        // Name Designation:
     506                        if ( nexpr ) {
    505507                                PRINT( std::cerr << "____actual: " << t << std::endl; )
    506508                                if ( auto refType = dynamic_cast< const BaseInstType * >( t ) ) {
     
    515517                                                }
    516518                                        }
    517                                 } else if ( auto at = dynamic_cast< const ArrayType * >( t ) ) {
    518                                         auto nexpr = dynamic_cast< const NameExpr *>( expr );
    519                                         for ( const Decl * mem : refType->lookup( nexpr->name ) ) {
    520                                                 if ( auto field = dynamic_cast< const ObjectDecl * >( mem ) ) {
    521                                                         DesignatorChain d2 = d;
    522                                                         d2.emplace_back( new VariableExpr{ expr->location, field } );
    523                                                         newDesigAlts.emplace_back( std::move( d2 ) );
    524                                                         newTypes.emplace_back( at->base );
    525                                                 }
    526                                         }
    527519                                }
    528520
    529521                                ++dit;
     522                        // Index Designation:
    530523                        } else {
    531524                                if ( auto at = dynamic_cast< const ArrayType * >( t ) ) {
  • src/ResolvExpr/ResolveMode.hpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ResolvMode.h --
     7// ResolveMode.hpp --
    88//
    99// Author           : Aaron B. Moss
     
    1919
    2020/// Flag set for resolution
    21 struct ResolvMode {
     21struct ResolveMode {
    2222        const bool adjust;                       ///< Adjust array and function types to pointer types? [false]
    2323        const bool prune;            ///< Prune alternatives to min-cost per return type? [true]
    2424        const bool failFast;         ///< Fail on no resulting alternatives? [true]
    2525
    26         constexpr ResolvMode(bool a, bool p, bool ff)
     26        constexpr ResolveMode(bool a, bool p, bool ff)
    2727        : adjust(a), prune(p), failFast(ff) {}
    2828
    2929        /// Default settings
    30         constexpr ResolvMode() : adjust(false), prune(true), failFast(true) {}
     30        constexpr ResolveMode() : adjust(false), prune(true), failFast(true) {}
    3131
    3232        /// With adjust flag set; turns array and function types into equivalent pointers
    33         static constexpr ResolvMode withAdjustment() { return { true, true, true }; }
     33        static constexpr ResolveMode withAdjustment() { return { true, true, true }; }
    3434
    3535        /// With adjust flag set but prune unset; pruning ensures there is at least one alternative
    3636        /// per result type
    37         static constexpr ResolvMode withoutPrune() { return { true, false, true }; }
     37        static constexpr ResolveMode withoutPrune() { return { true, false, true }; }
    3838
    3939        /// With adjust and prune flags set but failFast unset; failFast ensures there is at least
    4040        /// one resulting alternative
    41         static constexpr ResolvMode withoutFailFast() { return { true, true, false }; }
     41        static constexpr ResolveMode withoutFailFast() { return { true, true, false }; }
    4242
    4343        /// The same mode, but with satisfyAssns turned on; for top-level calls
    44         ResolvMode atTopLevel() const { return { adjust, true, failFast }; }
     44        ResolveMode atTopLevel() const { return { adjust, true, failFast }; }
    4545};
    4646
  • src/ResolvExpr/Resolver.cc

    r5ddb8bf r81da3da4  
    2525#include "Resolver.h"
    2626#include "ResolveTypeof.h"
    27 #include "ResolvMode.h"                  // for ResolvMode
     27#include "ResolveMode.hpp"               // for ResolveMode
    2828#include "typeops.h"                     // for extractResultType
    2929#include "Unify.h"                       // for unify
    3030#include "CompilationState.h"
    31 #include "AST/Chain.hpp"
    3231#include "AST/Decl.hpp"
    3332#include "AST/Init.hpp"
     
    104103                                                                }
    105104                                                        }
    106                                                 } 
    107                                         } 
     105                                                }
     106                                        }
    108107                                        visit_children = false;
    109108                                }
     
    123122                CandidateRef findUnfinishedKindExpression(
    124123                        const ast::Expr * untyped, const ResolveContext & context, const std::string & kind,
    125                         std::function<bool(const Candidate &)> pred = anyCandidate, ResolvMode mode = {}
     124                        std::function<bool(const Candidate &)> pred = anyCandidate, ResolveMode mode = {}
    126125                ) {
    127126                        if ( ! untyped ) return nullptr;
     
    263262                ast::ptr< ast::CastExpr > untyped = new ast::CastExpr{ expr };
    264263                CandidateRef choice = findUnfinishedKindExpression(
    265                         untyped, context, "", anyCandidate, ResolvMode::withAdjustment() );
     264                        untyped, context, "", anyCandidate, ResolveMode::withAdjustment() );
    266265
    267266                // a cast expression has either 0 or 1 interpretations (by language rules);
     
    292291                        const ast::Expr * untyped, const ResolveContext & context,
    293292                        std::function<bool(const Candidate &)> pred = anyCandidate,
    294                         const std::string & kind = "", ResolvMode mode = {}
     293                        const std::string & kind = "", ResolveMode mode = {}
    295294                ) {
    296295                        if ( ! untyped ) return {};
     
    607606                                ( objectDecl->get_type() )->base->base ) {
    608607                                objectDecl = fixObjectType( objectDecl, context );
    609                                 currentObject = ast::CurrentObject{ 
    610                                         objectDecl->location, 
     608                                currentObject = ast::CurrentObject{
     609                                        objectDecl->location,
    611610                                        enumBase
    612611                                };
     
    860859
    861860                        // Find all candidates for a function in canonical form
    862                         funcFinder.find( clause.target, ResolvMode::withAdjustment() );
     861                        funcFinder.find( clause.target, ResolveMode::withAdjustment() );
    863862
    864863                        if ( funcFinder.candidates.empty() ) {
  • src/ResolvExpr/module.mk

    r5ddb8bf r81da3da4  
    4747      ResolvExpr/ResolveTypeof.cc \
    4848      ResolvExpr/ResolveTypeof.h \
    49       ResolvExpr/ResolvMode.h \
     49      ResolvExpr/ResolveMode.hpp \
    5050      ResolvExpr/SatisfyAssertions.cpp \
    5151      ResolvExpr/SatisfyAssertions.hpp \
  • src/Tuples/TupleAssignment.cc

    r5ddb8bf r81da3da4  
    1313// Update Count     : 10
    1414//
     15
     16#include "Tuples.h"
    1517
    1618#include <algorithm>                       // for transform
     
    224226                                // by the cast type as needed, and transfer the resulting environment.
    225227                                ResolvExpr::CandidateFinder finder( spotter.crntFinder.context, env );
    226                                 finder.find( rhsCand->expr, ResolvExpr::ResolvMode::withAdjustment() );
     228                                finder.find( rhsCand->expr, ResolvExpr::ResolveMode::withAdjustment() );
    227229                                assert( 1 == finder.candidates.size() );
    228230                                env = std::move( finder.candidates.front()->env );
     
    345347
    346348                        try {
    347                                 finder.find( expr, ResolvExpr::ResolvMode::withAdjustment() );
     349                                finder.find( expr, ResolvExpr::ResolveMode::withAdjustment() );
    348350                        } catch (...) {
    349351                                // No match is not failure, just that this tuple assignment is invalid.
  • src/Tuples/TupleExpansion.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // TupleExpansionNew.cpp --
     7// TupleExpansion.cpp --
    88//
    99// Author           : Henry Xue
     
    294294}
    295295
     296const ast::Type * makeTupleType( const std::vector<ast::ptr<ast::Expr>> & exprs ) {
     297        // If there are no expressions, the answer is set, otherwise go through a loop.
     298        if ( exprs.empty() ) return new ast::TupleType( {} );
     299
     300        std::vector<ast::ptr<ast::Type>> types;
     301        ast::CV::Qualifiers quals(
     302                ast::CV::Const | ast::CV::Volatile | ast::CV::Restrict |
     303                ast::CV::Atomic | ast::CV::Mutex );
     304
     305        for ( const ast::Expr * expr : exprs ) {
     306                assert( expr->result );
     307                // If the type of any expr is void, the type of the entire tuple is void.
     308                if ( expr->result->isVoid() ) return new ast::VoidType();
     309
     310                // Qualifiers on the tuple type are the qualifiers that exist on all components.
     311                quals &= expr->result->qualifiers;
     312
     313                types.emplace_back( expr->result );
     314        }
     315
     316        return new ast::TupleType( std::move( types ), quals );
     317}
     318
     319const ast::TypeInstType * isTtype( const ast::Type * type ) {
     320        if ( const ast::TypeInstType * inst = dynamic_cast< const ast::TypeInstType * >( type ) ) {
     321                if ( inst->base && inst->base->kind == ast::TypeDecl::Ttype ) {
     322                        return inst;
     323                }
     324        }
     325        return nullptr;
     326}
     327
    296328} // namespace Tuples
     329
  • src/Tuples/module.mk

    r5ddb8bf r81da3da4  
    1919        Tuples/Explode.h \
    2020        Tuples/TupleAssignment.cc \
    21         Tuples/TupleExpansion.cc \
    22         Tuples/TupleExpansionNew.cpp \
     21        Tuples/TupleExpansion.cpp \
    2322        Tuples/Tuples.cc \
    2423        Tuples/Tuples.h
  • src/Validate/FindSpecialDecls.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FindSpecialDeclsNew.cpp -- Find special declarations used in the compiler.
     7// FindSpecialDecls.cpp -- Find special declarations used in the compiler.
    88//
    99// Author           : Andrew Beach
  • src/Validate/FixReturnTypes.cpp

    r5ddb8bf r81da3da4  
    1919#include "AST/Pass.hpp"
    2020#include "AST/Type.hpp"
    21 #include "CodeGen/CodeGeneratorNew.hpp"
     21#include "CodeGen/CodeGenerator.hpp"
    2222#include "ResolvExpr/Unify.h"
    23 
    24 namespace ast {
    25     class TranslationUnit;
    26 }
    2723
    2824namespace Validate {
  • src/Validate/LinkInstanceTypes.cpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // LinkReferenceToTypes.cpp -- Connect instance types to declarations.
     7// LinkInstanceTypes.cpp -- Connect instance types to declarations.
    88//
    99// Author           : Andrew Beach
     
    1414//
    1515
    16 #include "Validate/LinkReferenceToTypes.hpp"
     16#include "Validate/LinkInstanceTypes.hpp"
    1717
    1818#include "AST/Pass.hpp"
     
    331331} // namespace
    332332
    333 void linkReferenceToTypes( ast::TranslationUnit & translationUnit ) {
     333void linkInstanceTypes( ast::TranslationUnit & translationUnit ) {
    334334        ast::Pass<LinkTypesCore>::run( translationUnit );
    335335}
  • src/Validate/LinkInstanceTypes.hpp

    r5ddb8bf r81da3da4  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // LinkReferenceToTypes.hpp -- Connect instance types to declarations.
     7// LinkInstanceTypes.hpp -- Connect instance types to declarations.
    88//
    99// Author           : Andrew Beach
     
    2525/// adjustments, such as setting the sized flag.
    2626/// Because of the sized flag, it must happen before auto-gen.
    27 void linkReferenceToTypes( ast::TranslationUnit & translationUnit );
     27void linkInstanceTypes( ast::TranslationUnit & translationUnit );
    2828
    2929}
  • src/Validate/module.mk

    r5ddb8bf r81da3da4  
    2727        Validate/EnumAndPointerDecay.cpp \
    2828        Validate/EnumAndPointerDecay.hpp \
    29         Validate/FindSpecialDeclsNew.cpp \
     29        Validate/FindSpecialDecls.cpp \
    3030        Validate/FixQualifiedTypes.cpp \
    3131        Validate/FixQualifiedTypes.hpp \
     
    4444        Validate/LabelAddressFixer.cpp \
    4545        Validate/LabelAddressFixer.hpp \
    46         Validate/LinkReferenceToTypes.cpp \
    47         Validate/LinkReferenceToTypes.hpp \
     46        Validate/LinkInstanceTypes.cpp \
     47        Validate/LinkInstanceTypes.hpp \
    4848        Validate/NoIdSymbolTable.hpp \
    4949        Validate/ReplaceTypedef.cpp \
  • src/Virtual/Tables.cc

    r5ddb8bf r81da3da4  
    165165                location,
    166166                functionName,
    167                 { /* forall */ },
    168167                { new ast::ObjectDecl(
    169168                        location,
  • src/Virtual/VirtualDtor.cpp

    r5ddb8bf r81da3da4  
    248248            decl->location,
    249249            "__CFA_set_dtor",
    250             {},                     // forall
    251250            {
    252251                new ObjectDecl(
     
    320319            decl->location,
    321320            "delete",
    322             {},                     // forall
    323321            {
    324322                new ObjectDecl(
  • src/include/cassert

    r5ddb8bf r81da3da4  
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu Aug 18 13:19:26 2016
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jun  3 13:11:00 2017
    13 // Update Count     : 18
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Nov 20 23:12:34 2023
     13// Update Count     : 19
    1414//
    1515
     
    5353}
    5454
    55 extern void abort(const char *fmt, ...  ) noexcept __attribute__((noreturn, format(printf, 1, 2)));
     55extern void abort(const char *fmt, ... ) noexcept __attribute__((noreturn, format(printf, 1, 2)));
    5656// Local Variables: //
    5757// tab-width: 4 //
  • src/main.cc

    r5ddb8bf r81da3da4  
    7878#include "Validate/InitializerLength.hpp"   // for setLengthFromInitializer
    7979#include "Validate/LabelAddressFixer.hpp"   // for fixLabelAddresses
    80 #include "Validate/LinkReferenceToTypes.hpp" // for linkReferenceToTypes
     80#include "Validate/LinkInstanceTypes.hpp"   // for linkInstanceTypes
    8181#include "Validate/ReplaceTypedef.hpp"      // for replaceTypedef
    8282#include "Validate/ReturnCheck.hpp"         // for checkReturnStatements
    8383#include "Validate/VerifyCtorDtorAssign.hpp" // for verifyCtorDtorAssign
    8484#include "Virtual/ExpandCasts.h"            // for expandCasts
    85 #include "Virtual/VirtualDtor.hpp"           // for implementVirtDtors
     85#include "Virtual/VirtualDtor.hpp"          // for implementVirtDtors
    8686
    8787using namespace std;
     
    318318                PASS( "Enum and Pointer Decay", Validate::decayEnumsAndPointers, transUnit );
    319319
    320                 PASS( "Link Reference To Types", Validate::linkReferenceToTypes, transUnit );
     320                PASS( "Link Instance Types", Validate::linkInstanceTypes, transUnit );
    321321
    322322                PASS( "Forall Pointer Decay", Validate::decayForallPointers, transUnit );
  • tests/.expect/PRNG.x64.txt

    r5ddb8bf r81da3da4  
    2626
    2727Sequential
    28 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
     28trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0%
    2929
    3030Concurrent
    31 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
    32 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
    33 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
    34 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
     31trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0%
     32trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0%
     33trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0%
     34trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0%
    3535
    3636                    prng()     prng(5)   prng(0,5)
     
    5858
    5959Sequential
    60 trials 20000000 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%
     60trials 2000000 buckets 100000 min 4 max 46 avg 20.0 std 4.5 rstd 22.3%
    6161
    6262Concurrent
    63 trials 20000000 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%
    64 trials 20000000 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%
    65 trials 20000000 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%
    66 trials 20000000 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%
     63trials 2000000 buckets 100000 min 4 max 46 avg 20.0 std 4.5 rstd 22.3%
     64trials 2000000 buckets 100000 min 4 max 46 avg 20.0 std 4.5 rstd 22.3%
     65trials 2000000 buckets 100000 min 4 max 46 avg 20.0 std 4.5 rstd 22.3%
     66trials 2000000 buckets 100000 min 4 max 46 avg 20.0 std 4.5 rstd 22.3%
    6767
    6868                   prng(t)   prng(t,5) prng(t,0,5)
     
    9090
    9191Sequential
    92 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
     92trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0%
    9393
    9494Concurrent
    95 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
    96 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
    97 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
    98 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
     95trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0%
     96trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0%
     97trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0%
     98trials 10000000 buckets 100000 min 59 max 145 avg 100.0 std 10.0 rstd 10.0%
  • tests/.expect/PRNG.x86.txt

    r5ddb8bf r81da3da4  
    2626
    2727Sequential
    28 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
     28trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0%
    2929
    3030Concurrent
    31 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
    32 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
    33 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
    34 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
     31trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0%
     32trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0%
     33trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0%
     34trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0%
    3535
    3636                    prng()     prng(5)   prng(0,5)
     
    5858
    5959Sequential
    60 trials 20000000 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%
     60trials 2000000 buckets 100000 min 3 max 42 avg 20.0 std 4.5 rstd 22.4%
    6161
    6262Concurrent
    63 trials 20000000 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%
    64 trials 20000000 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%
    65 trials 20000000 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%
    66 trials 20000000 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%
     63trials 2000000 buckets 100000 min 3 max 42 avg 20.0 std 4.5 rstd 22.4%
     64trials 2000000 buckets 100000 min 3 max 42 avg 20.0 std 4.5 rstd 22.4%
     65trials 2000000 buckets 100000 min 3 max 42 avg 20.0 std 4.5 rstd 22.4%
     66trials 2000000 buckets 100000 min 3 max 42 avg 20.0 std 4.5 rstd 22.4%
    6767
    6868                   prng(t)   prng(t,5) prng(t,0,5)
     
    9090
    9191Sequential
    92 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
     92trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0%
    9393
    9494Concurrent
    95 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
    96 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
    97 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
    98 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
     95trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0%
     96trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0%
     97trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0%
     98trials 10000000 buckets 100000 min 62 max 144 avg 100.0 std 10.0 rstd 10.0%
  • tests/.expect/functions.arm64.txt

    r5ddb8bf r81da3da4  
    105105struct _tuple2_ {
    106106};
    107 static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, unsigned long int _sizeof_Y15tuple_param_2_0, unsigned long int _alignof_Y15tuple_param_2_0, unsigned long int _sizeof_Y15tuple_param_2_1, unsigned long int _alignof_Y15tuple_param_2_1){
     107static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, const unsigned long int _sizeof_Y15tuple_param_2_0, const unsigned long int _alignof_Y15tuple_param_2_0, const unsigned long int _sizeof_Y15tuple_param_2_1, const unsigned long int _alignof_Y15tuple_param_2_1){
    108108    ((void)((*_sizeof__tuple2_)=0));
    109109    ((void)((*_alignof__tuple2_)=1));
     
    136136struct _tuple3_ {
    137137};
    138 static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, unsigned long int _sizeof_Y15tuple_param_3_0, unsigned long int _alignof_Y15tuple_param_3_0, unsigned long int _sizeof_Y15tuple_param_3_1, unsigned long int _alignof_Y15tuple_param_3_1, unsigned long int _sizeof_Y15tuple_param_3_2, unsigned long int _alignof_Y15tuple_param_3_2){
     138static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, const unsigned long int _sizeof_Y15tuple_param_3_0, const unsigned long int _alignof_Y15tuple_param_3_0, const unsigned long int _sizeof_Y15tuple_param_3_1, const unsigned long int _alignof_Y15tuple_param_3_1, const unsigned long int _sizeof_Y15tuple_param_3_2, const unsigned long int _alignof_Y15tuple_param_3_2){
    139139    ((void)((*_sizeof__tuple3_)=0));
    140140    ((void)((*_alignof__tuple3_)=1));
  • tests/.expect/functions.x64.txt

    r5ddb8bf r81da3da4  
    105105struct _tuple2_ {
    106106};
    107 static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, unsigned long int _sizeof_Y15tuple_param_2_0, unsigned long int _alignof_Y15tuple_param_2_0, unsigned long int _sizeof_Y15tuple_param_2_1, unsigned long int _alignof_Y15tuple_param_2_1){
     107static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, const unsigned long int _sizeof_Y15tuple_param_2_0, const unsigned long int _alignof_Y15tuple_param_2_0, const unsigned long int _sizeof_Y15tuple_param_2_1, const unsigned long int _alignof_Y15tuple_param_2_1){
    108108    ((void)((*_sizeof__tuple2_)=0));
    109109    ((void)((*_alignof__tuple2_)=1));
     
    136136struct _tuple3_ {
    137137};
    138 static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, unsigned long int _sizeof_Y15tuple_param_3_0, unsigned long int _alignof_Y15tuple_param_3_0, unsigned long int _sizeof_Y15tuple_param_3_1, unsigned long int _alignof_Y15tuple_param_3_1, unsigned long int _sizeof_Y15tuple_param_3_2, unsigned long int _alignof_Y15tuple_param_3_2){
     138static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, const unsigned long int _sizeof_Y15tuple_param_3_0, const unsigned long int _alignof_Y15tuple_param_3_0, const unsigned long int _sizeof_Y15tuple_param_3_1, const unsigned long int _alignof_Y15tuple_param_3_1, const unsigned long int _sizeof_Y15tuple_param_3_2, const unsigned long int _alignof_Y15tuple_param_3_2){
    139139    ((void)((*_sizeof__tuple3_)=0));
    140140    ((void)((*_alignof__tuple3_)=1));
  • tests/.expect/functions.x86.txt

    r5ddb8bf r81da3da4  
    105105struct _tuple2_ {
    106106};
    107 static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, unsigned long int _sizeof_Y15tuple_param_2_0, unsigned long int _alignof_Y15tuple_param_2_0, unsigned long int _sizeof_Y15tuple_param_2_1, unsigned long int _alignof_Y15tuple_param_2_1){
     107static inline void _layoutof__tuple2_(unsigned long int *_sizeof__tuple2_, unsigned long int *_alignof__tuple2_, unsigned long int *_offsetof__tuple2_, const unsigned long int _sizeof_Y15tuple_param_2_0, const unsigned long int _alignof_Y15tuple_param_2_0, const unsigned long int _sizeof_Y15tuple_param_2_1, const unsigned long int _alignof_Y15tuple_param_2_1){
    108108    ((void)((*_sizeof__tuple2_)=0));
    109109    ((void)((*_alignof__tuple2_)=1));
     
    136136struct _tuple3_ {
    137137};
    138 static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, unsigned long int _sizeof_Y15tuple_param_3_0, unsigned long int _alignof_Y15tuple_param_3_0, unsigned long int _sizeof_Y15tuple_param_3_1, unsigned long int _alignof_Y15tuple_param_3_1, unsigned long int _sizeof_Y15tuple_param_3_2, unsigned long int _alignof_Y15tuple_param_3_2){
     138static inline void _layoutof__tuple3_(unsigned long int *_sizeof__tuple3_, unsigned long int *_alignof__tuple3_, unsigned long int *_offsetof__tuple3_, const unsigned long int _sizeof_Y15tuple_param_3_0, const unsigned long int _alignof_Y15tuple_param_3_0, const unsigned long int _sizeof_Y15tuple_param_3_1, const unsigned long int _alignof_Y15tuple_param_3_1, const unsigned long int _sizeof_Y15tuple_param_3_2, const unsigned long int _alignof_Y15tuple_param_3_2){
    139139    ((void)((*_sizeof__tuple3_)=0));
    140140    ((void)((*_alignof__tuple3_)=1));
  • tests/PRNG.cfa

    r5ddb8bf r81da3da4  
    1010// Created On       : Wed Dec 29 09:38:12 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Aug 14 08:49:53 2023
    13 // Update Count     : 425
     12// Last Modified On : Tue Dec  5 08:14:57 2023
     13// Update Count     : 428
    1414//
    1515
     
    3232#define STARTTIME start = timeHiRes()
    3333#define ENDTIME( extra ) sout | wd(0,1, (timeHiRes() - start)`ms / 1000.) | extra "seconds"
    34 enum { BUCKETS = 100_000, TRIALS = 1_000_000_000 };
     34enum { BUCKETS = 100_000, TRIALS = 100_000_000 };
    3535#else
    3636#define STARTTIME
    3737#define ENDTIME( extra )
    38 enum { BUCKETS = 100_000, TRIALS = 100_000_000 };
     38enum { BUCKETS = 100_000, TRIALS = 10_000_000 };
    3939#endif // TIME
    4040
Note: See TracChangeset for help on using the changeset viewer.