mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Deduplicate and canonicalize all constants. (#3611)
Rather than producing multiple constants with the same value, fold all instances of a given constant to the same constant instruction. A future PR will use this to replace the current type canonicalization system.
This commit is contained in:
@@ -38,6 +38,10 @@ interface Class { }
|
||||
|
||||
// CHECK:STDOUT: --- fail_duplicate.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace package, {.Interface = %Interface.decl.loc7, .Function = %Function, .Class = %Class.decl} [template]
|
||||
// CHECK:STDOUT: %Interface.decl.loc7 = interface_decl @Interface, ()
|
||||
@@ -45,7 +49,7 @@ interface Class { }
|
||||
// CHECK:STDOUT: %Function: <function> = fn_decl @Function [template]
|
||||
// CHECK:STDOUT: %.decl.loc27 = interface_decl @.1, ()
|
||||
// CHECK:STDOUT: %Class.decl = class_decl @Class, ()
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class [template]
|
||||
// CHECK:STDOUT: %Class: type = class_type @Class [template = constants.%Class]
|
||||
// CHECK:STDOUT: %.decl.loc37 = interface_decl @.2, ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user