From: Junyan He <[email protected]> We will output the line and column every time before the instruction to ease debug.
Signed-off-by: Junyan He <[email protected]> --- backend/src/ir/instruction.cpp | 3 +++ backend/src/llvm/llvm_gen_backend.cpp | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/src/ir/instruction.cpp b/backend/src/ir/instruction.cpp index bb5aac5..7ba26e4 100644 --- a/backend/src/ir/instruction.cpp +++ b/backend/src/ir/instruction.cpp @@ -2372,6 +2372,9 @@ DECL_MEM_FN(MemInstruction, void, setBtiReg(Register reg), setBtiReg(reg)) std::ostream &operator<< (std::ostream &out, const Instruction &insn) { const Function &fn = insn.getFunction(); const BasicBlock *bb = insn.getParent(); + if (insn.getOpcode() != OP_LABEL) + out << "[" << insn.DBGInfo.line << ", " << insn.DBGInfo.col << "] "; + switch (insn.getOpcode()) { #define DECL_INSN(OPCODE, CLASS) \ case OP_##OPCODE: \ diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp index f2d3704..79ae1fd 100644 --- a/backend/src/llvm/llvm_gen_backend.cpp +++ b/backend/src/llvm/llvm_gen_backend.cpp @@ -1844,10 +1844,8 @@ namespace gbe GBE_ASSERT(labelMap.find(BB) != labelMap.end()); ctx.LABEL(labelMap[BB]); for (auto II = BB->begin(), E = BB->end(); II != E; ++II) { - if(OCL_DEBUGINFO) { - llvm::Instruction * It = dyn_cast<llvm::Instruction>(II); - setDebugInfo_CTX(It); - } + llvm::Instruction * It = dyn_cast<llvm::Instruction>(II); + setDebugInfo_CTX(It); visit(*II); } } -- 1.9.1 _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
