[04/18] Backend: Init the DBGInfo in all constructors.

Submitted by junyan.he@inbox.com on Dec. 24, 2015, 11:01 a.m.

Details

Message ID 1450954930-6914-5-git-send-email-junyan.he@inbox.com
State New
Headers show
Series "Enable profiling by line number." ( rev: 1 ) in Beignet

Not browsing as part of any series.

Commit Message

junyan.he@inbox.com Dec. 24, 2015, 11:01 a.m.
From: Junyan He <junyan.he@linux.intel.com>

Signed-off-by: Junyan He <junyan.he@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(-)

Patch hide | download patch | download mbox

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: