Fixed compiler error caused by private destructor (#1199)

Changed virtual private base class to a virtual public base class to work around a clang compilation failure. Also marked other classes final to work around virtual-related compiler warnings.
This commit is contained in:
Nandor Licker 2022-09-08 12:15:14 +03:00 committed by GitHub
parent 71ccb4c9a7
commit cb755ee969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -41,12 +41,10 @@ constexpr int RANGE_COUNT_SIZE = 48;
constexpr uint32_t BIN_H_MASK = (1L << (BIN_SIZE - 32)) - 1;
constexpr uint32_t RANGE_H_MASK = (1L << (RANGE_COUNT_SIZE - 32)) - 1;
class AddrRangeCounter : public FpgaModel {
class AddrRangeCounter final : public FpgaModel {
public:
AddrRangeCounter(simif_t *sim, AddressMap addr_map, std::string name)
: FpgaModel(sim, addr_map), name(name){};
~AddrRangeCounter(void) { /*delete [] range_bytes;*/
}
void init();
void profile() {}
@ -63,10 +61,11 @@ private:
std::string addr = name + "Ranges_addr";
};
class Histogram : public FpgaModel {
class Histogram final : public FpgaModel {
public:
Histogram(simif_t *s, AddressMap addr_map, std::string name)
: FpgaModel(s, addr_map), name(name){};
void init();
void profile(){};
void finish();

View File

@ -25,6 +25,8 @@ private:
public:
FpgaModel(simif_t *s, AddressMap addr_map) : sim(s), addr_map(addr_map){};
virtual ~FpgaModel() {}
virtual void init() = 0;
virtual void profile() = 0;
virtual void finish() = 0;

View File

@ -11,7 +11,7 @@
#include "bridges/synthesized_prints.h"
class fasedtests_top_t : virtual simif_peek_poke_t,
class fasedtests_top_t : virtual public simif_peek_poke_t,
public systematic_scheduler_t {
public:
fasedtests_top_t(int argc, char **argv);