mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 18:01:07 +01:00
Handle unknown lines in DebugInfo (#4252)
Mainly, changes the default from -1 to 0 in DiagnosticLoc, still trying to keep reusing that. Nothing except for the lowered output is affected, so I think this is fine. Also, have lowering consistently call GetDiagnosticLoc. Pulls in one of the CHECKs suggested from #4251 Co-authored-by: David Blaikie <dblaikie@gmail.com>
This commit is contained in:
co-authored by
David Blaikie
parent
97e98bcc5a
commit
1412ecd3f4
@@ -98,7 +98,10 @@ auto FunctionContext::LowerInst(SemIR::InstId inst_id) -> void {
|
||||
CARBON_VLOG() << "Lowering " << inst_id << ": " << inst << "\n";
|
||||
builder_.getInserter().SetCurrentInstId(inst_id);
|
||||
if (di_subprogram_) {
|
||||
auto loc = file_context_->GetDiagnosticLoc(inst_id);
|
||||
auto loc = file_context_->GetLocForDI(inst_id);
|
||||
CARBON_CHECK(loc.filename == di_subprogram_->getFile()->getFilename())
|
||||
<< "Instructions located in a different file from their enclosing "
|
||||
"function aren't handled yet";
|
||||
builder_.SetCurrentDebugLocation(
|
||||
llvm::DILocation::get(builder_.getContext(), loc.line_number,
|
||||
loc.column_number, di_subprogram_));
|
||||
|
||||
Reference in New Issue
Block a user