Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    rf5c3b6c r3351cc0  
    1212#include "Parser/LinkageSpec.h"    // for Spec, isBuiltin, Intrinsic
    1313#include "ResolvExpr/typeops.h"    // for typesCompatibleIgnoreQualifiers
    14 #include "SymTab/Autogen.h"
    1514#include "SymTab/Indexer.h"        // for Indexer
    1615#include "SynTree/Attribute.h"     // for Attribute
     
    9998        class InitExpander::ExpanderImpl {
    10099        public:
     100                virtual ~ExpanderImpl() = default;
    101101                virtual std::list< Expression * > next( std::list< Expression * > & indices ) = 0;
    102102                virtual Statement * buildListInit( UntypedExpr * callExpr, std::list< Expression * > & indices ) = 0;
     
    106106        public:
    107107                InitImpl( Initializer * init ) : init( init ) {}
     108                virtual ~InitImpl() = default;
    108109
    109110                virtual std::list< Expression * > next( __attribute((unused)) std::list< Expression * > & indices ) {
     
    122123        public:
    123124                ExprImpl( Expression * expr ) : arg( expr ) {}
    124 
    125                 ~ExprImpl() { delete arg; }
     125                virtual ~ExprImpl() { delete arg; }
    126126
    127127                virtual std::list< Expression * > next( std::list< Expression * > & indices ) {
     
    524524        }
    525525
    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 
    545526        class ConstExprChecker : public Visitor {
    546527        public:
Note: See TracChangeset for help on using the changeset viewer.