mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:14:43 +01:00
Expand naming for impls and functions (#5808)
Change impls from `<interface>.impl` to `<self>.as.<interface>.impl`, and *member* functions to `<parent scope>.<fn>` (non-member functions exclude their parent scope). Stop special-casing builtin functions, given the new naming scheme. The purpose of this is to make it clearer when a member function is being accessed and, if so, which member function. In particular, we often access interface `Op` functions. The builtin function special-casing was intended to help with that, but we still have lots of `Op` functions. This particular approach should make the interactions clearer. This changes up queueing of block IDs a little because, in particular, we need to process bodies of entities only after constants finish processing. But, it should also result in less memory usage during processing because it means we have less on the insts stack at any given time, since we track a block rather than all instructions contained by the block.
This commit is contained in:
@@ -70,43 +70,43 @@ fn M() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: define linkonce_odr i32 @_CF.Main.b88d1103f417c6d4(i32 %x, i32 %count) !dbg !20 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %int.greater = icmp sgt i32 %count, 0, !dbg !21
|
||||
// CHECK:STDOUT: br i1 %int.greater, label %if.then, label %if.else, !dbg !22
|
||||
// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !21
|
||||
// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !22
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: if.then: ; preds = %entry
|
||||
// CHECK:STDOUT: ret i32 %x, !dbg !23
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: if.else: ; preds = %entry
|
||||
// CHECK:STDOUT: %int.sadd = add i32 %count, 1, !dbg !24
|
||||
// CHECK:STDOUT: %F.call = call i32 @_CF.Main.b88d1103f417c6d4(i32 %x, i32 %int.sadd), !dbg !25
|
||||
// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !24
|
||||
// CHECK:STDOUT: %F.call = call i32 @_CF.Main.b88d1103f417c6d4(i32 %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !25
|
||||
// CHECK:STDOUT: ret i32 %F.call, !dbg !26
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: define linkonce_odr double @_CF.Main.66be507887ceee78(double %x, i32 %count) !dbg !27 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %int.greater = icmp sgt i32 %count, 0, !dbg !28
|
||||
// CHECK:STDOUT: br i1 %int.greater, label %if.then, label %if.else, !dbg !29
|
||||
// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !28
|
||||
// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !29
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: if.then: ; preds = %entry
|
||||
// CHECK:STDOUT: ret double %x, !dbg !30
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: if.else: ; preds = %entry
|
||||
// CHECK:STDOUT: %int.sadd = add i32 %count, 1, !dbg !31
|
||||
// CHECK:STDOUT: %F.call = call double @_CF.Main.66be507887ceee78(double %x, i32 %int.sadd), !dbg !32
|
||||
// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !31
|
||||
// CHECK:STDOUT: %F.call = call double @_CF.Main.66be507887ceee78(double %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !32
|
||||
// CHECK:STDOUT: ret double %F.call, !dbg !33
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: define linkonce_odr ptr @_CF.Main.e8193710fd35b608(ptr %x, i32 %count) !dbg !34 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %int.greater = icmp sgt i32 %count, 0, !dbg !35
|
||||
// CHECK:STDOUT: br i1 %int.greater, label %if.then, label %if.else, !dbg !36
|
||||
// CHECK:STDOUT: %Int.as.OrderedWith.impl.Greater.call = icmp sgt i32 %count, 0, !dbg !35
|
||||
// CHECK:STDOUT: br i1 %Int.as.OrderedWith.impl.Greater.call, label %if.then, label %if.else, !dbg !36
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: if.then: ; preds = %entry
|
||||
// CHECK:STDOUT: ret ptr %x, !dbg !37
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: if.else: ; preds = %entry
|
||||
// CHECK:STDOUT: %int.sadd = add i32 %count, 1, !dbg !38
|
||||
// CHECK:STDOUT: %F.call = call ptr @_CF.Main.e8193710fd35b608(ptr %x, i32 %int.sadd), !dbg !39
|
||||
// CHECK:STDOUT: %Int.as.AddWith.impl.Op.call = add i32 %count, 1, !dbg !38
|
||||
// CHECK:STDOUT: %F.call = call ptr @_CF.Main.e8193710fd35b608(ptr %x, i32 %Int.as.AddWith.impl.Op.call), !dbg !39
|
||||
// CHECK:STDOUT: ret ptr %F.call, !dbg !40
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user