mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Rename template constant -> concrete constant. (#4939)
This implements a direction decided in a [recent discussion](https://docs.google.com/document/d/1Iut5f2TQBrtBNIduF4vJYOKfw7MbS8xH_J01_Q4e6Rk/edit?resourcekey=0-mc_vh5UzrzXfU4kO-3tOjA&tab=t.0#heading=h.mas1g68xx9ct) to switch away from "template constant" when naming a constant that doesn't depend on any generic parameters, because that creates confusion with template-dependent constant values that depend on a template parameter.
This commit is contained in:
@@ -27,53 +27,53 @@ fn TestOp(a: C) -> C {
|
||||
// CHECK:STDOUT: --- bit_complement.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [template]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
|
||||
// CHECK:STDOUT: %BitComplement.type: type = facet_type <@BitComplement> [template]
|
||||
// CHECK:STDOUT: %Op.type.f25: type = fn_type @Op.1 [template]
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.1.%Op.decl) [template]
|
||||
// CHECK:STDOUT: %Op.type.544: type = fn_type @Op.2 [template]
|
||||
// CHECK:STDOUT: %Op.bf2: %Op.type.544 = struct_value () [template]
|
||||
// CHECK:STDOUT: %BitComplement.facet: %BitComplement.type = facet_value %C, %impl_witness [template]
|
||||
// CHECK:STDOUT: %C.val: %C = struct_value () [template]
|
||||
// CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template]
|
||||
// CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %.784: type = fn_type_with_self_type %Op.type.f25, %BitComplement.facet [template]
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %BitComplement.type: type = facet_type <@BitComplement> [concrete]
|
||||
// CHECK:STDOUT: %Op.type.f25: type = fn_type @Op.1 [concrete]
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.1.%Op.decl) [concrete]
|
||||
// CHECK:STDOUT: %Op.type.544: type = fn_type @Op.2 [concrete]
|
||||
// CHECK:STDOUT: %Op.bf2: %Op.type.544 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %BitComplement.facet: %BitComplement.type = facet_value %C, %impl_witness [concrete]
|
||||
// CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [concrete]
|
||||
// CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %.784: type = fn_type_with_self_type %Op.type.f25, %BitComplement.facet [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .BitComplement = %Core.BitComplement
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.BitComplement: type = import_ref Core//prelude/operators/bitwise, BitComplement, loaded [template = constants.%BitComplement.type]
|
||||
// CHECK:STDOUT: %Core.BitComplement: type = import_ref Core//prelude/operators/bitwise, BitComplement, loaded [concrete = constants.%BitComplement.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: .TestOp = %TestOp.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
|
||||
// CHECK:STDOUT: impl_decl @impl.1 [template] {} {
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [template = imports.%Core]
|
||||
// CHECK:STDOUT: %BitComplement.ref: type = name_ref BitComplement, imports.%Core.BitComplement [template = constants.%BitComplement.type]
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: impl_decl @impl.1 [concrete] {} {
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %BitComplement.ref: type = name_ref BitComplement, imports.%Core.BitComplement [concrete = constants.%BitComplement.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.1.%Op.decl) [template = constants.%impl_witness]
|
||||
// CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {
|
||||
// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.1.%Op.decl) [concrete = constants.%impl_witness]
|
||||
// CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [concrete = constants.%TestOp] {
|
||||
// CHECK:STDOUT: %a.patt: %C = binding_pattern a
|
||||
// CHECK:STDOUT: %a.param_patt: %C = value_param_pattern %a.patt, runtime_param0
|
||||
// CHECK:STDOUT: %return.patt: %C = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %C.ref.loc23_20: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %a.param: %C = value_param runtime_param0
|
||||
// CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %C.ref.loc23_14: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %a: %C = bind_name a, %a.param
|
||||
// CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1
|
||||
// CHECK:STDOUT: %return: ref %C = return_slot %return.param
|
||||
@@ -81,15 +81,15 @@ fn TestOp(a: C) -> C {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl.1: %C.ref as %BitComplement.ref {
|
||||
// CHECK:STDOUT: %Op.decl: %Op.type.544 = fn_decl @Op.2 [template = constants.%Op.bf2] {
|
||||
// CHECK:STDOUT: %Op.decl: %Op.type.544 = fn_decl @Op.2 [concrete = constants.%Op.bf2] {
|
||||
// CHECK:STDOUT: %self.patt: %C = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0
|
||||
// CHECK:STDOUT: %return.patt: %C = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: %C = out_param_pattern %return.patt, runtime_param1
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %C.ref.loc18_23: type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %C.ref.loc18_23: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %self.param: %C = value_param runtime_param0
|
||||
// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [template = constants.%C]
|
||||
// CHECK:STDOUT: %C.ref.loc18_15: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %self: %C = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %return.param: ref %C = out_param runtime_param1
|
||||
// CHECK:STDOUT: %return: ref %C = return_slot %return.param
|
||||
@@ -101,7 +101,7 @@ fn TestOp(a: C) -> C {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
@@ -111,15 +111,15 @@ fn TestOp(a: C) -> C {
|
||||
// CHECK:STDOUT: fn @Op.2[%self.param_patt: %C]() -> %return.param_patt: %C {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc19_13.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [template = constants.%C.val]
|
||||
// CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [template = constants.%C.val]
|
||||
// CHECK:STDOUT: %.loc19_13.2: init %C = class_init (), %return [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: %.loc19_14: init %C = converted %.loc19_13.1, %.loc19_13.2 [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: return %.loc19_14 to %return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @TestOp(%a.param_patt: %C) -> %return.param_patt: %C {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a.ref: %C = name_ref a, %a
|
||||
// CHECK:STDOUT: %impl.elem0: %.784 = impl_witness_access constants.%impl_witness, element0 [template = constants.%Op.bf2]
|
||||
// CHECK:STDOUT: %impl.elem0: %.784 = impl_witness_access constants.%impl_witness, element0 [concrete = constants.%Op.bf2]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %.loc23: ref %C = splice_block %return {}
|
||||
// CHECK:STDOUT: %Op.call: init %C = call %bound_method(%a.ref) to %.loc23
|
||||
|
||||
Reference in New Issue
Block a user