diff --git a/gen/asmstmt.cpp b/gen/asmstmt.cpp index 453de3b6ab..4aeb0b9202 100644 --- a/gen/asmstmt.cpp +++ b/gen/asmstmt.cpp @@ -184,7 +184,7 @@ void AsmStatement_toIR(AsmStatement *stmt, IRState * irs) assert(asmblock); // debug info - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); if (!stmt->asmcode) return; diff --git a/gen/dibuilder.cpp b/gen/dibuilder.cpp index 5e051da3f2..280dab9563 100644 --- a/gen/dibuilder.cpp +++ b/gen/dibuilder.cpp @@ -776,7 +776,7 @@ void ldc::DIBuilder::EmitFuncStart(FuncDeclaration *fd) LOG_SCOPE; assert(static_cast(getIrFunc(fd)->diSubprogram) != 0); - EmitStopPoint(fd->loc.linnum); + EmitStopPoint(fd->loc); } void ldc::DIBuilder::EmitFuncEnd(FuncDeclaration *fd) @@ -788,7 +788,7 @@ void ldc::DIBuilder::EmitFuncEnd(FuncDeclaration *fd) LOG_SCOPE; assert(static_cast(getIrFunc(fd)->diSubprogram) != 0); - EmitStopPoint(fd->endloc.linnum); + EmitStopPoint(fd->endloc); } void ldc::DIBuilder::EmitBlockStart(Loc& loc) @@ -809,7 +809,7 @@ void ldc::DIBuilder::EmitBlockStart(Loc& loc) #endif ); IR->func()->diLexicalBlocks.push(block); - EmitStopPoint(loc.linnum); + EmitStopPoint(loc); } void ldc::DIBuilder::EmitBlockEnd() @@ -825,15 +825,14 @@ void ldc::DIBuilder::EmitBlockEnd() fn->diLexicalBlocks.pop(); } -void ldc::DIBuilder::EmitStopPoint(unsigned ln) +void ldc::DIBuilder::EmitStopPoint(Loc& loc) { if (!global.params.symdebug) return; - Logger::println("D to dwarf stoppoint at line %u", ln); + Logger::println("D to dwarf stoppoint at line %u, column %u", loc.linnum, loc.charnum); LOG_SCOPE; - llvm::DebugLoc loc = llvm::DebugLoc::get(ln, 0, GetCurrentScope()); - IR->ir->SetCurrentDebugLocation(loc); + IR->ir->SetCurrentDebugLocation(llvm::DebugLoc::get(loc.linnum, loc.charnum, GetCurrentScope())); } void ldc::DIBuilder::EmitValue(llvm::Value *val, VarDeclaration *vd) diff --git a/gen/dibuilder.h b/gen/dibuilder.h index c214b58c69..c4ffadb93e 100644 --- a/gen/dibuilder.h +++ b/gen/dibuilder.h @@ -158,7 +158,7 @@ public: /// \brief Emits debug info for block end void EmitBlockEnd(); - void EmitStopPoint(unsigned ln); + void EmitStopPoint(Loc& loc); void EmitValue(llvm::Value *val, VarDeclaration* vd); diff --git a/gen/statements.cpp b/gen/statements.cpp index fefa2b23ce..b1d4e58390 100644 --- a/gen/statements.cpp +++ b/gen/statements.cpp @@ -371,7 +371,7 @@ public: LOG_SCOPE; // emit dwarf stop point - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); emitCoverageLinecountInc(stmt->loc); @@ -492,7 +492,7 @@ public: LOG_SCOPE; // emit dwarf stop point - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); emitCoverageLinecountInc(stmt->loc); @@ -809,7 +809,7 @@ public: return; // emit dwarf stop point - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); emitCoverageLinecountInc(stmt->loc); @@ -872,7 +872,7 @@ public: LOG_SCOPE; // emit dwarf stop point - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); emitCoverageLinecountInc(stmt->loc); @@ -940,7 +940,7 @@ public: LOG_SCOPE; // emit dwarf stop point - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); // if there's no finalbody or no body, things are simple if (!stmt->finalbody) { @@ -1032,7 +1032,7 @@ public: LOG_SCOPE; // emit dwarf stop point - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); // create basic blocks llvm::BasicBlock* oldend = irs->scopeend(); @@ -1089,7 +1089,7 @@ public: LOG_SCOPE; // emit dwarf stop point - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); emitCoverageLinecountInc(stmt->loc); @@ -1118,7 +1118,7 @@ public: LOG_SCOPE; // emit dwarf stop point - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); emitCoverageLinecountInc(stmt->loc); @@ -1690,7 +1690,7 @@ public: IF_LOG Logger::println("GotoStatement::toIR(): %s", stmt->loc.toChars()); LOG_SCOPE; - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); emitCoverageLinecountInc(stmt->loc); @@ -1708,7 +1708,7 @@ public: IF_LOG Logger::println("GotoDefaultStatement::toIR(): %s", stmt->loc.toChars()); LOG_SCOPE; - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); emitCoverageLinecountInc(stmt->loc); @@ -1730,7 +1730,7 @@ public: IF_LOG Logger::println("GotoCaseStatement::toIR(): %s", stmt->loc.toChars()); LOG_SCOPE; - gIR->DBuilder.EmitStopPoint(stmt->loc.linnum); + gIR->DBuilder.EmitStopPoint(stmt->loc); emitCoverageLinecountInc(stmt->loc); diff --git a/tests/d2/dmd-testsuite b/tests/d2/dmd-testsuite index 0d89e4a813..0f9eda90b2 160000 --- a/tests/d2/dmd-testsuite +++ b/tests/d2/dmd-testsuite @@ -1 +1 @@ -Subproject commit 0d89e4a8139d177093c99d9835ae337ee47a7abb +Subproject commit 0f9eda90b2c48e658491729528e1415c5946adcc