Changes in src/InitTweak/InitTweak.cc [f5c3b6c:3351cc0]
- File:
-
- 1 edited
-
src/InitTweak/InitTweak.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.cc
rf5c3b6c r3351cc0 12 12 #include "Parser/LinkageSpec.h" // for Spec, isBuiltin, Intrinsic 13 13 #include "ResolvExpr/typeops.h" // for typesCompatibleIgnoreQualifiers 14 #include "SymTab/Autogen.h"15 14 #include "SymTab/Indexer.h" // for Indexer 16 15 #include "SynTree/Attribute.h" // for Attribute … … 99 98 class InitExpander::ExpanderImpl { 100 99 public: 100 virtual ~ExpanderImpl() = default; 101 101 virtual std::list< Expression * > next( std::list< Expression * > & indices ) = 0; 102 102 virtual Statement * buildListInit( UntypedExpr * callExpr, std::list< Expression * > & indices ) = 0; … … 106 106 public: 107 107 InitImpl( Initializer * init ) : init( init ) {} 108 virtual ~InitImpl() = default; 108 109 109 110 virtual std::list< Expression * > next( __attribute((unused)) std::list< Expression * > & indices ) { … … 122 123 public: 123 124 ExprImpl( Expression * expr ) : arg( expr ) {} 124 125 ~ExprImpl() { delete arg; } 125 virtual ~ExprImpl() { delete arg; } 126 126 127 127 virtual std::list< Expression * > next( std::list< Expression * > & indices ) { … … 524 524 } 525 525 526 ApplicationExpr * createBitwiseAssignment( Expression * dst, Expression * src ) {527 static FunctionDecl * assign = nullptr;528 if ( ! assign ) {529 // temporary? Generate a fake assignment operator to represent bitwise assignments.530 // This operator could easily exist as a real function, but it's tricky because nothing should resolve to this function.531 TypeDecl * td = new TypeDecl( "T", noStorageClasses, nullptr, TypeDecl::Dtype, true );532 assign = new FunctionDecl( "?=?", noStorageClasses, LinkageSpec::Intrinsic, SymTab::genAssignType( new TypeInstType( noQualifiers, td->name, td ) ), nullptr );533 }534 if ( dynamic_cast< ReferenceType * >( dst->result ) ) {535 dst = new AddressExpr( dst );536 } else {537 dst = new CastExpr( dst, new ReferenceType( noQualifiers, dst->result->clone() ) );538 }539 if ( dynamic_cast< ReferenceType * >( src->result ) ) {540 src = new CastExpr( src, new ReferenceType( noQualifiers, src->result->stripReferences()->clone() ) );541 }542 return new ApplicationExpr( VariableExpr::functionPointer( assign ), { dst, src } );543 }544 545 526 class ConstExprChecker : public Visitor { 546 527 public:
Note:
See TracChangeset
for help on using the changeset viewer.