mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:24:42 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user