mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Avoid recursion in InstNamer::CollectNamesInBlock (#4706)
Use a deque to maintain the set of instructions to be walked over. so that the loop can append more instructions (with their related scope) during iteration without requiring recursion. --------- Co-authored-by: jonmeow <jperkins@google.com>
This commit is contained in:
+3
-3
@@ -65,10 +65,10 @@ fn F(b: bool, n: i32, m: i32) -> i32 {
|
||||
// CHECK:STDOUT: %int_32.loc11_34: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %b.param: bool = value_param runtime_param0
|
||||
// CHECK:STDOUT: %.loc11_9.3: type = splice_block %.loc11_9.2 [template = bool] {
|
||||
// CHECK:STDOUT: %.loc11_9.1: type = splice_block %.loc11_9.3 [template = bool] {
|
||||
// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
|
||||
// CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool]
|
||||
// CHECK:STDOUT: %.loc11_9.2: type = converted %bool.make_type, %.loc11_9.1 [template = bool]
|
||||
// CHECK:STDOUT: %.loc11_9.2: type = value_of_initializer %bool.make_type [template = bool]
|
||||
// CHECK:STDOUT: %.loc11_9.3: type = converted %bool.make_type, %.loc11_9.2 [template = bool]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: bool = bind_name b, %b.param
|
||||
// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param1
|
||||
|
||||
Reference in New Issue
Block a user