mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:54:41 +01:00
Don't eagerly materialize an initializing expression used as the object in a compound member access. (#4496)
Instead, wait until we know whether it is used as a value or reference expression. This allows us to avoid materializing a temporary if it is used as a value and the initializing representation holds a copy of a value representation.
This commit is contained in:
@@ -129,8 +129,6 @@ fn Run() {
|
||||
// CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [template = constants.%Foo]
|
||||
// CHECK:STDOUT: %Foo.call: init f64 = call %Foo.ref()
|
||||
// CHECK:STDOUT: %.loc20_19.1: ref f64 = temporary_storage
|
||||
// CHECK:STDOUT: %.loc20_19.2: ref f64 = temporary %.loc20_19.1, %Foo.call
|
||||
// CHECK:STDOUT: %.loc20_21: i32 = converted %Foo.call, <error> [template = <error>]
|
||||
// CHECK:STDOUT: assign %x.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
|
||||
Reference in New Issue
Block a user