src/InitTweak/FixInitNew.cpp
ast::Init * makeInit( const ast::Type * t ) {
		if ( auto inst = dynamic_cast< const ast::StructInstType * >( t ) ) {
			// initizer for empty struct must be empty
			if ( inst->base->members.empty() ) return new ast::ListInit({}, {});
		} else if ( auto inst = dynamic_cast< const ast::UnionInstType * >( t ) ) {
			// initizer for empty union must be empty
			if ( inst->base->members.empty() ) return new ast::ListInit({}, {});
		}

		return new ast::ListInit( {}, { new ast::SingleInit( {}, ast::ConstantExpr::from_int({}, 0) ) } );
	}
// to prevent warnings ('_unq0' may be used uninitialized in this function),
// insert an appropriate zero initializer for UniqueExpr temporaries.
to prevent warnings ('_unq0' may be used uninitialized in this function),
insert an appropriate zero initializer for UniqueExpr temporaries.
to prevent warnings ( ' _unq0 ' may be used uninitialized in this function ) insert an appropriate zero initializer for UniqueExpr temporaries .
ast::Init * makeInit( const ast::Type * t ) {
		if ( auto inst = dynamic_cast< const ast::StructInstType * >( t ) ) {
			if ( inst->base->members.empty() ) return new ast::ListInit({}, {});
		} else if ( auto inst = dynamic_cast< const ast::UnionInstType * >( t ) ) {
			if ( inst->base->members.empty() ) return new ast::ListInit({}, {});
		}
		return new ast::ListInit( {}, { new ast::SingleInit( {}, ast::ConstantExpr::from_int({}, 0) ) } );
	}
ast :: Init * makeInit ( const ast :: Type * t ) { if ( auto inst = dynamic_cast < const ast :: StructInstType * > ( t ) ) { if ( inst -> base -> members . empty ( ) ) return new ast :: ListInit ( { } , { } ) ; } else if ( auto inst = dynamic_cast < const ast :: UnionInstType * > ( t ) ) { if ( inst -> base -> members . empty ( ) ) return new ast :: ListInit ( { } , { } ) ; } return new ast :: ListInit ( { } , { new ast :: SingleInit ( { } , ast :: ConstantExpr :: from_int ( { } , 0 ) ) } ) ; }
to prevent warnings ('_unq0' may be used uninitialized in this function),
insert an appropriate zero initializer for UniqueExpr temporaries.
to prevent warnings ( ' _unq0 ' may be used uninitialized in this function ) insert an appropriate zero initializer for UniqueExpr temporaries .
// initizer for empty struct must be empty // initizer for empty union must be empty