Changes in / [fc4a0fa:101e0bd]
- Location:
- src
- Files:
-
- 1 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
rfc4a0fa r101e0bd 33 33 #include "SymTab/Autogen.h" 34 34 #include "GenPoly/PolyMutator.h" 35 #include "GenPoly/DeclMutator.h"36 35 #include "SynTree/AddStmtVisitor.h" 37 36 #include "CodeGen/GenType.h" // for warnings … … 217 216 SymTab::Indexer & indexer; 218 217 }; 219 220 class FixCtorExprs : public GenPoly::DeclMutator {221 public:222 /// expands ConstructorExpr nodes into comma expressions, using a temporary for the first argument223 static void fix( std::list< Declaration * > & translationUnit );224 225 virtual Expression * mutate( ConstructorExpr * ctorExpr );226 };227 218 } // namespace 228 219 … … 230 221 // fixes ConstructorInit for global variables. should happen before fixInitializers. 231 222 InitTweak::fixGlobalInit( translationUnit, filename, inLibrary ); 232 233 223 234 224 InsertImplicitCalls::insert( translationUnit ); … … 241 231 242 232 GenStructMemberCalls::generate( translationUnit ); 243 // xxx - ctor expansion currently has to be after FixCopyCtors, because there is currently a244 // hack in the way untyped assignments are generated, where the first argument cannot have245 // its address taken because of the way codegeneration handles UntypedExpr vs. ApplicationExpr.246 // Thus such assignment exprs must never pushed through expression resolution (and thus should247 // not go through the FixCopyCtors pass), otherwise they will fail -- guaranteed.248 // Also needs to happen after GenStructMemberCalls, since otherwise member constructors exprs249 // don't look right, and a member can be constructed more than once.250 FixCtorExprs::fix( translationUnit );251 233 } 252 234 … … 301 283 throw warner.errors; 302 284 } 303 }304 305 void FixCtorExprs::fix( std::list< Declaration * > & translationUnit ) {306 FixCtorExprs fixer;307 fixer.mutateDeclarationList( translationUnit );308 285 } 309 286 … … 503 480 retExpr = deref; 504 481 } // if 505 retExpr->set_env( env->clone() ); 482 // xxx - might need to set env on retExpr... 483 // retExpr->set_env( env->clone() ); 506 484 return retExpr; 507 485 } else { … … 936 914 return safe_dynamic_cast< ApplicationExpr * >( ResolvExpr::findVoidExpression( untypedExpr, indexer ) ); 937 915 } 938 939 Expression * FixCtorExprs::mutate( ConstructorExpr * ctorExpr ) {940 static UniqueName tempNamer( "_tmp_ctor_expr" );941 assert( ctorExpr->get_results().size() == 1 );942 ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, nullptr, ctorExpr->get_results().front()->clone(), nullptr );943 addDeclaration( tmp );944 945 ApplicationExpr * callExpr = safe_dynamic_cast< ApplicationExpr * > ( ctorExpr->get_callExpr() );946 TypeSubstitution * env = ctorExpr->get_env();947 ctorExpr->set_callExpr( nullptr );948 ctorExpr->set_env( nullptr );949 950 Expression *& firstArg = callExpr->get_args().front();951 UntypedExpr * assign = new UntypedExpr( new NameExpr( "?=?" ) );952 assign->get_args().push_back( new VariableExpr( tmp ) );953 assign->get_args().push_back( firstArg );954 cloneAll( ctorExpr->get_results(), assign->get_results() );955 firstArg = assign;956 957 CommaExpr * commaExpr = new CommaExpr( callExpr, new VariableExpr( tmp ) );958 commaExpr->set_env( env );959 delete ctorExpr;960 return commaExpr;961 }962 916 } // namespace 963 917 } // namespace InitTweak -
src/InitTweak/InitTweak.cc
rfc4a0fa r101e0bd 358 358 template<typename CallExpr> 359 359 Expression *& callArg( CallExpr * callExpr, unsigned int pos ) { 360 if ( pos >= callExpr->get_args().size() ) assert f( false,"asking for argument that doesn't exist. Return NULL/throw exception?" );360 if ( pos >= callExpr->get_args().size() ) assert( false && "asking for argument that doesn't exist. Return NULL/throw exception?" ); 361 361 for ( Expression *& arg : callExpr->get_args() ) { 362 362 if ( pos == 0 ) return arg; … … 373 373 return callArg( untypedExpr, pos ); 374 374 } else { 375 assert f( false,"Unexpected expression type passed to getCallArg" );375 assert( false && "Unexpected expression type passed to getCallArg" ); 376 376 } 377 377 } … … 387 387 } else if ( MemberExpr * memberExpr = dynamic_cast< MemberExpr * >( func ) ) { 388 388 return memberExpr->get_member()->get_name(); 389 } else if ( UntypedMemberExpr * memberExpr = dynamic_cast< UntypedMemberExpr * > ( func ) ) {390 return memberExpr->get_member();391 389 } else { 392 assert f( false,"Unexpected expression type being called as a function in call expression" );390 assert( false && "Unexpected expression type being called as a function in call expression" ); 393 391 } 394 392 } … … 402 400 } else { 403 401 std::cerr << expr << std::endl; 404 assert f( false,"Unexpected expression type passed to getFunctionName" );402 assert( false && "Unexpected expression type passed to getFunctionName" ); 405 403 } 406 404 } -
src/Parser/parser.yy
rfc4a0fa r101e0bd 389 389 { 390 390 Token fn; 391 fn.str = new std::string( "?{}" ); // location undefined - use location of '{'?392 $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 )) ) );391 fn.str = new std::string( "?{}" ); // location undefined 392 $$ = new ExpressionNode( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ); 393 393 } 394 394 ; -
src/ResolvExpr/AlternativeFinder.cc
rfc4a0fa r101e0bd 197 197 } 198 198 199 void AlternativeFinder::find( Expression *expr, bool adjust , bool prune) {199 void AlternativeFinder::find( Expression *expr, bool adjust ) { 200 200 expr->accept( *this ); 201 201 if ( alternatives.empty() ) { … … 207 207 } 208 208 } 209 if ( prune ) { 210 PRINT( 211 std::cerr << "alternatives before prune:" << std::endl; 212 printAlts( alternatives, std::cerr ); 213 ) 214 AltList::iterator oldBegin = alternatives.begin(); 215 pruneAlternatives( alternatives.begin(), alternatives.end(), front_inserter( alternatives ), indexer ); 216 if ( alternatives.begin() == oldBegin ) { 217 std::ostringstream stream; 218 stream << "Can't choose between alternatives for expression "; 219 expr->print( stream ); 220 stream << "Alternatives are:"; 221 AltList winners; 222 findMinCost( alternatives.begin(), alternatives.end(), back_inserter( winners ) ); 223 printAlts( winners, stream, 8 ); 224 throw SemanticError( stream.str() ); 225 } 226 alternatives.erase( oldBegin, alternatives.end() ); 227 PRINT( 228 std::cerr << "there are " << alternatives.size() << " alternatives after elimination" << std::endl; 229 ) 230 } 209 PRINT( 210 std::cerr << "alternatives before prune:" << std::endl; 211 printAlts( alternatives, std::cerr ); 212 ) 213 AltList::iterator oldBegin = alternatives.begin(); 214 pruneAlternatives( alternatives.begin(), alternatives.end(), front_inserter( alternatives ), indexer ); 215 if ( alternatives.begin() == oldBegin ) { 216 std::ostringstream stream; 217 stream << "Can't choose between alternatives for expression "; 218 expr->print( stream ); 219 stream << "Alternatives are:"; 220 AltList winners; 221 findMinCost( alternatives.begin(), alternatives.end(), back_inserter( winners ) ); 222 printAlts( winners, stream, 8 ); 223 throw SemanticError( stream.str() ); 224 } 225 alternatives.erase( oldBegin, alternatives.end() ); 226 PRINT( 227 std::cerr << "there are " << alternatives.size() << " alternatives after elimination" << std::endl; 228 ) 231 229 232 230 // Central location to handle gcc extension keyword for all expression types. … … 236 234 } 237 235 238 void AlternativeFinder::findWithAdjustment( Expression *expr , bool prune) {239 find( expr, true , prune);236 void AlternativeFinder::findWithAdjustment( Expression *expr ) { 237 find( expr, true ); 240 238 } 241 239 242 240 template< typename StructOrUnionType > 243 void AlternativeFinder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, conststd::string &name ) {241 void AlternativeFinder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const std::string &name ) { 244 242 std::list< Declaration* > members; 245 243 aggInst->lookup( name, members ); … … 762 760 if ( agg->expr->get_results().size() == 1 ) { 763 761 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( agg->expr->get_results().front() ) ) { 764 addAggMembers( structInst, agg->expr, agg->cost, agg->env,memberExpr->get_member() );762 addAggMembers( structInst, agg->expr, agg->cost, memberExpr->get_member() ); 765 763 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( agg->expr->get_results().front() ) ) { 766 addAggMembers( unionInst, agg->expr, agg->cost, agg->env,memberExpr->get_member() );764 addAggMembers( unionInst, agg->expr, agg->cost, memberExpr->get_member() ); 767 765 } // if 768 766 } // if … … 791 789 renameTypes( alternatives.back().expr ); 792 790 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( (*i)->get_type() ) ) { 793 addAggMembers( structInst, &newExpr, Cost( 0, 0, 1 ), env,"" );791 addAggMembers( structInst, &newExpr, Cost( 0, 0, 1 ), "" ); 794 792 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( (*i)->get_type() ) ) { 795 addAggMembers( unionInst, &newExpr, Cost( 0, 0, 1 ), env,"" );793 addAggMembers( unionInst, &newExpr, Cost( 0, 0, 1 ), "" ); 796 794 } // if 797 795 } // for … … 1014 1012 alternatives.push_back( Alternative( impCpCtorExpr->clone(), env, Cost::zero ) ); 1015 1013 } 1016 1017 void AlternativeFinder::visit( ConstructorExpr * ctorExpr ) {1018 AlternativeFinder finder( indexer, env );1019 // don't prune here, since it's guaranteed all alternatives will have the same type1020 // (giving the alternatives different types is half of the point of ConstructorExpr nodes)1021 finder.findWithAdjustment( ctorExpr->get_callExpr(), false );1022 for ( Alternative & alt : finder.alternatives ) {1023 alternatives.push_back( Alternative( new ConstructorExpr( alt.expr->clone() ), alt.env, alt.cost ) );1024 }1025 }1026 1014 } // namespace ResolvExpr 1027 1015 -
src/ResolvExpr/AlternativeFinder.h
rfc4a0fa r101e0bd 29 29 public: 30 30 AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env ); 31 void find( Expression *expr, bool adjust = false , bool prune = true);31 void find( Expression *expr, bool adjust = false ); 32 32 /// Calls find with the adjust flag set; adjustment turns array and function types into equivalent pointer types 33 void findWithAdjustment( Expression *expr , bool prune = true);33 void findWithAdjustment( Expression *expr ); 34 34 AltList &get_alternatives() { return alternatives; } 35 35 … … 66 66 virtual void visit( TupleExpr *tupleExpr ); 67 67 virtual void visit( ImplicitCopyCtorExpr * impCpCtorExpr ); 68 virtual void visit( ConstructorExpr * ctorExpr );69 68 public: // xxx - temporary hack - should make Tuples::TupleAssignment a friend 70 69 template< typename InputIterator, typename OutputIterator > … … 73 72 private: 74 73 /// Adds alternatives for member expressions, given the aggregate, conversion cost for that aggregate, and name of the member 75 template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const TypeEnvironment & env, conststd::string &name );74 template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const std::string &name ); 76 75 /// Adds alternatives for offsetof expressions, given the base type and name of the member 77 76 template< typename StructOrUnionType > void addOffsetof( StructOrUnionType *aggInst, const std::string &name ); -
src/SymTab/Validate.cc
rfc4a0fa r101e0bd 60 60 #include "ResolvExpr/typeops.h" 61 61 #include <algorithm> 62 #include "InitTweak/InitTweak.h"63 62 64 63 #define debugPrint( x ) if ( doDebug ) { std::cout << x; } … … 172 171 }; 173 172 174 class VerifyCtorDtor Assign: public Visitor {173 class VerifyCtorDtor : public Visitor { 175 174 public: 176 /// ensure that constructors , destructors, and assignmenthave at least one177 /// parameter, the first of which must be a pointer, and that ctor/dtors haveno175 /// ensure that constructors and destructors have at least one 176 /// parameter, the first of which must be a pointer, and no 178 177 /// return values. 179 178 static void verify( std::list< Declaration * > &translationUnit ); … … 203 202 compoundliteral.mutateDeclarationList( translationUnit ); 204 203 acceptAll( translationUnit, pass3 ); 205 VerifyCtorDtor Assign::verify( translationUnit );204 VerifyCtorDtor::verify( translationUnit ); 206 205 } 207 206 … … 688 687 } 689 688 690 void VerifyCtorDtor Assign::verify( std::list< Declaration * > & translationUnit ) {691 VerifyCtorDtor Assignverifier;689 void VerifyCtorDtor::verify( std::list< Declaration * > & translationUnit ) { 690 VerifyCtorDtor verifier; 692 691 acceptAll( translationUnit, verifier ); 693 692 } 694 693 695 void VerifyCtorDtor Assign::visit( FunctionDecl * funcDecl ) {694 void VerifyCtorDtor::visit( FunctionDecl * funcDecl ) { 696 695 FunctionType * funcType = funcDecl->get_functionType(); 697 696 std::list< DeclarationWithType * > &returnVals = funcType->get_returnVals(); 698 697 std::list< DeclarationWithType * > ¶ms = funcType->get_parameters(); 699 698 700 if ( InitTweak::isCtorDtorAssign( funcDecl->get_name() )) {699 if ( funcDecl->get_name() == "?{}" || funcDecl->get_name() == "^?{}" ) { 701 700 if ( params.size() == 0 ) { 702 throw SemanticError( "Constructors , destructors, and assignment functions require at least one parameter ", funcDecl );701 throw SemanticError( "Constructors and destructors require at least one parameter ", funcDecl ); 703 702 } 704 703 if ( ! dynamic_cast< PointerType * >( params.front()->get_type() ) ) { 705 throw SemanticError( "First parameter of a constructor , destructor, or assignment functionmust be a pointer ", funcDecl );704 throw SemanticError( "First parameter of a constructor or destructor must be a pointer ", funcDecl ); 706 705 } 707 if ( InitTweak::isCtorDtor( funcDecl->get_name() ) &&returnVals.size() != 0 ) {706 if ( returnVals.size() != 0 ) { 708 707 throw SemanticError( "Constructors and destructors cannot have explicit return values ", funcDecl ); 709 708 } -
src/SynTree/Expression.cc
rfc4a0fa r101e0bd 28 28 #include "TypeSubstitution.h" 29 29 #include "Common/utility.h" 30 #include "InitTweak/InitTweak.h"31 30 32 31 … … 494 493 495 494 void ImplicitCopyCtorExpr::print( std::ostream &os, int indent ) const { 496 os << "Implicit Copy Constructor Expression: " << std::endl;495 os << std::string( indent, ' ' ) << "Implicit Copy Constructor Expression: " << std::endl; 497 496 assert( callExpr ); 498 497 callExpr->print( os, indent + 2 ); … … 504 503 } 505 504 506 507 ConstructorExpr::ConstructorExpr( Expression * callExpr ) : callExpr( callExpr ) { 508 // allow resolver to type a constructor used as an expression as if it has the same type as its first argument 509 assert( callExpr ); 510 Expression * arg = InitTweak::getCallArg( callExpr, 0 ); 511 assert( arg ); 512 cloneAll( arg->get_results(), results ); 513 } 514 515 ConstructorExpr::ConstructorExpr( const ConstructorExpr & other ) : Expression( other ), callExpr( maybeClone( other.callExpr ) ) { 516 } 517 518 ConstructorExpr::~ConstructorExpr() { 519 delete callExpr; 520 } 521 522 void ConstructorExpr::print( std::ostream &os, int indent ) const { 523 os << "Constructor Expression: " << std::endl; 524 assert( callExpr ); 525 os << std::string( indent+2, ' ' ); 526 callExpr->print( os, indent + 2 ); 527 Expression::print( os, indent ); 505 UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {} 506 507 UntypedValofExpr::~UntypedValofExpr() { delete body; } 508 509 void UntypedValofExpr::print( std::ostream &os, int indent ) const { 510 os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl; 511 if ( get_body() != 0 ) 512 get_body()->print( os, indent + 2 ); 528 513 } 529 514 … … 544 529 if ( type ) type->print( os, indent + 2 ); 545 530 if ( initializer ) initializer->print( os, indent + 2 ); 546 }547 548 UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {}549 550 UntypedValofExpr::~UntypedValofExpr() { delete body; }551 552 void UntypedValofExpr::print( std::ostream &os, int indent ) const {553 os << std::string( indent, ' ' ) << "Valof Expression: " << std::endl;554 if ( get_body() != 0 )555 get_body()->print( os, indent + 2 );556 531 } 557 532 -
src/SynTree/Expression.h
rfc4a0fa r101e0bd 595 595 }; 596 596 597 /// ConstructorExpr represents the use of a constructor in an expression context, e.g. int * x = malloc() { 5 };598 class ConstructorExpr : public Expression {599 public:600 ConstructorExpr( Expression * callExpr );601 ConstructorExpr( const ConstructorExpr & other );602 ~ConstructorExpr();603 604 Expression *get_ callExpr() const { return callExpr; }605 void set_callExpr( Expression *newValue ) { callExpr = newValue; }606 607 virtual ConstructorExpr *clone() const { return new ConstructorExpr( *this ); }608 virtual void accept( Visitor &v ) { v.visit( this ); } 609 virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); } 610 virtual void print( std::ostream &os, int indent = 0 ) const; 611 private:612 Expression * callExpr;597 /// ValofExpr represents a GCC 'lambda expression' 598 class UntypedValofExpr : public Expression { 599 public: 600 UntypedValofExpr( Statement *_body, Expression *_aname = nullptr ) : Expression( _aname ), body ( _body ) {} 601 UntypedValofExpr( const UntypedValofExpr & other ); 602 virtual ~UntypedValofExpr(); 603 604 Expression *get_value(); 605 Statement *get_body() const { return body; } 606 607 virtual UntypedValofExpr *clone() const { return new UntypedValofExpr( *this ); } 608 virtual void accept( Visitor &v ) { v.visit( this ); } 609 virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); } 610 virtual void print( std::ostream &os, int indent = 0 ) const; 611 private: 612 Statement *body; 613 613 }; 614 614 … … 635 635 }; 636 636 637 /// ValofExpr represents a GCC 'lambda expression'638 class UntypedValofExpr : public Expression {639 public:640 UntypedValofExpr( Statement *_body, Expression *_aname = nullptr ) : Expression( _aname ), body ( _body ) {}641 UntypedValofExpr( const UntypedValofExpr & other );642 virtual ~UntypedValofExpr();643 644 Expression *get_value();645 Statement *get_body() const { return body; }646 647 virtual UntypedValofExpr *clone() const { return new UntypedValofExpr( *this ); }648 virtual void accept( Visitor &v ) { v.visit( this ); }649 virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }650 virtual void print( std::ostream &os, int indent = 0 ) const;651 private:652 Statement *body;653 };654 655 /// RangeExpr represents a range e.g. '3 ... 5' or '1~10'656 637 class RangeExpr : public Expression { 657 638 public: -
src/SynTree/Mutator.cc
rfc4a0fa r101e0bd 339 339 } 340 340 341 Expression* Mutator::mutate( ConstructorExpr *ctorExpr ) { 342 mutateAll( ctorExpr->get_results(), *this ); 343 ctorExpr->set_callExpr( maybeMutate( ctorExpr->get_callExpr(), *this ) ); 344 return ctorExpr; 341 Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) { 342 mutateAll( valofExpr->get_results(), *this ); 343 return valofExpr; 345 344 } 346 345 … … 350 349 compLitExpr->set_initializer( maybeMutate( compLitExpr->get_initializer(), *this ) ); 351 350 return compLitExpr; 352 }353 354 Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) {355 mutateAll( valofExpr->get_results(), *this );356 return valofExpr;357 351 } 358 352 -
src/SynTree/Mutator.h
rfc4a0fa r101e0bd 76 76 virtual Expression* mutate( AsmExpr *asmExpr ); 77 77 virtual Expression* mutate( ImplicitCopyCtorExpr *impCpCtorExpr ); 78 virtual Expression* mutate( ConstructorExpr *ctorExpr );78 virtual Expression* mutate( UntypedValofExpr *valofExpr ); 79 79 virtual Expression* mutate( CompoundLiteralExpr *compLitExpr ); 80 virtual Expression* mutate( UntypedValofExpr *valofExpr );81 80 virtual Expression* mutate( RangeExpr *rangeExpr ); 82 81 -
src/SynTree/SynTree.h
rfc4a0fa r101e0bd 81 81 class AsmExpr; 82 82 class ImplicitCopyCtorExpr; 83 class ConstructorExpr;83 class UntypedValofExpr; 84 84 class CompoundLiteralExpr; 85 class UntypedValofExpr;86 85 class RangeExpr; 87 86 -
src/SynTree/Visitor.cc
rfc4a0fa r101e0bd 287 287 } 288 288 289 void Visitor::visit( ConstructorExpr * ctorExpr ) {290 acceptAll( ctorExpr->get_results(), *this );291 maybeAccept( ctorExpr->get_callExpr(), *this );289 void Visitor::visit( UntypedValofExpr *valofExpr ) { 290 acceptAll( valofExpr->get_results(), *this ); 291 maybeAccept( valofExpr->get_body(), *this ); 292 292 } 293 293 … … 296 296 maybeAccept( compLitExpr->get_type(), *this ); 297 297 maybeAccept( compLitExpr->get_initializer(), *this ); 298 }299 300 void Visitor::visit( UntypedValofExpr *valofExpr ) {301 acceptAll( valofExpr->get_results(), *this );302 maybeAccept( valofExpr->get_body(), *this );303 298 } 304 299 -
src/SynTree/Visitor.h
rfc4a0fa r101e0bd 76 76 virtual void visit( AsmExpr *asmExpr ); 77 77 virtual void visit( ImplicitCopyCtorExpr *impCpCtorExpr ); 78 virtual void visit( ConstructorExpr * ctorExpr );78 virtual void visit( UntypedValofExpr *valofExpr ); 79 79 virtual void visit( CompoundLiteralExpr *compLitExpr ); 80 virtual void visit( UntypedValofExpr *valofExpr );81 80 virtual void visit( RangeExpr *rangeExpr ); 82 81 -
src/include/assert.h
rfc4a0fa r101e0bd 22 22 #define assertf(expr, fmt, ...) ((expr) ? static_cast<void>(0) : __assert_fail_f(__VSTRINGIFY__(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ## __VA_ARGS__ )) 23 23 24 void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) __attribute__((noreturn));24 void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ); 25 25 26 26 template<typename T, typename U> -
src/libcfa/prelude.cf
rfc4a0fa r101e0bd 636 636 637 637 // default ctor 638 void ?{}( _Bool * ) ;639 void ?{}( char * ) ;640 void ?{}( unsigned char * ) ;641 void ?{}( char signed * ) ;642 void ?{}( int short * ) ;643 void ?{}( int short unsigned * ) ;644 void ?{}( signed int * ) ;645 void ?{}( unsigned int * ) ;646 void ?{}( signed long int * ) ;647 void ?{}( unsigned long int * ) ;648 void ?{}( signed long long int * ) ;649 void ?{}( unsigned long long int * ) ;650 void ?{}( float * ) ;651 void ?{}( double * ) ;652 void ?{}( long double * ) ;653 void ?{}( float _Complex * ) ;654 void ?{}( double _Complex * ) ;655 void ?{}( long double _Complex * ) ;638 void ?{}( _Bool * ), ?{}( volatile _Bool * ); 639 void ?{}( char * ), ?{}( volatile char * ); 640 void ?{}( unsigned char * ), ?{}( volatile unsigned char * ); 641 void ?{}( char signed * ), ?{}( volatile char signed * ); 642 void ?{}( int short * ), ?{}( volatile int short * ); 643 void ?{}( int short unsigned * ), ?{}( volatile int short unsigned * ); 644 void ?{}( signed int * ), ?{}( volatile signed int * ); 645 void ?{}( unsigned int * ), ?{}( volatile unsigned int * ); 646 void ?{}( signed long int * ), ?{}( volatile signed long int * ); 647 void ?{}( unsigned long int * ), ?{}( volatile unsigned long int * ); 648 void ?{}( signed long long int * ), ?{}( volatile signed long long int * ); 649 void ?{}( unsigned long long int * ), ?{}( volatile unsigned long long int * ); 650 void ?{}( float * ), ?{}( volatile float * ); 651 void ?{}( double * ), ?{}( volatile double * ); 652 void ?{}( long double * ), ?{}( volatile long double * ); 653 void ?{}( float _Complex * ), ?{}( volatile float _Complex * ); 654 void ?{}( double _Complex * ), ?{}( volatile double _Complex * ); 655 void ?{}( long double _Complex * ), ?{}( volatile long double _Complex * ); 656 656 657 657 // copy ctor 658 void ?{}( _Bool *, _Bool ) ;659 void ?{}( char *, char ) ;660 void ?{}( unsigned char *, unsigned char ) ;661 void ?{}( char signed *, char signed ) ;662 void ?{}( int short *, int short ) ;663 void ?{}( int short unsigned *, int short unsigned ) ;664 void ?{}( signed int *, signed int) ;665 void ?{}( unsigned int *, unsigned int) ;666 void ?{}( signed long int *, signed long int) ;667 void ?{}( unsigned long int *, unsigned long int) ;668 void ?{}( signed long long int *, signed long long int) ;669 void ?{}( unsigned long long int *, unsigned long long int) ;670 void ?{}( float *, float) ;671 void ?{}( double *, double) ;672 void ?{}( long double *, long double) ;673 void ?{}( float _Complex *, float _Complex) ;674 void ?{}( double _Complex *, double _Complex) ;675 void ?{}( long double _Complex *, long double _Complex) ;658 void ?{}( _Bool *, _Bool ), ?{}( volatile _Bool *, _Bool ); 659 void ?{}( char *, char ), ?{}( volatile char *, char ); 660 void ?{}( unsigned char *, unsigned char ), ?{}( volatile unsigned char *, unsigned char ); 661 void ?{}( char signed *, char signed ), ?{}( volatile char signed *, char signed ); 662 void ?{}( int short *, int short ), ?{}( volatile int short *, int short ); 663 void ?{}( int short unsigned *, int short unsigned ), ?{}( volatile int short unsigned *, int short unsigned ); 664 void ?{}( signed int *, signed int), ?{}( volatile signed int *, signed int ); 665 void ?{}( unsigned int *, unsigned int), ?{}( volatile unsigned int *, unsigned int ); 666 void ?{}( signed long int *, signed long int), ?{}( volatile signed long int *, signed long int ); 667 void ?{}( unsigned long int *, unsigned long int), ?{}( volatile unsigned long int *, unsigned long int ); 668 void ?{}( signed long long int *, signed long long int), ?{}( volatile signed long long int *, signed long long int ); 669 void ?{}( unsigned long long int *, unsigned long long int), ?{}( volatile unsigned long long int *, unsigned long long int ); 670 void ?{}( float *, float), ?{}( volatile float *, float ); 671 void ?{}( double *, double), ?{}( volatile double *, double ); 672 void ?{}( long double *, long double), ?{}( volatile long double *, long double ); 673 void ?{}( float _Complex *, float _Complex), ?{}( volatile float _Complex *, float _Complex ); 674 void ?{}( double _Complex *, double _Complex), ?{}( volatile double _Complex *, double _Complex ); 675 void ?{}( long double _Complex *, long double _Complex), ?{}( volatile long double _Complex *, long double _Complex ); 676 676 677 677 // dtor 678 void ^?{}( _Bool * ) ;679 void ^?{}( char * ) ;680 void ^?{}( char unsigned * ) ;681 void ^?{}( char signed * ) ;682 void ^?{}( int short * ) ;683 void ^?{}( int short unsigned * ) ;684 void ^?{}( signed int * ) ;685 void ^?{}( unsigned int * ) ;686 void ^?{}( signed long int * ) ;687 void ^?{}( unsigned long int * ) ;688 void ^?{}( signed long long int * ) ;689 void ^?{}( unsigned long long int * ) ;690 void ^?{}( float * ) ;691 void ^?{}( double * ) ;692 void ^?{}( long double * ) ;693 void ^?{}( float _Complex * ) ;694 void ^?{}( double _Complex * ) ;695 void ^?{}( long double _Complex * ) ;678 void ^?{}( _Bool * ), ^?{}( volatile _Bool * ); 679 void ^?{}( char * ), ^?{}( volatile char * ); 680 void ^?{}( char unsigned * ), ^?{}( volatile char unsigned * ); 681 void ^?{}( char signed * ), ^?{}( volatile char signed * ); 682 void ^?{}( int short * ), ^?{}( volatile int short * ); 683 void ^?{}( int short unsigned * ), ^?{}( volatile int short unsigned * ); 684 void ^?{}( signed int * ), ^?{}( volatile signed int * ); 685 void ^?{}( unsigned int * ), ^?{}( volatile unsigned int * ); 686 void ^?{}( signed long int * ), ^?{}( volatile signed long int * ); 687 void ^?{}( unsigned long int * ), ^?{}( volatile unsigned long int * ); 688 void ^?{}( signed long long int * ), ^?{}( volatile signed long long int * ); 689 void ^?{}( unsigned long long int * ), ^?{}( volatile unsigned long long int * ); 690 void ^?{}( float * ), ^?{}( volatile float * ); 691 void ^?{}( double * ), ^?{}( volatile double * ); 692 void ^?{}( long double * ), ^?{}( volatile long double * ); 693 void ^?{}( float _Complex * ), ^?{}( volatile float _Complex * ); 694 void ^?{}( double _Complex * ), ^?{}( volatile double _Complex * ); 695 void ^?{}( long double _Complex * ), ^?{}( volatile long double _Complex * ); 696 696 697 697 // // default ctor … … 719 719 720 720 forall( dtype DT ) void ?{}( DT * *, DT * ); 721 forall( dtype DT ) void ?{}( DT * volatile *, DT * ); 721 722 forall( dtype DT ) void ?{}( const DT * *, DT * ); 723 forall( dtype DT ) void ?{}( const DT * volatile *, DT * ); 722 724 forall( dtype DT ) void ?{}( const DT * *, const DT * ); 725 forall( dtype DT ) void ?{}( const DT * volatile *, const DT * ); 723 726 forall( dtype DT ) void ?{}( volatile DT * *, DT * ); 727 forall( dtype DT ) void ?{}( volatile DT * volatile *, DT * ); 724 728 forall( dtype DT ) void ?{}( volatile DT * *, volatile DT * ); 729 forall( dtype DT ) void ?{}( volatile DT * volatile *, volatile DT * ); 725 730 726 731 forall( dtype DT ) void ?{}( const volatile DT * *, DT * ); 732 forall( dtype DT ) void ?{}( const volatile DT * volatile *, DT * ); 727 733 forall( dtype DT ) void ?{}( const volatile DT * *, const DT * ); 734 forall( dtype DT ) void ?{}( const volatile DT * volatile *, const DT * ); 728 735 forall( dtype DT ) void ?{}( const volatile DT * *, volatile DT * ); 736 forall( dtype DT ) void ?{}( const volatile DT * volatile *, volatile DT * ); 729 737 forall( dtype DT ) void ?{}( const volatile DT * *, const volatile DT * ); 738 forall( dtype DT ) void ?{}( const volatile DT * volatile *, const volatile DT * ); 730 739 731 740 forall( dtype DT ) void ?{}( DT * *, void * ); 741 forall( dtype DT ) void ?{}( DT * volatile *, void * ); 732 742 forall( dtype DT ) void ?{}( const DT * *, void * ); 743 forall( dtype DT ) void ?{}( const DT * volatile *, void * ); 733 744 forall( dtype DT ) void ?{}( const DT * *, const void * ); 745 forall( dtype DT ) void ?{}( const DT * volatile *, const void * ); 734 746 forall( dtype DT ) void ?{}( volatile DT * *, void * ); 747 forall( dtype DT ) void ?{}( volatile DT * volatile *, void * ); 735 748 forall( dtype DT ) void ?{}( volatile DT * *, volatile void * ); 749 forall( dtype DT ) void ?{}( volatile DT * volatile *, volatile void * ); 736 750 737 751 forall( dtype DT ) void ?{}( const volatile DT * *, void * ); 752 forall( dtype DT ) void ?{}( const volatile DT * volatile *, void * ); 738 753 forall( dtype DT ) void ?{}( const volatile DT * *, const void * ); 754 forall( dtype DT ) void ?{}( const volatile DT * volatile *, const void * ); 739 755 forall( dtype DT ) void ?{}( const volatile DT * *, volatile void * ); 756 forall( dtype DT ) void ?{}( const volatile DT * volatile *, volatile void * ); 740 757 forall( dtype DT ) void ?{}( const volatile DT * *, const volatile void * ); 758 forall( dtype DT ) void ?{}( const volatile DT * volatile *, const volatile void * ); 741 759 742 760 forall( dtype DT ) void ?{}( void * *, DT * ); 761 forall( dtype DT ) void ?{}( void * volatile *, DT * ); 743 762 forall( dtype DT ) void ?{}( const void * *, DT * ); 763 forall( dtype DT ) void ?{}( const void * volatile *, DT * ); 744 764 forall( dtype DT ) void ?{}( const void * *, const DT * ); 765 forall( dtype DT ) void ?{}( const void * volatile *, const DT * ); 745 766 forall( dtype DT ) void ?{}( volatile void * *, DT * ); 767 forall( dtype DT ) void ?{}( volatile void * volatile *, DT * ); 746 768 forall( dtype DT ) void ?{}( volatile void * *, volatile DT * ); 769 forall( dtype DT ) void ?{}( volatile void * volatile *, volatile DT * ); 747 770 forall( dtype DT ) void ?{}( const volatile void * *, DT * ); 771 forall( dtype DT ) void ?{}( const volatile void * volatile *, DT * ); 748 772 forall( dtype DT ) void ?{}( const volatile void * *, const DT * ); 773 forall( dtype DT ) void ?{}( const volatile void * volatile *, const DT * ); 749 774 forall( dtype DT ) void ?{}( const volatile void * *, volatile DT * ); 775 forall( dtype DT ) void ?{}( const volatile void * volatile *, volatile DT * ); 750 776 forall( dtype DT ) void ?{}( const volatile void * *, const volatile DT * ); 777 forall( dtype DT ) void ?{}( const volatile void * volatile *, const volatile DT * ); 751 778 752 779 void ?{}( void * *, void * ); 780 void ?{}( void * volatile *, void * ); 753 781 void ?{}( const void * *, void * ); 782 void ?{}( const void * volatile *, void * ); 754 783 void ?{}( const void * *, const void * ); 784 void ?{}( const void * volatile *, const void * ); 755 785 void ?{}( volatile void * *, void * ); 786 void ?{}( volatile void * volatile *, void * ); 756 787 void ?{}( volatile void * *, volatile void * ); 788 void ?{}( volatile void * volatile *, volatile void * ); 757 789 void ?{}( const volatile void * *, void * ); 790 void ?{}( const volatile void * volatile *, void * ); 758 791 void ?{}( const volatile void * *, const void * ); 792 void ?{}( const volatile void * volatile *, const void * ); 759 793 void ?{}( const volatile void * *, volatile void * ); 794 void ?{}( const volatile void * volatile *, volatile void * ); 760 795 void ?{}( const volatile void * *, const volatile void * ); 796 void ?{}( const volatile void * volatile *, const volatile void * ); 761 797 762 798 //forall( dtype DT ) void ?{}( DT * *, forall( dtype DT2 ) const DT2 * ); 763 799 //forall( dtype DT ) void ?{}( DT * volatile *, forall( dtype DT2 ) const DT2 * ); 764 800 forall( dtype DT ) void ?{}( const DT * *, forall( dtype DT2 ) const DT2 * ); 801 forall( dtype DT ) void ?{}( const DT * volatile *, forall( dtype DT2 ) const DT2 * ); 765 802 //forall( dtype DT ) void ?{}( volatile DT * *, forall( dtype DT2 ) const DT2 * ); 766 803 //forall( dtype DT ) void ?{}( volatile DT * volatile *, forall( dtype DT2 ) const DT2 * ); 767 804 forall( dtype DT ) void ?{}( const volatile DT * *, forall( dtype DT2 ) const DT2 * ); 805 forall( dtype DT ) void ?{}( const volatile DT * volatile *, forall( dtype DT2 ) const DT2 * ); 768 806 769 807 forall( ftype FT ) void ?{}( FT * *, forall( ftype FT2 ) FT2 * ); 808 forall( ftype FT ) void ?{}( FT * volatile *, forall( ftype FT2 ) FT2 * ); 770 809 771 810 // default ctors 772 811 forall( ftype FT ) void ?{}( FT * * ); 812 forall( ftype FT ) void ?{}( FT * volatile * ); 773 813 774 814 forall( dtype DT ) void ?{}( DT * *); 815 forall( dtype DT ) void ?{}( DT * volatile *); 775 816 forall( dtype DT ) void ?{}( const DT * *); 817 forall( dtype DT ) void ?{}( const DT * volatile *); 776 818 forall( dtype DT ) void ?{}( volatile DT * *); 819 forall( dtype DT ) void ?{}( volatile DT * volatile *); 777 820 forall( dtype DT ) void ?{}( const volatile DT * *); 821 forall( dtype DT ) void ?{}( const volatile DT * volatile *); 778 822 779 823 void ?{}( void * *); 824 void ?{}( void * volatile *); 780 825 void ?{}( const void * *); 826 void ?{}( const void * volatile *); 781 827 void ?{}( volatile void * *); 828 void ?{}( volatile void * volatile *); 782 829 void ?{}( const volatile void * *); 830 void ?{}( const volatile void * volatile *); 783 831 784 832 // dtors 785 833 forall( ftype FT ) void ^?{}( FT * * ); 834 forall( ftype FT ) void ^?{}( FT * volatile * ); 786 835 787 836 forall( dtype DT ) void ^?{}( DT * *); 837 forall( dtype DT ) void ^?{}( DT * volatile *); 788 838 forall( dtype DT ) void ^?{}( const DT * *); 839 forall( dtype DT ) void ^?{}( const DT * volatile *); 789 840 forall( dtype DT ) void ^?{}( volatile DT * *); 841 forall( dtype DT ) void ^?{}( volatile DT * volatile *); 790 842 forall( dtype DT ) void ^?{}( const volatile DT * *); 843 forall( dtype DT ) void ^?{}( const volatile DT * volatile *); 791 844 792 845 void ^?{}( void * *); 846 void ^?{}( void * volatile *); 793 847 void ^?{}( const void * *); 848 void ^?{}( const void * volatile *); 794 849 void ^?{}( volatile void * *); 850 void ^?{}( volatile void * volatile *); 795 851 void ^?{}( const volatile void * *); 852 void ^?{}( const volatile void * volatile *); 796 853 797 854 // Local Variables: //
Note: See TracChangeset
for help on using the changeset viewer.