Skip to content

Commit

Permalink
Remove offsets from InstId formatting, trying to name more (#4645)
Browse files Browse the repository at this point in the history
The offsets were originally added to deal with churn from builtins in
the raw semir. In textual semir, we mostly see instruction IDs for
imports, and builtins have also settled down more.

On imports, where possible, use the `EntityNameId` for an import instead
of printing an instruction. Next, show the source location if we have a
node. Only show the instruction if there's no location.

This also exposes `Parse::Tree` and `TokenizedBuffer`, so that we can
pass a `SemIR::File` without the component parts. In particular this
allows us to get the `TokenizedBuffer` for import IRs without
substantial structural modifications. We may want to make these optional
for serialized `SemIR` later, but the nodes/tokens contain source
location, which we'd need for debug information -- so it's not clear how
much we can really make them optional without substantial information
loss.

Reduce arguments to just `File` in a few spots, as a result of the
accompanying `TokenizedBuffer` and `Parse::Tree`. Also updates style to
pass around `const File*` where the reference is maintained, instead of
`const File&`.

I was considering keeping a direct reference to the tree and tokens on
`Context`, but initially my thought was it wouldn't make much
difference. I can re-add those if desired, just as direct caching of the
`File` fields.
  • Loading branch information
jonmeow authored Dec 6, 2024
1 parent a2c939a commit e7a86b0
Show file tree
Hide file tree
Showing 148 changed files with 2,171 additions and 2,173 deletions.
30 changes: 17 additions & 13 deletions toolchain/check/check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ struct UnitInfo {
err_tracker(*unit.consumer),
emitter(*unit.node_converter, err_tracker) {}

auto parse_tree() -> const Parse::Tree& { return unit->sem_ir->parse_tree(); }
auto source() -> const SourceBuffer& {
return parse_tree().tokens().source();
}

SemIR::CheckIRId check_ir_id;
Unit* unit;

Expand Down Expand Up @@ -485,11 +490,10 @@ static auto CheckParseTree(UnitInfo& unit_info, int total_ir_count,
// We can safely mark this as checked at the start.
unit_info.is_checked = true;

SemIR::File& sem_ir = *unit_info.unit->sem_ir;
SemIR::File* sem_ir = unit_info.unit->sem_ir;
Context::DiagnosticEmitter emitter(*unit_info.unit->sem_ir_converter,
unit_info.err_tracker);
Context context(*unit_info.unit->tokens, emitter, *unit_info.unit->parse_tree,
unit_info.unit->get_parse_tree_and_subtrees, sem_ir,
Context context(&emitter, unit_info.unit->get_parse_tree_and_subtrees, sem_ir,
vlog_stream);
PrettyStackTraceFunction context_dumper(
[&](llvm::raw_ostream& output) { context.PrintForStackDump(output); });
Expand All @@ -515,11 +519,11 @@ static auto CheckParseTree(UnitInfo& unit_info, int total_ir_count,

context.VerifyOnFinish();

sem_ir.set_has_errors(unit_info.err_tracker.seen_error());
sem_ir->set_has_errors(unit_info.err_tracker.seen_error());

#ifndef NDEBUG
if (auto verify = sem_ir.Verify(); !verify.ok()) {
CARBON_FATAL("{0}Built invalid semantics IR: {1}\n", sem_ir,
if (auto verify = sem_ir->Verify(); !verify.ok()) {
CARBON_FATAL("{0}Built invalid semantics IR: {1}\n", *sem_ir,
verify.error());
}
#endif
Expand Down Expand Up @@ -566,7 +570,7 @@ static auto TrackImport(Map<ImportKey, UnitInfo*>& api_map,
Map<ImportKey, Parse::NodeId>* explicit_import_map,
UnitInfo& unit_info, Parse::Tree::PackagingNames import)
-> void {
const auto& packaging = unit_info.unit->parse_tree->packaging_decl();
const auto& packaging = unit_info.parse_tree().packaging_decl();

IdentifierId file_package_id =
packaging ? packaging->names.package_id : IdentifierId::Invalid;
Expand Down Expand Up @@ -712,7 +716,7 @@ static auto BuildApiMapAndDiagnosePackaging(
llvm::MutableArrayRef<UnitInfo> unit_infos) -> Map<ImportKey, UnitInfo*> {
Map<ImportKey, UnitInfo*> api_map;
for (auto& unit_info : unit_infos) {
const auto& packaging = unit_info.unit->parse_tree->packaging_decl();
const auto& packaging = unit_info.parse_tree().packaging_decl();
// An import key formed from the `package` or `library` declaration. Or, for
// Main//default, a placeholder key.
auto import_key = packaging ? GetImportKey(unit_info, IdentifierId::Invalid,
Expand Down Expand Up @@ -749,7 +753,7 @@ static auto BuildApiMapAndDiagnosePackaging(
auto insert_result = api_map.Insert(import_key, &unit_info);
if (!insert_result.is_inserted()) {
llvm::StringRef prev_filename =
insert_result.value()->unit->tokens->source().filename();
insert_result.value()->source().filename();
if (packaging) {
CARBON_DIAGNOSTIC(DuplicateLibraryApi, Error,
"library's API previously provided by `{0}`",
Expand All @@ -770,8 +774,8 @@ static auto BuildApiMapAndDiagnosePackaging(
// Validate file extensions. Note imports rely the packaging declaration,
// not the extension. If the input is not a regular file, for example
// because it is stdin, no filename checking is performed.
if (unit_info.unit->tokens->source().is_regular_file()) {
auto filename = unit_info.unit->tokens->source().filename();
if (unit_info.source().is_regular_file()) {
auto filename = unit_info.source().filename();
static constexpr llvm::StringLiteral ApiExt = ".carbon";
static constexpr llvm::StringLiteral ImplExt = ".impl.carbon";
bool is_api_with_impl_ext = !is_impl && filename.ends_with(ImplExt);
Expand Down Expand Up @@ -814,7 +818,7 @@ auto CheckParseTrees(llvm::MutableArrayRef<Unit> units, bool prelude_import,
llvm::SmallVector<UnitInfo*> ready_to_check;
ready_to_check.reserve(units.size());
for (auto& unit_info : unit_infos) {
const auto& packaging = unit_info.unit->parse_tree->packaging_decl();
const auto& packaging = unit_info.parse_tree().packaging_decl();
if (packaging && packaging->is_impl) {
// An `impl` has an implicit import of its `api`.
auto implicit_names = packaging->names;
Expand All @@ -838,7 +842,7 @@ auto CheckParseTrees(llvm::MutableArrayRef<Unit> units, bool prelude_import,
.library_id = prelude_id});
}

for (const auto& import : unit_info.unit->parse_tree->imports()) {
for (const auto& import : unit_info.parse_tree().imports()) {
TrackImport(api_map, &explicit_import_map, unit_info, import);
}

Expand Down
2 changes: 0 additions & 2 deletions toolchain/check/check.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ struct Unit {
SharedValueStores* value_stores;
// The `timings` may be null if nothing is to be recorded.
Timings* timings;
const Lex::TokenizedBuffer* tokens;
const Parse::Tree* parse_tree;

// Returns a lazily constructed TreeAndSubtrees.
llvm::function_ref<const Parse::TreeAndSubtrees&()>
Expand Down
23 changes: 10 additions & 13 deletions toolchain/check/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,19 @@

namespace Carbon::Check {

Context::Context(const Lex::TokenizedBuffer& tokens, DiagnosticEmitter& emitter,
const Parse::Tree& parse_tree,
Context::Context(DiagnosticEmitter* emitter,
llvm::function_ref<const Parse::TreeAndSubtrees&()>
get_parse_tree_and_subtrees,
SemIR::File& sem_ir, llvm::raw_ostream* vlog_stream)
: tokens_(&tokens),
emitter_(&emitter),
parse_tree_(&parse_tree),
SemIR::File* sem_ir, llvm::raw_ostream* vlog_stream)
: emitter_(emitter),
get_parse_tree_and_subtrees_(get_parse_tree_and_subtrees),
sem_ir_(&sem_ir),
sem_ir_(sem_ir),
vlog_stream_(vlog_stream),
node_stack_(parse_tree, vlog_stream),
inst_block_stack_("inst_block_stack_", sem_ir, vlog_stream),
pattern_block_stack_("pattern_block_stack_", sem_ir, vlog_stream),
param_and_arg_refs_stack_(sem_ir, vlog_stream, node_stack_),
args_type_info_stack_("args_type_info_stack_", sem_ir, vlog_stream),
node_stack_(sem_ir->parse_tree(), vlog_stream),
inst_block_stack_("inst_block_stack_", *sem_ir, vlog_stream),
pattern_block_stack_("pattern_block_stack_", *sem_ir, vlog_stream),
param_and_arg_refs_stack_(*sem_ir, vlog_stream, node_stack_),
args_type_info_stack_("args_type_info_stack_", *sem_ir, vlog_stream),
decl_name_stack_(this),
scope_stack_(sem_ir_->identifiers()),
global_init_(this) {
Expand Down Expand Up @@ -1415,7 +1412,7 @@ auto Context::PrintForStackDump(llvm::raw_ostream& output) const -> void {
}

auto Context::DumpFormattedFile() const -> void {
SemIR::Formatter formatter(*tokens_, *parse_tree_, *sem_ir_);
SemIR::Formatter formatter(sem_ir_);
formatter.Print(llvm::errs());
}

Expand Down
19 changes: 6 additions & 13 deletions toolchain/check/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@ class Context {
llvm::function_ref<auto()->Context::DiagnosticBuilder>;

// Stores references for work.
explicit Context(const Lex::TokenizedBuffer& tokens,
DiagnosticEmitter& emitter, const Parse::Tree& parse_tree,
explicit Context(DiagnosticEmitter* emitter,
llvm::function_ref<const Parse::TreeAndSubtrees&()>
get_parse_tree_and_subtrees,
SemIR::File& sem_ir, llvm::raw_ostream* vlog_stream);
SemIR::File* sem_ir, llvm::raw_ostream* vlog_stream);

// Marks an implementation TODO. Always returns false.
auto TODO(SemIRLoc loc, std::string label) -> bool;
Expand Down Expand Up @@ -456,18 +455,18 @@ class Context {
return tokens().GetKind(parse_tree().node_token(node_id));
}

auto tokens() -> const Lex::TokenizedBuffer& { return *tokens_; }

auto emitter() -> DiagnosticEmitter& { return *emitter_; }

auto parse_tree() -> const Parse::Tree& { return *parse_tree_; }

auto parse_tree_and_subtrees() -> const Parse::TreeAndSubtrees& {
return get_parse_tree_and_subtrees_();
}

auto sem_ir() -> SemIR::File& { return *sem_ir_; }

auto parse_tree() -> const Parse::Tree& { return sem_ir_->parse_tree(); }

auto tokens() -> const Lex::TokenizedBuffer& { return parse_tree().tokens(); }

auto node_stack() -> NodeStack& { return node_stack_; }

auto inst_block_stack() -> InstBlockStack& { return inst_block_stack_; }
Expand Down Expand Up @@ -607,15 +606,9 @@ class Context {
// any applicable instruction lists.
auto FinishInst(SemIR::InstId inst_id, SemIR::Inst inst) -> void;

// Tokens for getting data on literals.
const Lex::TokenizedBuffer* tokens_;

// Handles diagnostics.
DiagnosticEmitter* emitter_;

// The file's parse tree.
const Parse::Tree* parse_tree_;

// Returns a lazily constructed TreeAndSubtrees.
llvm::function_ref<const Parse::TreeAndSubtrees&()>
get_parse_tree_and_subtrees_;
Expand Down
32 changes: 16 additions & 16 deletions toolchain/check/testdata/alias/no_prelude/export_name.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ var d: D* = &c;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref Main//base, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+7, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: <witness> = import_ref Main//base, inst+4, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded
// CHECK:STDOUT: %import_ref.1 = import_ref Main//base, C, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, D, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: <witness> = import_ref Main//base, loc4_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst14 [no loc], unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand All @@ -133,10 +133,10 @@ var d: D* = &c;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+7, unloaded
// CHECK:STDOUT: %import_ref.3: <witness> = import_ref Main//base, inst+4, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, C, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, D, unloaded
// CHECK:STDOUT: %import_ref.3: <witness> = import_ref Main//base, loc4_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst14 [no loc], unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -164,9 +164,9 @@ var d: D* = &c;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+10, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2: <witness> = import_ref Main//export, inst+8, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst+9, unloaded
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, D, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2: <witness> = import_ref Main//export, inst20 [indirect], loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst21 [indirect], unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -202,7 +202,7 @@ var d: D* = &c;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref = import_ref Main//export, inst+10, unloaded
// CHECK:STDOUT: %import_ref = import_ref Main//export, D, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -234,10 +234,10 @@ var d: D* = &c;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+10, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export_orig, inst+10, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: <witness> = import_ref Main//export_orig, inst+8, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_orig, inst+9, unloaded
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, D, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export_orig, C, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: <witness> = import_ref Main//export_orig, inst20 [indirect], loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_orig, inst21 [indirect], unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down
26 changes: 13 additions & 13 deletions toolchain/check/testdata/alias/no_prelude/import.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref Main//class1, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//class1, inst+7, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref Main//class1, inst+12, unloaded
// CHECK:STDOUT: %import_ref.4: <witness> = import_ref Main//class1, inst+4, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.5 = import_ref Main//class1, inst+2, unloaded
// CHECK:STDOUT: %import_ref.1 = import_ref Main//class1, C, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//class1, c_alias, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3 = import_ref Main//class1, a, unloaded
// CHECK:STDOUT: %import_ref.4: <witness> = import_ref Main//class1, loc4_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.5 = import_ref Main//class1, inst14 [no loc], unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -148,10 +148,10 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//class2, inst+12, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref Main//class2, inst+17, unloaded
// CHECK:STDOUT: %import_ref.3: <witness> = import_ref Main//class2, inst+9, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.4 = import_ref Main//class2, inst+10, unloaded
// CHECK:STDOUT: %import_ref.1: type = import_ref Main//class2, c_alias_alias, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.2 = import_ref Main//class2, b, unloaded
// CHECK:STDOUT: %import_ref.3: <witness> = import_ref Main//class2, inst21 [indirect], loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.4 = import_ref Main//class2, inst22 [indirect], unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -210,8 +210,8 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref Main//var1, inst+5, unloaded
// CHECK:STDOUT: %import_ref.2: ref %empty_tuple.type = import_ref Main//var1, inst+12, loaded
// CHECK:STDOUT: %import_ref.1 = import_ref Main//var1, a, unloaded
// CHECK:STDOUT: %import_ref.2: ref %empty_tuple.type = import_ref Main//var1, a_alias, loaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -247,8 +247,8 @@ var c: () = a_alias_alias;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1: ref %empty_tuple.type = import_ref Main//var2, inst+6, loaded [template = <error>]
// CHECK:STDOUT: %import_ref.2 = import_ref Main//var2, inst+10, unloaded
// CHECK:STDOUT: %import_ref.1: ref %empty_tuple.type = import_ref Main//var2, a_alias_alias, loaded [template = <error>]
// CHECK:STDOUT: %import_ref.2 = import_ref Main//var2, b, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down
10 changes: 5 additions & 5 deletions toolchain/check/testdata/alias/no_prelude/import_access.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ var inst: Test.A = {};
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref Test//def, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Test//def, inst+7, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: <witness> = import_ref Test//def, inst+4, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.4 = import_ref Test//def, inst+2, unloaded
// CHECK:STDOUT: %import_ref.1 = import_ref Test//def, C, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Test//def, A, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: <witness> = import_ref Test//def, loc4_10, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.4 = import_ref Test//def, inst14 [no loc], unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down Expand Up @@ -129,7 +129,7 @@ var inst: Test.A = {};
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref = import_ref Test//def, inst+1, unloaded
// CHECK:STDOUT: %import_ref = import_ref Test//def, C, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down
16 changes: 8 additions & 8 deletions toolchain/check/testdata/alias/no_prelude/import_order.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ var a_val: a = {.v = b_val.v};
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+1, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+12, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+14, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+16, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.5: type = import_ref Main//a, inst+18, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.6: <witness> = import_ref Main//a, inst+9, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+2, unloaded
// CHECK:STDOUT: %import_ref.8: %C.elem = import_ref Main//a, inst+7, loaded [template = %.1]
// CHECK:STDOUT: %import_ref.1 = import_ref Main//a, C, unloaded
// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, a, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, b, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, c, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.5: type = import_ref Main//a, d, loaded [template = constants.%C]
// CHECK:STDOUT: %import_ref.6: <witness> = import_ref Main//a, loc4_22, loaded [template = constants.%complete_type]
// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst14 [no loc], unloaded
// CHECK:STDOUT: %import_ref.8: %C.elem = import_ref Main//a, loc4_16, loaded [template = %.1]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down
2 changes: 1 addition & 1 deletion toolchain/check/testdata/as/overloaded.carbon
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ let n: i32 = ((4 as i32) as X) as i32;
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, inst+13, loaded [template = constants.%As.generic]
// CHECK:STDOUT: %import_ref.2: %As.type.1 = import_ref Core//prelude/operators/as, As, loaded [template = constants.%As.generic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
Expand Down
Loading

0 comments on commit e7a86b0

Please sign in to comment.