Changes in / [6b8b767:0a73148]


Ignore:
Location:
src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.h

    r6b8b767 r0a73148  
    5656        {"reference-conversion"   , "rvalue to reference conversion of rvalue: %s" , Severity::Warn},
    5757        {"qualifiers-zero_t-one_t", "questionable use of type qualifier %s with %s", Severity::Warn},
     58        {"aggregate-forward-decl" , "forward declaration of nested aggregate: %s"  , Severity::Warn},
    5859};
    5960
     
    6263        RvalueToReferenceConversion,
    6364        BadQualifiersZeroOne,
     65        AggrForwardDecl,
    6466        NUMBER_OF_WARNINGS, //This MUST be the last warning
    6567};
  • src/Parser/DeclarationNode.cc

    r6b8b767 r0a73148  
    10031003                                // };
    10041004                                if ( ! (extracted && decl->name == "" && ! anon) ) {
     1005                                        if (decl->name == "") {
     1006                                                if ( DeclarationWithType * dwt = dynamic_cast<DeclarationWithType *>( decl ) ) {
     1007                                                        if ( ReferenceToType * aggr = dynamic_cast<ReferenceToType *>( dwt->get_type() ) ) {
     1008                                                                if ( aggr->name.find("anonymous") == std::string::npos ) {
     1009                                                                        bool isInline = false;
     1010                                                                        if (cur->type->kind == TypeData::Aggregate || cur->type->kind == TypeData::AggregateInst) {
     1011                                                                                if (cur->type->kind == TypeData::Aggregate) {
     1012                                                                                        isInline = cur->type->aggregate.inLine;
     1013                                                                                } else {
     1014                                                                                        isInline = cur->type->aggInst.inLine;
     1015                                                                                        if ( TypeData * aggr = cur->type->aggInst.aggregate ) {
     1016                                                                                                if ( aggr->kind == TypeData::Aggregate ) {
     1017                                                                                                        isInline = isInline || aggr->aggregate.inLine;
     1018                                                                                                }
     1019                                                                                        }
     1020                                                                                }
     1021                                                                        }
     1022                                                                        if (! isInline) {
     1023                                                                                // temporary: warn about anonymous member declarations of named types, since this conflicts with the syntax for the forward declaration of an anonymous type
     1024                                                                                SemanticWarning( cur->location, Warning::AggrForwardDecl, aggr->name.c_str() );
     1025                                                                        }
     1026                                                                }
     1027                                                        }
     1028                                                }
     1029                                        }
    10051030                                        decl->location = cur->location;
    10061031                                        * out++ = decl;
  • src/Parser/TypedefTable.cc

    r6b8b767 r0a73148  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // TypedefTable.cc -- 
     7// TypedefTable.cc --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Sat May 16 15:20:13 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 12 16:16:24 2018
    13 // Update Count     : 256
     12// Last Modified On : Fri Jul 13 18:35:54 2018
     13// Update Count     : 257
    1414//
    1515
  • src/Parser/parser.yy

    r6b8b767 r0a73148  
    23072307                { $$ = new ExpressionNode( new TypeExpr( maybeMoveBuildType( $1 ) ) ); }
    23082308        | assignment_expression
     2309                { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $1->build()) ); $$ = nullptr; }
    23092310        | type_list ',' type
    23102311                { $$ = (ExpressionNode *)( $1->set_last( new ExpressionNode( new TypeExpr( maybeMoveBuildType( $3 ) ) ) ) ); }
    23112312        | type_list ',' assignment_expression
    2312                 { $$ = (ExpressionNode *)( $1->set_last( $3 )); }
     2313                { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $3->build()) ); $$ = nullptr; }
     2314                // { $$ = (ExpressionNode *)( $1->set_last( $3 )); }
    23132315        ;
    23142316
  • src/ResolvExpr/AlternativeFinder.cc

    r6b8b767 r0a73148  
    482482        template< typename ForwardIterator, typename OutputIterator >
    483483        void inferRecursive( ForwardIterator begin, ForwardIterator end, const Alternative &newAlt, OpenVarSet &openVars, const SymTab::Indexer &decls, const AssertionSet &newNeed, int level, const SymTab::Indexer &indexer, OutputIterator out ) {
     484                if ( newAlt.cost == Cost::infinity ) return; // don't proceed down this dead end
    484485                if ( begin == end ) {
    485486                        if ( newNeed.empty() ) {
     
    11851186                                std::cerr << "bindings are:" << std::endl;
    11861187                                withFunc.env.print( std::cerr, 8 );
     1188                                std::cerr << "cost is: " << withFunc.cost << std::endl;
    11871189                                std::cerr << "cost of conversion is:" << cvtCost << std::endl;
    11881190                        )
  • src/ResolvExpr/CommonType.cc

    r6b8b767 r0a73148  
    267267                                                result = otherPointer->clone();
    268268                                        } // if
    269                                         result->get_qualifiers() = tq1 | tq2;
     269                                        strict_dynamic_cast<PointerType*>(result)->base->get_qualifiers() = tq1 | tq2;
    270270                                } else {
    271271                                        /// std::cerr << "place for ptr-to-type" << std::endl;
     
    304304                                                result = otherRef->clone();
    305305                                        } // if
    306                                         result->get_qualifiers() = tq1 | tq2;
     306                                        strict_dynamic_cast<ReferenceType*>(result)->base->get_qualifiers() = tq1 | tq2;
    307307                                } else {
    308308                                        /// std::cerr << "place for ptr-to-type" << std::endl;
  • src/SymTab/FixFunction.cc

    r6b8b767 r0a73148  
    3030                // can't delete function type because it may contain assertions, so transfer ownership to new object
    3131                ObjectDecl *pointer = new ObjectDecl( functionDecl->name, functionDecl->get_storageClasses(), functionDecl->linkage, nullptr, new PointerType( Type::Qualifiers(), functionDecl->type ), nullptr, functionDecl->attributes );
     32                pointer->location = functionDecl->location;
    3233                functionDecl->attributes.clear();
    3334                functionDecl->type = nullptr;
     
    4344                // need to recursively mutate the base type in order for multi-dimensional arrays to work.
    4445                PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->base, arrayType->dimension, arrayType->isVarLen, arrayType->isStatic );
     46                pointerType->location = arrayType->location;
    4547                arrayType->base = nullptr;
    4648                arrayType->dimension = nullptr;
  • src/libcfa/bits/defs.h

    r6b8b767 r0a73148  
    2828
    2929#ifdef __cforall
    30 #define __cfa_anonymous_object
     30#define __cfa_anonymous_object(x) inline struct x
    3131#else
    32 #define __cfa_anonymous_object __cfa_anonymous_object
     32#define __cfa_anonymous_object(x) x __cfa_anonymous_object
    3333#endif
    3434
  • src/libcfa/concurrency/invoke.h

    r6b8b767 r0a73148  
    9393
    9494                // list of acceptable functions, null if any
    95                 __small_array_t(struct __acceptable_t) __cfa_anonymous_object;
     95                __cfa_anonymous_object( __small_array_t(struct __acceptable_t) );
    9696        };
    9797
     
    121121        struct __monitor_group_t {
    122122                // currently held monitors
    123                 __small_array_t(monitor_desc*) __cfa_anonymous_object;
     123                __cfa_anonymous_object( __small_array_t(monitor_desc*) );
    124124
    125125                // last function that acquired monitors
  • src/libcfa/concurrency/monitor

    r6b8b767 r0a73148  
    138138
    139139struct __acceptable_t {
    140         __monitor_group_t;
     140        inline struct __monitor_group_t;
    141141        bool is_dtor;
    142142};
  • src/libcfa/containers/result

    r6b8b767 r0a73148  
    2828struct result {
    2929        bool has_value;
    30         inner_result(T, E);
     30        inline union inner_result(T, E);
    3131};
    3232
  • src/libcfa/interpose.c

    r6b8b767 r0a73148  
    3333// Interposing helpers
    3434//=============================================================================================
     35
     36void preload_libgcc(void) {
     37        dlopen( "libgcc_s.so.1", RTLD_NOW );
     38        if ( const char * error = dlerror() ) abort( "interpose_symbol : internal error pre-loading libgcc, %s\n", error );
     39}
    3540
    3641typedef void (* generic_fptr_t)(void);
     
    9297                const char *version = NULL;
    9398
     99                preload_libgcc();
     100
    94101#pragma GCC diagnostic push
    95102#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
Note: See TracChangeset for help on using the changeset viewer.