mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Sorting out how bindings are added to name lookup. (#2869)
This shifts logic so that bindings are added to name lookup only after the scope is complete, removing logic around adding/removing/re-adding names in certain scopes. This does mean that things like a function's forward declaration will need to go through an extra hoop for name conflict checks, because under this approach a function definition does conflict checking when it adds names for the body's use. But, that seems easy to address, and better than the current hoops.
This commit is contained in:
@@ -112,7 +112,7 @@ auto SemanticsIR::Print(llvm::raw_ostream& out, bool include_builtins) const
|
||||
-> void {
|
||||
out << "cross_reference_irs_size: " << cross_reference_irs_.size() << "\n";
|
||||
|
||||
PrintList(out, "callables", callables_);
|
||||
PrintList(out, "functions", functions_);
|
||||
PrintList(out, "integer_literals", integer_literals_);
|
||||
PrintList(out, "real_literals", real_literals_);
|
||||
PrintList(out, "strings", strings_);
|
||||
@@ -203,7 +203,6 @@ auto SemanticsIR::StringifyType(SemanticsTypeId type_id) -> std::string {
|
||||
case SemanticsNodeKind::CodeBlock:
|
||||
case SemanticsNodeKind::CrossReference:
|
||||
case SemanticsNodeKind::FunctionDeclaration:
|
||||
case SemanticsNodeKind::FunctionDefinition:
|
||||
case SemanticsNodeKind::IntegerLiteral:
|
||||
case SemanticsNodeKind::RealLiteral:
|
||||
case SemanticsNodeKind::Return:
|
||||
|
||||
Reference in New Issue
Block a user