Add line-level debug info (#4247)

Seems to work with lldb ( https://pastebin.com/igKkNECm ), though gdb
has /some/ trouble with the paths (they aren't complete - just using the
filename directly, not providing the working directory - might be some
quick hacks that can help there).
This commit is contained in:
David Blaikie
2024-08-26 15:49:31 +00:00
committed by GitHub
parent 5d73743971
commit 0ae2a3907e
104 changed files with 1586 additions and 1009 deletions
+10 -3
View File
@@ -291,9 +291,9 @@ auto FileContext::BuildFunctionDefinition(SemIR::FunctionId function_id)
return;
}
llvm_function->setSubprogram(BuildDISubprogram(function, llvm_function));
FunctionContext function_lowering(*this, llvm_function, vlog_stream_);
FunctionContext function_lowering(*this, llvm_function,
BuildDISubprogram(function, llvm_function),
vlog_stream_);
// TODO: Pass in a specific ID for generic functions.
const auto specific_id = SemIR::SpecificId::Invalid;
@@ -540,4 +540,11 @@ auto FileContext::BuildGlobalVariableDecl(SemIR::VarStorage var_storage)
/*Initializer=*/nullptr, mangled_name);
}
auto FileContext::GetDiagnosticLoc(SemIR::InstId inst_id) -> DiagnosticLoc {
return converter_.ConvertLoc(
inst_id,
[&](DiagnosticLoc /*context_loc*/,
const Internal::DiagnosticBase<>& /*context_diagnostic_base*/) {});
}
} // namespace Carbon::Lower