[Beignet] [PATCH 2/7] Backend: Init the DBGInfo in all constructors.
junyan.he at inbox.com
junyan.he at inbox.com
Thu Dec 17 01:35:53 PST 2015
From: Junyan He <junyan.he at linux.intel.com>
Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
backend/src/backend/gen_encoder.cpp | 1 +
backend/src/backend/gen_insn_selection.cpp | 1 +
backend/src/ir/context.cpp | 4 +++-
backend/src/ir/instruction.hpp | 3 +++
4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/backend/src/backend/gen_encoder.cpp b/backend/src/backend/gen_encoder.cpp
index 9f9e420..ea32dad 100644
--- a/backend/src/backend/gen_encoder.cpp
+++ b/backend/src/backend/gen_encoder.cpp
@@ -310,6 +310,7 @@ namespace gbe
this->curr.subFlag = 0;
this->curr.predicate = GEN_PREDICATE_NORMAL;
this->curr.inversePredicate = 0;
+ this->DBGInfo.col = this->DBGInfo.line = 0;
}
void GenEncoder::push(void) {
diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp
index 630f5bc..de50e57 100644
--- a/backend/src/backend/gen_insn_selection.cpp
+++ b/backend/src/backend/gen_insn_selection.cpp
@@ -824,6 +824,7 @@ namespace gbe
this->regNum = fn.regNum();
this->regDAG.resize(regNum);
this->insnDAG.resize(maxInsnNum);
+ this->DBGInfo.col = this->DBGInfo.line = 0;
}
Selection::Opaque::~Opaque(void) {
diff --git a/backend/src/ir/context.cpp b/backend/src/ir/context.cpp
index e4aac08..79e6a7b 100644
--- a/backend/src/ir/context.cpp
+++ b/backend/src/ir/context.cpp
@@ -29,7 +29,9 @@ namespace gbe {
namespace ir {
Context::Context(Unit &unit) :
- unit(unit), fn(NULL), bb(NULL), usedLabels(NULL) {}
+ unit(unit), fn(NULL), bb(NULL), usedLabels(NULL) {
+ DBGInfo.col = DBGInfo.line = 0;
+ }
Context::~Context(void) {
for (const auto &elem : fnStack) GBE_SAFE_DELETE(elem.usedLabels);
diff --git a/backend/src/ir/instruction.hpp b/backend/src/ir/instruction.hpp
index ec7b9b5..cee2275 100644
--- a/backend/src/ir/instruction.hpp
+++ b/backend/src/ir/instruction.hpp
@@ -157,11 +157,14 @@ namespace ir {
/*! Initialize the instruction from a 8 bytes stream */
INLINE Instruction(const char *stream) : InstructionBase(stream) {
parent = NULL;
+ DBGInfo.col = DBGInfo.line = 0;
}
/*! Copy the private fields and give it the same parent */
INLINE Instruction(const Instruction &other) :
InstructionBase(reinterpret_cast<const char*>(&other.opcode)) {
parent = other.parent;
+ DBGInfo.col = other.DBGInfo.col;
+ DBGInfo.line = other.DBGInfo.line;
}
private:
--
1.9.1
More information about the Beignet
mailing list