Skip to content

Commit

Permalink
Add filename and line number to function debug info metadata (#4243)
Browse files Browse the repository at this point in the history
Refactors a bunch of the SemIRDiagnosticConverter to be able to use that
from Lower to access source locations there to use in debug info.

I assume some of this is a bit jank/would need to be fixed/improved in
the future - like the context functor that's passed into ConvertLoc?
(not totally clear what that's for/what the debug info will be missing
out on in its absence, I could throw a FIXME in there if you like)

---------

Co-authored-by: Jon Ross-Perkins <[email protected]>
  • Loading branch information
dwblaikie and jonmeow authored Aug 23, 2024
1 parent 935715e commit c5ada29
Show file tree
Hide file tree
Showing 110 changed files with 261 additions and 241 deletions.
28 changes: 11 additions & 17 deletions toolchain/check/check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,17 @@ struct UnitInfo {
llvm::SmallVector<Import> imports;
};

explicit UnitInfo(SemIR::CheckIRId check_ir_id, Unit& unit)
explicit UnitInfo(SemIR::CheckIRId check_ir_id, Unit& unit,
Parse::NodeLocConverter& converter)
: check_ir_id(check_ir_id),
unit(&unit),
converter(unit.tokens, unit.tokens->source().filename(),
unit.get_parse_tree_and_subtrees),
err_tracker(*unit.consumer),
emitter(converter, err_tracker) {}

SemIR::CheckIRId check_ir_id;
Unit* unit;

// Emitter information.
Parse::NodeLocConverter converter;
ErrorTrackingDiagnosticConsumer err_tracker;
DiagnosticEmitter<Parse::NodeLoc> emitter;

Expand Down Expand Up @@ -834,14 +832,14 @@ static auto DiagnoseMissingDefinitions(Context& context,
// NOLINTNEXTLINE(readability-function-size)
static auto ProcessNodeIds(Context& context, llvm::raw_ostream* vlog_stream,
ErrorTrackingDiagnosticConsumer& err_tracker,
Parse::NodeLocConverter* converter) -> bool {
Parse::NodeLocConverter& converter) -> bool {
NodeIdTraversal traversal(context, vlog_stream);

Parse::NodeId node_id = Parse::NodeId::Invalid;

// On crash, report which token we were handling.
PrettyStackTraceFunction node_dumper([&](llvm::raw_ostream& output) {
auto loc = converter->ConvertLoc(
auto loc = converter.ConvertLoc(
node_id, [](DiagnosticLoc, const Internal::DiagnosticBase<>&) {});
loc.FormatLocation(output);
output << ": checking " << context.parse_tree().node_kind(node_id) << "\n";
Expand Down Expand Up @@ -873,7 +871,7 @@ static auto ProcessNodeIds(Context& context, llvm::raw_ostream* vlog_stream,

// Produces and checks the IR for the provided Parse::Tree.
static auto CheckParseTree(
llvm::MutableArrayRef<Parse::NodeLocConverter*> node_converters,
llvm::MutableArrayRef<Parse::NodeLocConverter> node_converters,
UnitInfo& unit_info, int total_ir_count, llvm::raw_ostream* vlog_stream)
-> void {
auto package_id = IdentifierId::Invalid;
Expand Down Expand Up @@ -907,7 +905,7 @@ static auto CheckParseTree(
ImportImpls(context);

if (!ProcessNodeIds(context, vlog_stream, unit_info.err_tracker,
&unit_info.converter)) {
node_converters[unit_info.check_ir_id.index])) {
context.sem_ir().set_has_errors(true);
return;
}
Expand Down Expand Up @@ -1190,19 +1188,15 @@ static auto BuildApiMapAndDiagnosePackaging(
return api_map;
}

auto CheckParseTrees(llvm::MutableArrayRef<Unit> units, bool prelude_import,
llvm::raw_ostream* vlog_stream) -> void {
// Prepare diagnostic emitters in case we run into issues during package
// checking.
//
auto CheckParseTrees(
llvm::MutableArrayRef<Unit> units,
llvm::MutableArrayRef<Parse::NodeLocConverter> node_converters,
bool prelude_import, llvm::raw_ostream* vlog_stream) -> void {
// UnitInfo is big due to its SmallVectors, so we default to 0 on the stack.
llvm::SmallVector<UnitInfo, 0> unit_infos;
unit_infos.reserve(units.size());
llvm::SmallVector<Parse::NodeLocConverter*> node_converters;
node_converters.reserve(units.size());
for (auto [i, unit] : llvm::enumerate(units)) {
unit_infos.emplace_back(SemIR::CheckIRId(i), unit);
node_converters.push_back(&unit_infos.back().converter);
unit_infos.emplace_back(SemIR::CheckIRId(i), unit, node_converters[i]);
}

Map<ImportKey, UnitInfo*> api_map =
Expand Down
7 changes: 5 additions & 2 deletions toolchain/check/check.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "common/ostream.h"
#include "toolchain/base/value_store.h"
#include "toolchain/check/sem_ir_diagnostic_converter.h"
#include "toolchain/diagnostics/diagnostic_emitter.h"
#include "toolchain/lex/tokenized_buffer.h"
#include "toolchain/parse/tree.h"
Expand All @@ -29,8 +30,10 @@ struct Unit {

// Checks a group of parse trees. This will use imports to decide the order of
// checking.
auto CheckParseTrees(llvm::MutableArrayRef<Unit> units, bool prelude_import,
llvm::raw_ostream* vlog_stream) -> void;
auto CheckParseTrees(
llvm::MutableArrayRef<Unit> units,
llvm::MutableArrayRef<Parse::NodeLocConverter> node_converters,
bool prelude_import, llvm::raw_ostream* vlog_stream) -> void;

} // namespace Carbon::Check

Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/sem_ir_diagnostic_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ auto SemIRDiagnosticConverter::ConvertLocInFile(const SemIR::File* sem_ir,
bool token_only,
ContextFnT context_fn) const
-> DiagnosticLoc {
return node_converters_[sem_ir->check_ir_id().index]->ConvertLoc(
return node_converters_[sem_ir->check_ir_id().index].ConvertLoc(
Parse::NodeLoc(node_id, token_only), context_fn);
}

Expand Down
4 changes: 2 additions & 2 deletions toolchain/check/sem_ir_diagnostic_converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Carbon::Check {
class SemIRDiagnosticConverter : public DiagnosticConverter<SemIRLoc> {
public:
explicit SemIRDiagnosticConverter(
llvm::ArrayRef<Parse::NodeLocConverter*> node_converters,
llvm::ArrayRef<Parse::NodeLocConverter> node_converters,
const SemIR::File* sem_ir)
: node_converters_(node_converters), sem_ir_(sem_ir) {}

Expand All @@ -38,7 +38,7 @@ class SemIRDiagnosticConverter : public DiagnosticConverter<SemIRLoc> {
-> DiagnosticLoc;

// Converters for each SemIR.
llvm::ArrayRef<Parse::NodeLocConverter*> node_converters_;
llvm::ArrayRef<Parse::NodeLocConverter> node_converters_;

// The current SemIR being processed.
const SemIR::File* sem_ir_;
Expand Down
21 changes: 15 additions & 6 deletions toolchain/driver/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ class Driver::CompilationUnit {
}

// Lower SemIR to LLVM IR.
auto RunLower() -> void {
auto RunLower(const Check::SemIRDiagnosticConverter& converter) -> void {
CARBON_CHECK(sem_ir_);

LogCall("Lower::LowerToLLVM", [&] {
Expand All @@ -689,8 +689,8 @@ class Driver::CompilationUnit {
// producing textual LLVM IR.
SemIR::InstNamer inst_namer(*tokens_, *parse_tree_, *sem_ir_);
module_ = Lower::LowerToLLVM(*llvm_context_, options_.include_debug_info,
input_filename_, *sem_ir_, &inst_namer,
vlog_stream_);
converter, input_filename_, *sem_ir_,
&inst_namer, vlog_stream_);
});
if (vlog_stream_) {
CARBON_VLOG() << "*** llvm::Module ***\n";
Expand Down Expand Up @@ -941,8 +941,15 @@ auto Driver::Compile(const CompileOptions& options,
check_units.push_back(unit->GetCheckUnit());
}
}
llvm::SmallVector<Parse::NodeLocConverter> node_converters;
node_converters.reserve(check_units.size());
for (auto& unit : check_units) {
node_converters.emplace_back(unit.tokens, unit.tokens->source().filename(),
unit.get_parse_tree_and_subtrees);
}
CARBON_VLOG() << "*** Check::CheckParseTrees ***\n";
Check::CheckParseTrees(check_units, options.prelude_import, vlog_stream_);
Check::CheckParseTrees(check_units, node_converters, options.prelude_import,
vlog_stream_);
CARBON_VLOG() << "*** Check::CheckParseTrees done ***\n";
for (auto& unit : units) {
if (unit->has_source()) {
Expand All @@ -961,8 +968,10 @@ auto Driver::Compile(const CompileOptions& options,
}

// Lower.
for (auto& unit : units) {
unit->RunLower();
for (const auto& unit : units) {
Check::SemIRDiagnosticConverter converter(node_converters,
&**unit->GetCheckUnit().sem_ir);
unit->RunLower(converter);
}
if (options.phase == CompileOptions::Phase::Lower) {
return make_result();
Expand Down
2 changes: 2 additions & 0 deletions toolchain/lower/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ cc_library(
hdrs = ["lower.h"],
deps = [
":context",
"//toolchain/check:sem_ir_diagnostic_converter",
"//toolchain/sem_ir:file",
"//toolchain/sem_ir:inst_namer",
"@llvm-project//llvm:Core",
Expand Down Expand Up @@ -45,6 +46,7 @@ cc_library(
"//common:map",
"//common:vlog",
"//toolchain/base:kind_switch",
"//toolchain/check:sem_ir_diagnostic_converter",
"//toolchain/sem_ir:entry_point",
"//toolchain/sem_ir:file",
"//toolchain/sem_ir:ids",
Expand Down
15 changes: 10 additions & 5 deletions toolchain/lower/file_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
namespace Carbon::Lower {

FileContext::FileContext(llvm::LLVMContext& llvm_context,
bool include_debug_info, llvm::StringRef module_name,
const SemIR::File& sem_ir,
bool include_debug_info,
const Check::SemIRDiagnosticConverter& converter,
llvm::StringRef module_name, const SemIR::File& sem_ir,
const SemIR::InstNamer* inst_namer,
llvm::raw_ostream* vlog_stream)
: llvm_context_(&llvm_context),
Expand All @@ -32,6 +33,7 @@ FileContext::FileContext(llvm::LLVMContext& llvm_context,
include_debug_info
? BuildDICompileUnit(module_name, *llvm_module_, di_builder_)
: nullptr),
converter_(converter),
sem_ir_(&sem_ir),
inst_namer_(inst_namer),
vlog_stream_(vlog_stream) {
Expand Down Expand Up @@ -362,18 +364,21 @@ auto FileContext::BuildFunctionDefinition(SemIR::FunctionId function_id)
}
}

auto FileContext::BuildDISubprogram(const SemIR::Function& /*function*/,
auto FileContext::BuildDISubprogram(const SemIR::Function& function,
const llvm::Function* llvm_function)
-> llvm::DISubprogram* {
if (!di_compile_unit_) {
return nullptr;
}
auto loc = converter_.ConvertLoc(
function.definition_id,
[](DiagnosticLoc, const Internal::DiagnosticBase<>&) {});
// FIXME: Add more details here, including mangled name, real subroutine type
// (once type information is built), etc.
return di_builder_.createFunction(
di_compile_unit_, llvm_function->getName(), /*LinkageName=*/"",
/*File=*/nullptr,
/*LineNo=*/0,
/*File=*/di_builder_.createFile(loc.filename, ""),
/*LineNo=*/loc.line_number,
di_builder_.createSubroutineType(
di_builder_.getOrCreateTypeArray(std::nullopt)),
/*ScopeLine=*/0, llvm::DINode::FlagZero,
Expand Down
4 changes: 4 additions & 0 deletions toolchain/lower/file_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "llvm/IR/DIBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "toolchain/check/sem_ir_diagnostic_converter.h"
#include "toolchain/sem_ir/file.h"
#include "toolchain/sem_ir/inst_namer.h"

Expand All @@ -18,6 +19,7 @@ namespace Carbon::Lower {
class FileContext {
public:
explicit FileContext(llvm::LLVMContext& llvm_context, bool include_debug_info,
const Check::SemIRDiagnosticConverter& converter,
llvm::StringRef module_name, const SemIR::File& sem_ir,
const SemIR::InstNamer* inst_namer,
llvm::raw_ostream* vlog_stream);
Expand Down Expand Up @@ -102,6 +104,8 @@ class FileContext {
// The DICompileUnit, if any - null implies debug info is not being emitted.
llvm::DICompileUnit* di_compile_unit_;

const Check::SemIRDiagnosticConverter& converter_;

// The input SemIR.
const SemIR::File* const sem_ir_;

Expand Down
5 changes: 3 additions & 2 deletions toolchain/lower/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
namespace Carbon::Lower {

auto LowerToLLVM(llvm::LLVMContext& llvm_context, bool include_debug_info,
const Check::SemIRDiagnosticConverter& converter,
llvm::StringRef module_name, const SemIR::File& sem_ir,
const SemIR::InstNamer* inst_namer,
llvm::raw_ostream* vlog_stream)
-> std::unique_ptr<llvm::Module> {
FileContext context(llvm_context, include_debug_info, module_name, sem_ir,
inst_namer, vlog_stream);
FileContext context(llvm_context, include_debug_info, converter, module_name,
sem_ir, inst_namer, vlog_stream);
return context.Run();
}

Expand Down
2 changes: 2 additions & 0 deletions toolchain/lower/lower.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@

#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "toolchain/check/sem_ir_diagnostic_converter.h"
#include "toolchain/sem_ir/file.h"
#include "toolchain/sem_ir/inst_namer.h"

namespace Carbon::Lower {

// Lowers SemIR to LLVM IR.
auto LowerToLLVM(llvm::LLVMContext& llvm_context, bool include_debug_info,
const Check::SemIRDiagnosticConverter& converter,
llvm::StringRef module_name, const SemIR::File& sem_ir,
const SemIR::InstNamer* inst_namer,
llvm::raw_ostream* vlog_stream)
Expand Down
2 changes: 1 addition & 1 deletion toolchain/lower/testdata/alias/local.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ fn F() -> i32 {
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !3 = !DIFile(filename: "local.carbon", directory: "")
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{}
2 changes: 1 addition & 1 deletion toolchain/lower/testdata/array/array_in_place.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ fn G() {
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !3 = !DIFile(filename: "array_in_place.carbon", directory: "")
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "G", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{}
4 changes: 2 additions & 2 deletions toolchain/lower/testdata/array/assign_return_value.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn Run() {
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !3 = !DIFile(filename: "assign_return_value.carbon", directory: "")
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{}
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "main", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2)
2 changes: 1 addition & 1 deletion toolchain/lower/testdata/array/base.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ fn Run() {
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !3 = !DIFile(filename: "base.carbon", directory: "")
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "main", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{}
4 changes: 2 additions & 2 deletions toolchain/lower/testdata/array/function_param.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn G() -> i32 {
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !3 = !DIFile(filename: "function_param.carbon", directory: "")
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{}
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "G", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "G", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2)
4 changes: 2 additions & 2 deletions toolchain/lower/testdata/basics/false_true.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn T() -> bool {
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !3 = !DIFile(filename: "false_true.carbon", directory: "")
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{}
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "T", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "T", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2)
8 changes: 4 additions & 4 deletions toolchain/lower/testdata/basics/int_types.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ fn F_u65536(a: u65536) -> u65536 { return a; }
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !3 = !DIFile(filename: "int_types.carbon", directory: "")
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F_i8", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F_i8", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{}
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "F_u16", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "F_i64", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "F_u65536", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "F_u16", scope: null, file: !3, line: 12, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "F_i64", scope: null, file: !3, line: 13, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "F_u65536", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2)
2 changes: 1 addition & 1 deletion toolchain/lower/testdata/basics/numeric_literals.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ fn F() {
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
// CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
// CHECK:STDOUT: !3 = !DIFile(filename: "numeric_literals.carbon", directory: "")
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", scope: null, file: !3, line: 11, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{}
Loading

0 comments on commit c5ada29

Please sign in to comment.