Changes in src/CodeGen/CodeGenerator.cpp [f070ea8:7959e56]
- File:
-
- 1 edited
-
src/CodeGen/CodeGenerator.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cpp
rf070ea8 r7959e56 130 130 // TODO: Which means the ast::Pass is just providing a default no visit? 131 131 visit_children = false; 132 changeState_ArgToIntrinsic(false); 132 133 } 133 134 … … 466 467 if ( var->var->linkage == ast::Linkage::Intrinsic && 467 468 ( opInfo = operatorLookup( var->var->name ) ) ) { 469 changeState_ArgToIntrinsic(true); 468 470 auto arg = expr->args.begin(); 469 471 switch ( opInfo->type ) { … … 558 560 if ( auto name = expr->func.as<ast::NameExpr>() ) { 559 561 if ( const OperatorInfo * opInfo = operatorLookup( name->name ) ) { 562 changeState_ArgToIntrinsic(true); 560 563 auto arg = expr->args.begin(); 561 564 switch ( opInfo->type ) { … … 743 746 extension( expr ); 744 747 const OperatorInfo * opInfo; 745 if ( expr->var->linkage == ast::Linkage::Intrinsic 748 if ( visitingArgToIntrinsic 749 && options.genC 750 && dynamic_cast<ast::ZeroType const *>( expr->var->get_type() ) ) { 751 // int * p; p = 0; ==> ?=?( p, (zero_t){} ); ==> p = 0; 752 // void f( zero_t z ) { g(z); } ==> g(z); ==> g(z); 753 // (we are at the last '==>') 754 output << "0"; 755 } else if ( expr->var->linkage == ast::Linkage::Intrinsic 746 756 && ( opInfo = operatorLookup( expr->var->name ) ) 747 757 && opInfo->type == OT_CONSTANT ) {
Note:
See TracChangeset
for help on using the changeset viewer.