Changes in / [fca3bf8:3b9c674]


Ignore:
Files:
2 added
2 deleted
28 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/interpose.cfa

    rfca3bf8 r3b9c674  
    1010// Created On       : Wed Mar 29 16:10:31 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Feb 17 10:18:53 2020
    13 // Update Count     : 166
     12// Last Modified On : Sat Feb  8 08:40:34 2020
     13// Update Count     : 163
    1414//
    1515
     
    237237        if ( fmt[strlen( fmt ) - 1] != '\n' ) {                         // add optional newline if missing at the end of the format text
    238238                __cfaabi_dbg_write( "\n", 1 );
    239         } // if
     239        }
     240
    240241        kernel_abort_msg( kernel_data, abort_text, abort_text_size );
    241 
    242         __cfaabi_backtrace( signalAbort ? 4 : 2 );
     242        __cfaabi_backtrace( signalAbort ? 4 : 3 );
    243243
    244244        __cabi_libc.abort();                                                            // print stack trace in handler
  • src/CodeGen/CodeGenerator.cc

    rfca3bf8 r3b9c674  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 08:32:48 2020
    13 // Update Count     : 532
     12// Last Modified On : Fri Dec 13 23:13:28 2019
     13// Update Count     : 508
    1414//
    1515#include "CodeGenerator.h"
     
    3939        int CodeGenerator::tabsize = 4;
    4040
    41         // The kinds of statements that would ideally be followed by whitespace.
     41        // the kinds of statements that would ideally be followed by whitespace
    4242        bool wantSpacing( Statement * stmt) {
    4343                return dynamic_cast< IfStmt * >( stmt ) || dynamic_cast< CompoundStmt * >( stmt ) ||
     
    7878        }
    7979
    80         // Using updateLocation at the beginning of a node and endl within a node should become the method of formating.
     80        /* Using updateLocation at the beginning of a node and endl
     81         * within a node should become the method of formating.
     82         */
    8183        void CodeGenerator::updateLocation( CodeLocation const & to ) {
    8284                // skip if linemarks shouldn't appear or if codelocation is unset
     
    9395                } else {
    9496                        output << "\n# " << to.first_line << " \"" << to.filename
    95                                    << "\"\n" << indent;
     97                               << "\"\n" << indent;
    9698                        currentLocation = to;
    9799                }
     
    129131
    130132        void CodeGenerator::genAttributes( list< Attribute * > & attributes ) {
    131                 if ( attributes.empty() ) return;
     133          if ( attributes.empty() ) return;
    132134                output << "__attribute__ ((";
    133135                for ( list< Attribute * >::iterator attr( attributes.begin() );; ) {
     
    138140                                output << ")";
    139141                        } // if
    140                         if ( ++attr == attributes.end() ) break;
     142                  if ( ++attr == attributes.end() ) break;
    141143                        output << ",";                                                          // separator
    142144                } // for
     
    163165                previsit( (BaseSyntaxNode *)node );
    164166                GuardAction( [this, node](){
    165                                 if ( options.printExprTypes && node->result ) {
    166                                         output << " /* " << genType( node->result, "", options ) << " */ ";
    167                                 }
    168                         } );
     167                        if ( options.printExprTypes && node->result ) {
     168                                output << " /* " << genType( node->result, "", options ) << " */ ";
     169                        }
     170                } );
    169171        }
    170172
     
    397399                extension( applicationExpr );
    398400                if ( VariableExpr * varExpr = dynamic_cast< VariableExpr* >( applicationExpr->get_function() ) ) {
    399                         const OperatorInfo * opInfo;
    400                         if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && ( opInfo = operatorLookup( varExpr->get_var()->get_name() ) ) ) {
     401                        OperatorInfo opInfo;
     402                        if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( varExpr->get_var()->get_name(), opInfo ) ) {
    401403                                std::list< Expression* >::iterator arg = applicationExpr->get_args().begin();
    402                                 switch ( opInfo->type ) {
     404                                switch ( opInfo.type ) {
    403405                                  case OT_INDEX:
    404406                                        assert( applicationExpr->get_args().size() == 2 );
     
    421423                                                output << "(";
    422424                                                (*arg++)->accept( *visitor );
    423                                                 output << ") /* " << opInfo->inputName << " */";
     425                                                output << ") /* " << opInfo.inputName << " */";
    424426                                        } else if ( applicationExpr->get_args().size() == 2 ) {
    425427                                                // intrinsic two parameter constructors are essentially bitwise assignment
    426428                                                output << "(";
    427429                                                (*arg++)->accept( *visitor );
    428                                                 output << opInfo->symbol;
     430                                                output << opInfo.symbol;
    429431                                                (*arg)->accept( *visitor );
    430                                                 output << ") /* " << opInfo->inputName << " */";
     432                                                output << ") /* " << opInfo.inputName << " */";
    431433                                        } else {
    432434                                                // no constructors with 0 or more than 2 parameters
     
    439441                                        assert( applicationExpr->get_args().size() == 1 );
    440442                                        output << "(";
    441                                         output << opInfo->symbol;
     443                                        output << opInfo.symbol;
    442444                                        (*arg)->accept( *visitor );
    443445                                        output << ")";
     
    448450                                        assert( applicationExpr->get_args().size() == 1 );
    449451                                        (*arg)->accept( *visitor );
    450                                         output << opInfo->symbol;
     452                                        output << opInfo.symbol;
    451453                                        break;
    452454
     
    457459                                        output << "(";
    458460                                        (*arg++)->accept( *visitor );
    459                                         output << opInfo->symbol;
     461                                        output << opInfo.symbol;
    460462                                        (*arg)->accept( *visitor );
    461463                                        output << ")";
     
    484486                extension( untypedExpr );
    485487                if ( NameExpr * nameExpr = dynamic_cast< NameExpr* >( untypedExpr->function ) ) {
    486                         const OperatorInfo * opInfo = operatorLookup( nameExpr->name );
    487                         if ( opInfo ) {
     488                        OperatorInfo opInfo;
     489                        if ( operatorLookup( nameExpr->name, opInfo ) ) {
    488490                                std::list< Expression* >::iterator arg = untypedExpr->args.begin();
    489                                 switch ( opInfo->type ) {
     491                                switch ( opInfo.type ) {
    490492                                  case OT_INDEX:
    491493                                        assert( untypedExpr->args.size() == 2 );
     
    506508                                                output << "(";
    507509                                                (*arg++)->accept( *visitor );
    508                                                 output << ") /* " << opInfo->inputName << " */";
     510                                                output << ") /* " << opInfo.inputName << " */";
    509511                                        } else if ( untypedExpr->get_args().size() == 2 ) {
    510512                                                // intrinsic two parameter constructors are essentially bitwise assignment
    511513                                                output << "(";
    512514                                                (*arg++)->accept( *visitor );
    513                                                 output << opInfo->symbol;
     515                                                output << opInfo.symbol;
    514516                                                (*arg)->accept( *visitor );
    515                                                 output << ") /* " << opInfo->inputName << " */";
     517                                                output << ") /* " << opInfo.inputName << " */";
    516518                                        } else {
    517519                                                // no constructors with 0 or more than 2 parameters
     
    519521                                                output << "(";
    520522                                                (*arg++)->accept( *visitor );
    521                                                 output << opInfo->symbol << "{ ";
     523                                                output << opInfo.symbol << "{ ";
    522524                                                genCommaList( arg, untypedExpr->args.end() );
    523                                                 output << "}) /* " << opInfo->inputName << " */";
     525                                                output << "}) /* " << opInfo.inputName << " */";
    524526                                        } // if
    525527                                        break;
     
    530532                                        assert( untypedExpr->args.size() == 1 );
    531533                                        output << "(";
    532                                         output << opInfo->symbol;
     534                                        output << opInfo.symbol;
    533535                                        (*arg)->accept( *visitor );
    534536                                        output << ")";
     
    539541                                        assert( untypedExpr->args.size() == 1 );
    540542                                        (*arg)->accept( *visitor );
    541                                         output << opInfo->symbol;
     543                                        output << opInfo.symbol;
    542544                                        break;
    543545
     
    547549                                        output << "(";
    548550                                        (*arg++)->accept( *visitor );
    549                                         output << opInfo->symbol;
     551                                        output << opInfo.symbol;
    550552                                        (*arg)->accept( *visitor );
    551553                                        output << ")";
     
    579581        void CodeGenerator::postvisit( NameExpr * nameExpr ) {
    580582                extension( nameExpr );
    581                 const OperatorInfo * opInfo = operatorLookup( nameExpr->name );
    582                 if ( opInfo ) {
    583                         if ( opInfo->type == OT_CONSTANT ) {
    584                                 output << opInfo->symbol;
     583                OperatorInfo opInfo;
     584                if ( operatorLookup( nameExpr->name, opInfo ) ) {
     585                        if ( opInfo.type == OT_CONSTANT ) {
     586                                output << opInfo.symbol;
    585587                        } else {
    586                                 output << opInfo->outputName;
     588                                output << opInfo.outputName;
    587589                        }
    588590                } else {
     
    652654        void CodeGenerator::postvisit( VariableExpr * variableExpr ) {
    653655                extension( variableExpr );
    654                 const OperatorInfo * opInfo;
    655                 if ( variableExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && (opInfo = operatorLookup( variableExpr->get_var()->get_name() )) && opInfo->type == OT_CONSTANT ) {
    656                         output << opInfo->symbol;
     656                OperatorInfo opInfo;
     657                if ( variableExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( variableExpr->get_var()->get_name(), opInfo ) && opInfo.type == OT_CONSTANT ) {
     658                        output << opInfo.symbol;
    657659                } else {
    658660                        output << mangleName( variableExpr->get_var() );
     
    10091011                  case BranchStmt::FallThroughDefault:
    10101012                        assertf( ! options.genC, "fallthru should not reach code generation." );
    1011                         output << "fallthru";
     1013                  output << "fallthru";
    10121014                        break;
    10131015                } // switch
     
    10331035
    10341036                output << ((throwStmt->get_kind() == ThrowStmt::Terminate) ?
    1035                                    "throw" : "throwResume");
     1037                           "throw" : "throwResume");
    10361038                if (throwStmt->get_expr()) {
    10371039                        output << " ";
     
    10481050
    10491051                output << ((stmt->get_kind() == CatchStmt::Terminate) ?
    1050                                    "catch" : "catchResume");
     1052                "catch" : "catchResume");
    10511053                output << "( ";
    10521054                stmt->decl->accept( *visitor );
     
    11851187
    11861188        std::string genName( DeclarationWithType * decl ) {
    1187                 const OperatorInfo * opInfo = operatorLookup( decl->get_name() );
    1188                 if ( opInfo ) {
    1189                         return opInfo->outputName;
     1189                CodeGen::OperatorInfo opInfo;
     1190                if ( operatorLookup( decl->get_name(), opInfo ) ) {
     1191                        return opInfo.outputName;
    11901192                } else {
    11911193                        return decl->get_name();
  • src/CodeGen/CodeGenerator.h

    rfca3bf8 r3b9c674  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 03:58:31 2020
    13 // Update Count     : 62
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tue Apr 30 12:01:00 2019
     13// Update Count     : 57
    1414//
    1515
     
    2929namespace CodeGen {
    3030        struct CodeGenerator : public WithShortCircuiting, public WithGuards, public WithVisitorRef<CodeGenerator> {
    31                 static int tabsize;
     31          static int tabsize;
    3232
    3333                CodeGenerator( std::ostream &os, bool pretty = false, bool genC = false, bool lineMarks = false, bool printExprTypes = false );
     
    104104                void postvisit( AsmStmt * );
    105105                void postvisit( DirectiveStmt * );
    106                 void postvisit( AsmDecl * );                                    // special: statement in declaration context
     106                void postvisit( AsmDecl * );                            // special: statement in declaration context
    107107                void postvisit( IfStmt * );
    108108                void postvisit( SwitchStmt * );
     
    147147                LabelPrinter printLabels;
    148148                Options options;
    149           public:
     149        public:
    150150                LineEnder endl;
    151           private:
     151        private:
    152152
    153153                CodeLocation currentLocation;
     
    162162        template< class Iterator >
    163163        void CodeGenerator::genCommaList( Iterator begin, Iterator end ) {
    164                 if ( begin == end ) return;
     164          if ( begin == end ) return;
    165165                for ( ;; ) {
    166166                        (*begin++)->accept( *visitor );
    167                         if ( begin == end ) break;
     167                  if ( begin == end ) break;
    168168                        output << ", ";                                                         // separator
    169169                } // for
  • src/CodeGen/FixMain.h

    rfca3bf8 r3b9c674  
    1010// Created On       : Thr Jan 12 14:11:09 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 03:24:32 2020
    13 // Update Count     : 5
     12// Last Modified On : Fri Dec 13 23:12:21 2019
     13// Update Count     : 3
    1414//
    1515
     
    4242                static std::unique_ptr<FunctionDecl> main_signature;
    4343        };
    44 } // namespace CodeGen
     44};
  • src/CodeGen/GenType.h

    rfca3bf8 r3b9c674  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 04:11:40 2020
    13 // Update Count     : 5
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Tue Apr 30 11:47:00 2019
     13// Update Count     : 3
    1414//
    1515
     
    2525        std::string genType( Type *type, const std::string &baseString, const Options &options );
    2626        std::string genType( Type *type, const std::string &baseString, bool pretty = false, bool genC = false, bool lineMarks = false );
    27         std::string genPrettyType( Type * type, const std::string & baseString );
     27  std::string genPrettyType( Type * type, const std::string & baseString );
    2828} // namespace CodeGen
    2929
  • src/CodeGen/Generate.cc

    rfca3bf8 r3b9c674  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 03:01:51 2020
    13 // Update Count     : 9
     12// Last Modified On : Fri Dec 13 23:38:56 2019
     13// Update Count     : 8
    1414//
    1515#include "Generate.h"
     
    6464        void generate( BaseSyntaxNode * node, std::ostream & os ) {
    6565                if ( Type * type = dynamic_cast< Type * >( node ) ) {
    66                         os << genPrettyType( type, "" );
     66                        os << CodeGen::genPrettyType( type, "" );
    6767                } else {
    6868                        PassVisitor<CodeGenerator> cgv( os, true, false, false, false );
  • src/CodeGen/OperatorTable.cc

    rfca3bf8 r3b9c674  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb 18 15:55:01 2020
    13 // Update Count     : 55
     12// Last Modified On : Mon Feb 10 18:12:12 2020
     13// Update Count     : 17
    1414//
    1515
     
    1717#include <map>        // for map, _Rb_tree_const_iterator, map<>::const_iterator
    1818#include <utility>    // for pair
    19 using namespace std;
    2019
    2120#include "OperatorTable.h"
     
    2322
    2423namespace CodeGen {
    25         const OperatorInfo CodeGen::tableValues[] = {
    26                 // inputName symbol   outputName                     friendlyName                  type
    27                 {       "?[?]",   "",     "_operator_index",             "Index",                      OT_INDEX          },
    28                 {       "?{}",    "=",    "_constructor",                "Constructor",                OT_CTOR           },
    29                 {       "^?{}",   "",     "_destructor",                 "Destructor",                 OT_DTOR           },
    30                 {       "?()",    "",     "_operator_call",              "Call Operator",              OT_CALL           },
    31                 {       "?++",    "++",   "_operator_postincr",          "Postfix Increment",          OT_POSTFIXASSIGN  },
    32                 {       "?--",    "--",   "_operator_postdecr",          "Postfix Decrement",          OT_POSTFIXASSIGN  },
    33                 {       "*?",     "*",    "_operator_deref",             "Dereference",                OT_PREFIX         },
    34                 {       "+?",     "+",    "_operator_unaryplus",         "Plus",                       OT_PREFIX         },
    35                 {       "-?",     "-",    "_operator_unaryminus",        "Minus",                      OT_PREFIX         },
    36                 {       "~?",     "~",    "_operator_bitnot",            "Bitwise Not",                OT_PREFIX         },
    37                 {       "!?",     "!",    "_operator_lognot",            "Logical Not",                OT_PREFIX         },
    38                 {       "++?",    "++",   "_operator_preincr",           "Prefix Increment",           OT_PREFIXASSIGN   },
    39                 {       "--?",    "--",   "_operator_predecr",           "Prefix Decrement",           OT_PREFIXASSIGN   },
    40                 {       "?\\?",   "\\",   "_operator_exponential",       "Exponentiation",             OT_INFIX          },
    41                 {       "?*?",    "*",    "_operator_multiply",          "Multiplication",             OT_INFIX          },
    42                 {       "?/?",    "/",    "_operator_divide",            "Division",                   OT_INFIX          },
    43                 {       "?%?",    "%",    "_operator_modulus",           "Modulo",                     OT_INFIX          },
    44                 {       "?+?",    "+",    "_operator_add",               "Addition",                   OT_INFIX          },
    45                 {       "?-?",    "-",    "_operator_subtract",          "Substraction",               OT_INFIX          },
    46                 {       "?<<?",   "<<",   "_operator_shiftleft",         "Shift Left",                 OT_INFIX          },
    47                 {       "?>>?",   ">>",   "_operator_shiftright",        "Shift Right",                OT_INFIX          },
    48                 {       "?<?",    "<",    "_operator_less",              "Less-than",                  OT_INFIX          },
    49                 {       "?>?",    ">",    "_operator_greater",           "Greater-than",               OT_INFIX          },
    50                 {       "?<=?",   "<=",   "_operator_lessequal",         "Less-than-or-Equal",         OT_INFIX          },
    51                 {       "?>=?",   ">=",   "_operator_greaterequal",      "Greater-than-or-Equal",      OT_INFIX          },
    52                 {       "?==?",   "==",   "_operator_equal",             "Equality",                   OT_INFIX          },
    53                 {       "?!=?",   "!=",   "_operator_notequal",          "Not-Equal",                  OT_INFIX          },
    54                 {       "?&?",    "&",    "_operator_bitand",            "Bitwise And",                OT_INFIX          },
    55                 {       "?^?",    "^",    "_operator_bitxor",            "Bitwise Xor",                OT_INFIX          },
    56                 {       "?|?",    "|",    "_operator_bitor",             "Bitwise Or",                 OT_INFIX          },
    57                 {       "?=?",    "=",    "_operator_assign",            "Assignment",                 OT_INFIXASSIGN    },
    58                 {       "?\\=?",  "\\=",  "_operator_expassign",         "Exponentiation Assignment",  OT_INFIXASSIGN    },
    59                 {       "?*=?",   "*=",   "_operator_multassign",        "Multiplication Assignment",  OT_INFIXASSIGN    },
    60                 {       "?/=?",   "/=",   "_operator_divassign",         "Division Assignment",        OT_INFIXASSIGN    },
    61                 {       "?%=?",   "%=",   "_operator_modassign",         "Modulo Assignment",          OT_INFIXASSIGN    },
    62                 {       "?+=?",   "+=",   "_operator_addassign",         "Addition Assignment",        OT_INFIXASSIGN    },
    63                 {       "?-=?",   "-=",   "_operator_subassign",         "Substrction Assignment",     OT_INFIXASSIGN    },
    64                 {       "?<<=?",  "<<=",  "_operator_shiftleftassign",   "Shift Left Assignment",      OT_INFIXASSIGN    },
    65                 {       "?>>=?",  ">>=",  "_operator_shiftrightassign",  "Shift Right Assignment",     OT_INFIXASSIGN    },
    66                 {       "?&=?",   "&=",   "_operator_bitandassign",      "Bitwise And Assignment",     OT_INFIXASSIGN    },
    67                 {       "?^=?",   "^=",   "_operator_bitxorassign",      "Bitwise Xor Assignment",     OT_INFIXASSIGN    },
    68                 {       "?|=?",   "|=",   "_operator_bitorassign",       "Bitwise Or Assignment",      OT_INFIXASSIGN    },
    69         }; // tableValues
     24        namespace {
     25                const OperatorInfo tableValues[] = {
     26                        {       "?[?]",   "",     "_operator_index",             "Index",                      OT_INDEX          },
     27                        {       "?{}",    "=",    "_constructor",                "Constructor",                OT_CTOR           },
     28                        {       "^?{}",   "",     "_destructor",                 "Destructor",                 OT_DTOR           },
     29                        {       "?()",    "",     "_operator_call",              "Call Operator",              OT_CALL           },
     30                        {       "?++",    "++",   "_operator_postincr",          "Postfix Increment",          OT_POSTFIXASSIGN  },
     31                        {       "?--",    "--",   "_operator_postdecr",          "Postfix Decrement",          OT_POSTFIXASSIGN  },
     32                        {       "*?",     "*",    "_operator_deref",             "Dereference",                OT_PREFIX         },
     33                        {       "+?",     "+",    "_operator_unaryplus",         "Plus",                       OT_PREFIX         },
     34                        {       "-?",     "-",    "_operator_unaryminus",        "Minus",                      OT_PREFIX         },
     35                        {       "~?",     "~",    "_operator_bitnot",            "Bitwise Not",                OT_PREFIX         },
     36                        {       "!?",     "!",    "_operator_lognot",            "Logical Not",                OT_PREFIX         },
     37                        {       "++?",    "++",   "_operator_preincr",           "Prefix Increment",           OT_PREFIXASSIGN   },
     38                        {       "--?",    "--",   "_operator_predecr",           "Prefix Decrement",           OT_PREFIXASSIGN   },
     39                        {       "?\\?",   "\\",   "_operator_exponential",       "Exponentiation",             OT_INFIX          },
     40                        {       "?*?",    "*",    "_operator_multiply",          "Multiplication",             OT_INFIX          },
     41                        {       "?/?",    "/",    "_operator_divide",            "Division",                   OT_INFIX          },
     42                        {       "?%?",    "%",    "_operator_modulus",           "Modulo",                     OT_INFIX          },
     43                        {       "?+?",    "+",    "_operator_add",               "Addition",                   OT_INFIX          },
     44                        {       "?-?",    "-",    "_operator_subtract",          "Substraction",               OT_INFIX          },
     45                        {       "?<<?",   "<<",   "_operator_shiftleft",         "Shift Left",                 OT_INFIX          },
     46                        {       "?>>?",   ">>",   "_operator_shiftright",        "Shift Right",                OT_INFIX          },
     47                        {       "?<?",    "<",    "_operator_less",              "Less-than",                  OT_INFIX          },
     48                        {       "?>?",    ">",    "_operator_greater",           "Greater-than",               OT_INFIX          },
     49                        {       "?<=?",   "<=",   "_operator_lessequal",         "Less-than-or-Equal",         OT_INFIX          },
     50                        {       "?>=?",   ">=",   "_operator_greaterequal",      "Greater-than-or-Equal",      OT_INFIX          },
     51                        {       "?==?",   "==",   "_operator_equal",             "Equality",                   OT_INFIX          },
     52                        {       "?!=?",   "!=",   "_operator_notequal",          "Not-Equal",                  OT_INFIX          },
     53                        {       "?&?",    "&",    "_operator_bitand",            "Bitwise And",                OT_INFIX          },
     54                        {       "?^?",    "^",    "_operator_bitxor",            "Bitwise Xor",                OT_INFIX          },
     55                        {       "?|?",    "|",    "_operator_bitor",             "Bitwise Or",                 OT_INFIX          },
     56                        {       "?=?",    "=",    "_operator_assign",            "Assignment",                 OT_INFIXASSIGN    },
     57                        {       "?\\=?",  "\\=",  "_operator_expassign",         "Exponentiation Assignment",  OT_INFIXASSIGN    },
     58                        {       "?*=?",   "*=",   "_operator_multassign",        "Multiplication Assignment",  OT_INFIXASSIGN    },
     59                        {       "?/=?",   "/=",   "_operator_divassign",         "Division Assignment",        OT_INFIXASSIGN    },
     60                        {       "?%=?",   "%=",   "_operator_modassign",         "Modulo Assignment",          OT_INFIXASSIGN    },
     61                        {       "?+=?",   "+=",   "_operator_addassign",         "Addition Assignment",        OT_INFIXASSIGN    },
     62                        {       "?-=?",   "-=",   "_operator_subassign",         "Substrction Assignment",     OT_INFIXASSIGN    },
     63                        {       "?<<=?",  "<<=",  "_operator_shiftleftassign",   "Shift Left Assignment",      OT_INFIXASSIGN    },
     64                        {       "?>>=?",  ">>=",  "_operator_shiftrightassign",  "Shift Right Assignment",     OT_INFIXASSIGN    },
     65                        {       "?&=?",   "&=",   "_operator_bitandassign",      "Bitwise And Assignment",     OT_INFIXASSIGN    },
     66                        {       "?^=?",   "^=",   "_operator_bitxorassign",      "Bitwise Xor Assignment",     OT_INFIXASSIGN    },
     67                        {       "?|=?",   "|=",   "_operator_bitorassign",       "Bitwise Or Assignment",      OT_INFIXASSIGN    },
     68                };
    7069
    71         std::map< std::string, OperatorInfo > CodeGen::table;
     70                const int numOps = sizeof( tableValues ) / sizeof( OperatorInfo );
    7271
    73         CodeGen::CodeGen() {
    74                 enum { numOps = sizeof( tableValues ) / sizeof( OperatorInfo ) };
    75                 for ( int i = 0; i < numOps; i += 1 ) {
    76                         table[ tableValues[i].inputName ] = tableValues[i];
    77                 } // for
     72                std::map< std::string, OperatorInfo > table;
     73
     74                void initialize() {
     75                        for ( int i = 0; i < numOps; ++i ) {
     76                                table[ tableValues[i].inputName ] = tableValues[i];
     77                        } // for
     78                }
     79        } // namespace
     80
     81        bool operatorLookup( const std::string & funcName, OperatorInfo & info ) {
     82                static bool init = false;
     83                if ( ! init ) {
     84                        initialize();
     85                } // if
     86
     87                std::map< std::string, OperatorInfo >::const_iterator i = table.find( funcName );
     88                if ( i == table.end() ) {
     89                        if ( isPrefix( funcName, "?`" ) ) {                     // user-defined postfix operator ?
     90                                info.inputName = funcName;
     91                                info.symbol = funcName.substr(2);
     92                                info.outputName = toString( "__postfix_call_", info.symbol );
     93                                info.type = OT_POSTFIX;
     94                                return true;
     95                        }
     96                        return false;
     97                } else {
     98                        info = i->second;
     99                        return true;
     100                } // if
    78101        }
    79102
    80         const OperatorInfo * operatorLookup( const string & funcName ) {
    81                 if ( funcName.find_first_of( "?^*+-!", 0, 1 ) == string::npos ) return nullptr; // prefilter
    82                 const OperatorInfo * ret = &CodeGen::table.find( funcName )->second; // must be in the table
    83                 assert( ret );
    84                 return ret;
     103        bool isOperator( const std::string & funcName ) {
     104                OperatorInfo info;
     105                return operatorLookup( funcName, info );
    85106        }
    86107
    87         bool isOperator( const string & funcName ) {
    88                 return operatorLookup( funcName ) != nullptr;
    89         }
    90 
    91         string operatorFriendlyName( const string & funcName ) {
    92                 const OperatorInfo * info = operatorLookup( funcName );
    93                 if ( info ) return info->friendlyName;
     108        std::string operatorFriendlyName( const std::string & funcName ) {
     109                OperatorInfo info;
     110                if( operatorLookup( funcName, info ) ) {
     111                        return info.friendlyName;
     112                }
    94113                return "";
    95114        }
    96115
    97         bool isConstructor( const string & funcName ) {
    98                 const OperatorInfo * info = operatorLookup( funcName );
    99                 if ( info ) return info->type == OT_CTOR;
     116        /// determines if a given function name is one of the operator types between [begin, end)
     117        template<typename Iterator>
     118        bool isOperatorType( const std::string & funcName, Iterator begin, Iterator end ) {
     119                OperatorInfo info;
     120                if ( operatorLookup( funcName, info ) ) {
     121                        return std::find( begin, end, info.type ) != end;
     122                }
    100123                return false;
    101124        }
    102125
    103         bool isDestructor( const string & funcName ) {
    104                 const OperatorInfo * info = operatorLookup( funcName );
    105                 if ( info ) return info->type == OT_DTOR;
    106                 return false;
     126        bool isConstructor( const std::string & funcName ) {
     127                static OperatorType types[] = { OT_CTOR };
     128                return isOperatorType( funcName, std::begin(types), std::end(types) );
    107129        }
    108130
    109         bool isCtorDtor( const string & funcName ) {
    110                 const OperatorInfo * info = operatorLookup( funcName );
    111                 if ( info ) return info->type <= OT_CONSTRUCTOR;
    112                 return false;
     131        bool isDestructor( const std::string & funcName ) {
     132                static OperatorType types[] = { OT_DTOR };
     133                return isOperatorType( funcName, std::begin(types), std::end(types) );
    113134        }
    114135
    115         bool isAssignment( const string & funcName ) {
    116                 const OperatorInfo * info = operatorLookup( funcName );
    117                 if ( info ) return info->type > OT_CONSTRUCTOR && info->type <= OT_ASSIGNMENT;
    118                 return false;
     136        bool isAssignment( const std::string & funcName ) {
     137                static OperatorType types[] = { OT_PREFIXASSIGN, OT_POSTFIXASSIGN, OT_INFIXASSIGN };
     138                return isOperatorType( funcName, std::begin(types), std::end(types) );
    119139        }
    120140
    121         bool isCtorDtorAssign( const string & funcName ) {
    122                 const OperatorInfo * info = operatorLookup( funcName );
    123                 if ( info ) return info->type <= OT_ASSIGNMENT;
    124                 return false;
     141        bool isCtorDtor( const std::string & funcName ) {
     142                static OperatorType types[] = { OT_CTOR, OT_DTOR };
     143                return isOperatorType( funcName, std::begin(types), std::end(types) );
    125144        }
    126145
    127         CodeGen codegen;                                                                        // initialize singleton package
     146        bool isCtorDtorAssign( const std::string & funcName ) {
     147                static OperatorType types[] = { OT_CTOR, OT_DTOR, OT_PREFIXASSIGN, OT_POSTFIXASSIGN, OT_INFIXASSIGN };
     148                return isOperatorType( funcName, std::begin(types), std::end(types) );
     149        }
    128150} // namespace CodeGen
    129151
    130152// Local Variables: //
    131153// tab-width: 4 //
     154// mode: c++ //
     155// compile-command: "make install" //
    132156// End: //
  • src/CodeGen/OperatorTable.h

    rfca3bf8 r3b9c674  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 08:13:34 2020
    13 // Update Count     : 26
     12// Last Modified On : Fri Jul 21 22:17:11 2017
     13// Update Count     : 6
    1414//
    1515
     
    1717
    1818#include <string>
    19 #include <map>
    2019
    2120namespace CodeGen {
    2221        enum OperatorType {
     22                OT_INDEX,
    2323                OT_CTOR,
    2424                OT_DTOR,
    25                 OT_CONSTRUCTOR = OT_DTOR,
     25                OT_CALL,
     26                OT_PREFIX,
     27                OT_POSTFIX,
     28                OT_INFIX,
    2629                OT_PREFIXASSIGN,
    2730                OT_POSTFIXASSIGN,
    2831                OT_INFIXASSIGN,
    29                 OT_ASSIGNMENT = OT_INFIXASSIGN,
    30                 OT_CALL,
    31                 OT_PREFIX,
    32                 OT_INFIX,
    33                 OT_POSTFIX,
    34                 OT_INDEX,
    3532                OT_LABELADDRESS,
    3633                OT_CONSTANT
     
    4542        };
    4643
    47         class CodeGen {
    48                 friend const OperatorInfo * operatorLookup( const std::string & funcName );
    49 
    50                 static const OperatorInfo tableValues[];
    51                 static std::map< std::string, OperatorInfo > table;
    52           public:
    53                 CodeGen();
    54         }; // CodeGen
    55 
    5644        bool isOperator( const std::string & funcName );
    57         const OperatorInfo * operatorLookup( const std::string & funcName );
     45        bool operatorLookup( const std::string & funcName, OperatorInfo & info );
    5846        std::string operatorFriendlyName( const std::string & funcName );
    5947
  • src/CodeGen/Options.h

    rfca3bf8 r3b9c674  
    99// Author           : Andrew Beach
    1010// Created On       : Tue Apr 30 11:36:00 2019
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Feb 15 18:37:06 2020
    13 // Update Count     : 3
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr May  2 10:45:00 2019
     13// Update Count     : 2
    1414//
    1515
    1616#pragma once
    1717
    18 struct Options {
    19         // External Options: Same thoughout a pass.
    20         bool pretty;
    21         bool genC;
    22         bool lineMarks;
    23         bool printExprTypes;
     18namespace CodeGen {
     19        struct Options {
     20                // External Options: Same thoughout a pass.
     21                bool pretty;
     22                bool genC;
     23                bool lineMarks;
     24                bool printExprTypes;
    2425
    25         // Internal Options: Changed on some recurisive calls.
    26         bool anonymousUnused = false;
     26                // Internal Options: Changed on some recurisive calls.
     27                bool anonymousUnused = false;
    2728
    28         Options(bool pretty, bool genC, bool lineMarks, bool printExprTypes) :
    29                 pretty(pretty), genC(genC), lineMarks(lineMarks), printExprTypes(printExprTypes)
     29                Options(bool pretty, bool genC, bool lineMarks, bool printExprTypes) :
     30                        pretty(pretty), genC(genC), lineMarks(lineMarks), printExprTypes(printExprTypes)
    3031                {}
    31 };
     32        };
     33} // namespace CodeGen
    3234
    3335// Local Variables: //
  • src/CodeTools/ResolvProtoDump.cc

    rfca3bf8 r3b9c674  
    99// Author           : Aaron Moss
    1010// Created On       : Tue Sep 11 09:04:00 2018
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Feb 15 13:50:11 2020
    13 // Update Count     : 3
     11// Last Modified By : Aaron Moss
     12// Last Modified On : Tue Sep 11 09:04:00 2018
     13// Update Count     : 1
    1414//
    1515
     
    182182
    183183                        // replace operator names
    184                         const CodeGen::OperatorInfo * opInfo = CodeGen::operatorLookup( name );
    185                         if ( opInfo ) {
     184                        CodeGen::OperatorInfo info;
     185                        if ( CodeGen::operatorLookup( name, info ) ) {
    186186                                ss << new_prefix(pre, "");
    187                                 op_name( opInfo->outputName, ss );
     187                                op_name( info.outputName, ss );
    188188                                return;
    189189                        }
  • src/ControlStruct/Mutate.cc

    rfca3bf8 r3b9c674  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 03:22:07 2020
    13 // Update Count     : 10
     12// Last Modified On : Thu Aug  4 11:39:08 2016
     13// Update Count     : 9
    1414//
    1515
     
    3737                mutateAll( translationUnit, formut );
    3838        }
    39 } // namespace ControlStruct
     39} // namespace CodeGen
    4040
    4141// Local Variables: //
  • src/InitTweak/FixInit.cc

    rfca3bf8 r3b9c674  
    1010// Created On       : Wed Jan 13 16:29:30 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 04:17:07 2020
    13 // Update Count     : 82
     12// Last Modified On : Fri Dec 13 23:41:27 2019
     13// Update Count     : 77
    1414//
    1515#include "FixInit.h"
     
    745745                }
    746746
    747                 // to prevent warnings ('_unq0' may be used uninitialized in this function),
     747                // to prevent warnings (‘_unq0’ may be used uninitialized in this function),
    748748                // insert an appropriate zero initializer for UniqueExpr temporaries.
    749749                Initializer * makeInit( Type * t ) {
  • src/InitTweak/FixInit.h

    rfca3bf8 r3b9c674  
    1010// Created On       : Wed Jan 13 16:29:30 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 07:54:50 2020
    13 // Update Count     : 8
     12// Last Modified On : Sat Jul 22 09:31:06 2017
     13// Update Count     : 6
    1414//
    1515
     
    2222
    2323namespace InitTweak {
    24         /// replace constructor initializers with expression statements and unwrap basic C-style initializers
     24  /// replace constructor initializers with expression statements
     25  /// and unwrap basic C-style initializers
    2526        void fix( std::list< Declaration * > & translationUnit, bool inLibrary );
    2627} // namespace
  • src/MakeLibCfa.cc

    rfca3bf8 r3b9c674  
    1010// Created On       : Sat May 16 10:33:33 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 03:49:49 2020
    13 // Update Count     : 45
     12// Last Modified On : Fri Dec 13 23:41:40 2019
     13// Update Count     : 42
    1414//
    1515
     
    9696
    9797                        FunctionDecl *funcDecl = origFuncDecl->clone();
    98                         const CodeGen::OperatorInfo * opInfo;
    99                         opInfo = CodeGen::operatorLookup( funcDecl->get_name() );
    100                         assert( opInfo );
     98                        CodeGen::OperatorInfo opInfo;
     99                        bool lookResult = CodeGen::operatorLookup( funcDecl->get_name(), opInfo );
     100                        assert( lookResult );
    101101                        assert( ! funcDecl->get_statements() );
    102102                        // build a recursive call - this is okay, as the call will actually be codegen'd using operator syntax
     
    120120
    121121                        Statement * stmt = nullptr;
    122                         switch ( opInfo->type ) {
     122                        switch ( opInfo.type ) {
    123123                          case CodeGen::OT_INDEX:
    124124                          case CodeGen::OT_CALL:
  • src/Parser/ParserTypes.h

    rfca3bf8 r3b9c674  
    1010// Created On       : Sat Sep 22 08:58:10 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Feb 15 11:04:40 2020
    13 // Update Count     : 351
     12// Last Modified On : Sat Jul 22 09:33:28 2017
     13// Update Count     : 350
    1414//
    1515
     
    2727// current location in the input
    2828extern int yylineno;
    29 extern char * yyfilename;
     29extern char *yyfilename;
    3030
    3131struct Location {
    32     char * file;
     32    char *file;
    3333    int line;
    3434}; // Location
    3535
    3636struct Token {
    37     std::string * str;                                                                  // must be pointer as used in union
     37    std::string *str;                                                                   // must be pointer as used in union
    3838    Location loc;
    3939
  • src/Parser/TypedefTable.cc

    rfca3bf8 r3b9c674  
    1010// Created On       : Sat May 16 15:20:13 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Feb 15 08:06:36 2020
    13 // Update Count     : 259
     12// Last Modified On : Wed Jul 25 15:32:35 2018
     13// Update Count     : 258
    1414//
    1515
     
    4747} // TypedefTable::~TypedefTable
    4848
    49 bool TypedefTable::exists( const string & identifier ) const {
     49bool TypedefTable::exists( const string & identifier ) {
    5050        return kindTable.find( identifier ) != kindTable.end();
    5151} // TypedefTable::exists
    5252
    53 bool TypedefTable::existsCurr( const string & identifier ) const {
     53bool TypedefTable::existsCurr( const string & identifier ) {
    5454        return kindTable.findAt( kindTable.currentScope() - 1, identifier ) != kindTable.end();
    5555} // TypedefTable::exists
  • src/Parser/TypedefTable.h

    rfca3bf8 r3b9c674  
    1010// Created On       : Sat May 16 15:24:36 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Feb 15 08:06:37 2020
    13 // Update Count     : 117
     12// Last Modified On : Wed Jul 25 15:33:55 2018
     13// Update Count     : 114
    1414//
    1515
     
    3030        ~TypedefTable();
    3131
    32         bool exists( const std::string & identifier ) const;
    33         bool existsCurr( const std::string & identifier ) const;
     32        bool exists( const std::string & identifier );
     33        bool existsCurr( const std::string & identifier );
    3434        int isKind( const std::string & identifier ) const;
    3535        void makeTypedef( const std::string & name, int kind = TYPEDEFname );
  • src/Parser/lex.ll

    rfca3bf8 r3b9c674  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Sat Feb 15 11:05:50 2020
    13  * Update Count     : 737
     12 * Last Modified On : Fri Feb  7 19:02:43 2020
     13 * Update Count     : 725
    1414 */
    1515
     
    4242#include "ParseNode.h"
    4343#include "TypedefTable.h"
    44 
    45 string * build_postfix_name( string * name );
    4644
    4745char *yyfilename;
     
    434432"?"({op_unary_pre_post}|"()"|"[?]"|"{}") { IDENTIFIER_RETURN(); }
    435433"^?{}"                  { IDENTIFIER_RETURN(); }
    436 "?`"{identifier} {                                                                              // postfix operator
    437         yylval.tok.str = new string( &yytext[2] );                      // remove ?`
    438         yylval.tok.str = build_postfix_name( yylval.tok.str ); // add prefix
    439         RETURN_LOCN( typedefTable.isKind( *yylval.tok.str ) );
    440 }
     434"?`"{identifier} { IDENTIFIER_RETURN(); }                               // postfix operator
    441435"?"{op_binary_over}"?"  { IDENTIFIER_RETURN(); }                // binary
    442436        /*
  • src/Parser/parser.yy

    rfca3bf8 r3b9c674  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 08:22:14 2020
    13 // Update Count     : 4461
     12// Last Modified On : Sat Feb  1 10:04:40 2020
     13// Update Count     : 4440
    1414//
    1515
     
    166166} // rebindForall
    167167
    168 string * build_postfix_name( string * name ) {
    169         *name = string("__postfix_func_") + *name;
    170         return name;
     168NameExpr * build_postfix_name( const string * name ) {
     169        NameExpr * new_name = build_varref( new string( "?`" + *name ) );
     170        delete name;
     171        return new_name;
    171172} // build_postfix_name
    172173
     
    632633                { $$ = new ExpressionNode( build_func( $1, $3 ) ); }
    633634        | postfix_expression '`' identifier                                     // CFA, postfix call
    634                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_varref( build_postfix_name( $3 ) ) ), $1 ) ); }
     635                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
    635636        | constant '`' identifier                                                       // CFA, postfix call
    636                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_varref( build_postfix_name( $3 ) ) ), $1 ) ); }
     637                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
    637638        | string_literal '`' identifier                                         // CFA, postfix call
    638                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_varref( build_postfix_name( $3 ) ) ), new ExpressionNode( $1 ) ) ); }
     639                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); }
    639640        | postfix_expression '.' identifier
    640641                { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); }
  • src/SymTab/Mangler.cc

    rfca3bf8 r3b9c674  
    1010// Created On       : Sun May 17 21:40:29 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Feb 15 13:55:12 2020
    13 // Update Count     : 33
     12// Last Modified On : Fri Dec 13 23:43:49 2019
     13// Update Count     : 28
    1414//
    1515#include "Mangler.h"
     
    128128                                } // if
    129129                                mangleName << Encoding::manglePrefix;
    130                                 const CodeGen::OperatorInfo * opInfo = CodeGen::operatorLookup( declaration->get_name() );
    131                                 if ( opInfo ) {
    132                                         mangleName << opInfo->outputName.size() << opInfo->outputName;
     130                                CodeGen::OperatorInfo opInfo;
     131                                if ( operatorLookup( declaration->get_name(), opInfo ) ) {
     132                                        mangleName << opInfo.outputName.size() << opInfo.outputName;
    133133                                } else {
    134134                                        mangleName << declaration->name.size() << declaration->name;
     
    471471                        } // if
    472472                        mangleName << Encoding::manglePrefix;
    473                         const CodeGen::OperatorInfo * opInfo = CodeGen::operatorLookup( decl->name );
    474                         if ( opInfo ) {
    475                                 mangleName << opInfo->outputName.size() << opInfo->outputName;
     473                        CodeGen::OperatorInfo opInfo;
     474                        if ( operatorLookup( decl->name, opInfo ) ) {
     475                                mangleName << opInfo.outputName.size() << opInfo.outputName;
    476476                        } else {
    477477                                mangleName << decl->name.size() << decl->name;
  • src/SynTree/Attribute.h

    rfca3bf8 r3b9c674  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 13 21:34:08 2020
    13 // Update Count     : 40
     12// Last Modified On : Sat Jul 22 09:54:14 2017
     13// Update Count     : 39
    1414//
    1515
     
    3838        virtual ~Attribute();
    3939
    40         const std::string & get_name() const { return name; }
     40        std::string get_name() const { return name; }
    4141        void set_name( const std::string & newValue ) { name = newValue; }
    4242        std::list< Expression * > & get_parameters() { return parameters; }
  • tests/.expect/alloc-ERROR.txt

    rfca3bf8 r3b9c674  
    1 alloc.cfa:310:1 error: No reasonable alternatives for expression Applying untyped:
     1alloc.cfa:311:1 error: No reasonable alternatives for expression Applying untyped:
    22  Name: ?=?
    33...to:
     
    1919
    2020
    21 alloc.cfa:311:1 error: No reasonable alternatives for expression Applying untyped:
     21alloc.cfa:312:1 error: No reasonable alternatives for expression Applying untyped:
    2222  Name: ?=?
    2323...to:
     
    3939
    4040
    41 alloc.cfa:312:1 error: No reasonable alternatives for expression Applying untyped:
     41alloc.cfa:313:1 error: No reasonable alternatives for expression Applying untyped:
    4242  Name: ?=?
    4343...to:
     
    5050
    5151
    52 alloc.cfa:313:1 error: No reasonable alternatives for expression Applying untyped:
     52alloc.cfa:314:1 error: No reasonable alternatives for expression Applying untyped:
    5353  Name: ?=?
    5454...to:
  • tests/.expect/alloc.txt

    rfca3bf8 r3b9c674  
    22CFA malloc 0xdeadbeef
    33CFA alloc 0xdeadbeef
     4CFA array alloc, fill 0xde
    45CFA alloc, fill dededede
    56CFA alloc, fill 3
  • tests/.expect/nested-types-ERR1.txt

    rfca3bf8 r3b9c674  
    1 nested-types.cfa:83:1 error: Use of undefined type T
     1nested-types.cfa:70:1 error: Use of undefined type T
  • tests/.expect/nested-types-ERR2.txt

    rfca3bf8 r3b9c674  
    1 nested-types.cfa:86:1 error: Use of undefined global type Z
    2 nested-types.cfa:87:1 error: Qualified type requires an aggregate on the left, but has: signed int
    3 nested-types.cfa:88:1 error: Undefined type in qualified type: Qualified Type:
     1nested-types.cfa:73:1 error: Use of undefined global type Z
     2nested-types.cfa:74:1 error: Qualified type requires an aggregate on the left, but has: signed int
     3nested-types.cfa:75:1 error: Undefined type in qualified type: Qualified Type:
    44  instance of struct S with body 1
    55  instance of type Z (not function type)
  • tests/alloc.cfa

    rfca3bf8 r3b9c674  
    1010// Created On       : Wed Feb  3 07:56:22 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 09:21:13 2020
    13 // Update Count     : 405
     12// Last Modified On : Fri Nov 22 15:34:19 2019
     13// Update Count     : 404
    1414//
    1515
     
    4848
    4949        p = alloc_set( fill );                                                          // CFA alloc, fill
     50        printf( "CFA array alloc, fill %#hhx\n", fill );
    5051        printf( "CFA alloc, fill %08x\n", *p );
    5152        free( p );
  • tests/nested-types.cfa

    rfca3bf8 r3b9c674  
    1010// Created On       : Mon Jul 9 10:20:03 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 12 18:21:15 2020
    13 // Update Count     : 3
     12// Last Modified On : Tue Nov  6 17:59:40 2018
     13// Update Count     : 2
    1414//
    1515
     
    5050//   double d;
    5151// };
    52 
    53 // struct S {
    54 //     enum C { R, G, B };
    55 //     int i;
    56 //     struct T {
    57 //      int i;
    58 //     };
    59 //     T t;
    60 // };
    61 
    62 // S s;
    63 // S.C c;
    64 // S.T t;
    6552
    6653int main() {
  • tests/test.py

    rfca3bf8 r3b9c674  
    152152        # run everything in a temp directory to make sure core file are handled properly
    153153        with tempdir():
    154                 # if the make command succeeds continue otherwise skip to diff
     154                # if the make command succeds continue otherwise skip to diff
    155155                if success(make_ret):
    156156                        with Timed() as run_dur:
Note: See TracChangeset for help on using the changeset viewer.