summaryrefslogtreecommitdiff
path: root/backend/src
diff options
context:
space:
mode:
authorJunyan He <junyan.he@linux.intel.com>2014-05-15 17:38:53 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-05-16 20:02:08 +0800
commit31ff786aca19847cde402d55e9d7ef20b15c9d52 (patch)
tree42da6cf689e294cbd6210d03053bb1a9a159717f /backend/src
parent3cdc1037d0a7c11b6d35f0b0474fa96656c4c98d (diff)
downloadbeignet-31ff786aca19847cde402d55e9d7ef20b15c9d52.tar.gz
Modify the GenContext and GenEncoder's destructor to virtual
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'backend/src')
-rw-r--r--backend/src/backend/gen75_context.hpp4
-rw-r--r--backend/src/backend/gen75_encoder.hpp4
-rw-r--r--backend/src/backend/gen_context.hpp2
-rw-r--r--backend/src/backend/gen_encoder.hpp2
4 files changed, 8 insertions, 4 deletions
diff --git a/backend/src/backend/gen75_context.hpp b/backend/src/backend/gen75_context.hpp
index 2bb6e175..329b4164 100644
--- a/backend/src/backend/gen75_context.hpp
+++ b/backend/src/backend/gen75_context.hpp
@@ -32,9 +32,9 @@ namespace gbe
class Gen75Context : public GenContext
{
public:
+ virtual ~Gen75Context(void) { }
Gen75Context(const ir::Unit &unit, const std::string &name, uint32_t deviceID, bool relaxMath = false)
- : GenContext(unit, name, deviceID, relaxMath) {
- };
+ : GenContext(unit, name, deviceID, relaxMath) { }
protected:
virtual GenEncoder* generateEncoder(void) {
diff --git a/backend/src/backend/gen75_encoder.hpp b/backend/src/backend/gen75_encoder.hpp
index dc2dc769..a9042b32 100644
--- a/backend/src/backend/gen75_encoder.hpp
+++ b/backend/src/backend/gen75_encoder.hpp
@@ -31,8 +31,10 @@ namespace gbe
class Gen75Encoder : public GenEncoder
{
public:
+ virtual ~Gen75Encoder(void) { }
+
Gen75Encoder(uint32_t simdWidth, uint32_t gen, uint32_t deviceID)
- : GenEncoder(simdWidth, gen, deviceID, 8) { };
+ : GenEncoder(simdWidth, gen, deviceID, 8) { }
virtual void MOV_DF(GenRegister dest, GenRegister src0, GenRegister tmp = GenRegister::null());
virtual void LOAD_DF_IMM(GenRegister dest, GenRegister tmp, double value);
diff --git a/backend/src/backend/gen_context.hpp b/backend/src/backend/gen_context.hpp
index 21ee28d8..750d72b2 100644
--- a/backend/src/backend/gen_context.hpp
+++ b/backend/src/backend/gen_context.hpp
@@ -63,7 +63,7 @@ namespace gbe
GenContext(const ir::Unit &unit, const std::string &name, uint32_t deviceID,
bool relaxMath = false);
/*! Release everything needed */
- ~GenContext(void);
+ virtual ~GenContext(void);
/*! Start new code generation with specific parameters */
void startNewCG(uint32_t simdWidth, uint32_t reservedSpillRegs, bool limitRegisterPressure);
/*! Target device ID*/
diff --git a/backend/src/backend/gen_encoder.hpp b/backend/src/backend/gen_encoder.hpp
index 5129d997..9eaa1c29 100644
--- a/backend/src/backend/gen_encoder.hpp
+++ b/backend/src/backend/gen_encoder.hpp
@@ -66,6 +66,8 @@ namespace gbe
public:
/*! simdWidth is the default width for the instructions */
GenEncoder(uint32_t simdWidth, uint32_t gen, uint32_t deviceID, int jump_width = 1);
+
+ virtual ~GenEncoder(void) { }
/*! Size of the stack (should be large enough) */
enum { MAX_STATE_NUM = 16 };
/*! Push the current instruction state */