Binary function names (#91)
* Function names should start with % * Create FunctionName from string * Implement displaying of FunctionName as %nnnn with fallback to #xxxx * Run rustfmt and fix FunctionName::with_string in parser * Implement FunctionName::new as a generic function * Binary function names should start with # * Implement NameRepr for function name * Fix examples in docs to reflect that function names start with % * Rebase and fix filecheck tests
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
731278aad8
commit
8b484b1c77
@@ -2,14 +2,14 @@
|
||||
test cat
|
||||
|
||||
; Jumps with no arguments. The '()' empty argument list is optional.
|
||||
function minimal() {
|
||||
function %minimal() {
|
||||
ebb0:
|
||||
jump ebb1
|
||||
|
||||
ebb1:
|
||||
jump ebb0()
|
||||
}
|
||||
; sameln: function minimal() {
|
||||
; sameln: function %minimal() {
|
||||
; nextln: ebb0:
|
||||
; nextln: jump ebb1
|
||||
; nextln:
|
||||
@@ -18,14 +18,14 @@ ebb1:
|
||||
; nextln: }
|
||||
|
||||
; Jumps with 1 arg.
|
||||
function onearg(i32) {
|
||||
function %onearg(i32) {
|
||||
ebb0(v90: i32):
|
||||
jump ebb1(v90)
|
||||
|
||||
ebb1(v91: i32):
|
||||
jump ebb0(v91)
|
||||
}
|
||||
; sameln: function onearg(i32) {
|
||||
; sameln: function %onearg(i32) {
|
||||
; nextln: ebb0($v90: i32):
|
||||
; nextln: jump ebb1($v90)
|
||||
; nextln:
|
||||
@@ -34,14 +34,14 @@ ebb1(v91: i32):
|
||||
; nextln: }
|
||||
|
||||
; Jumps with 2 args.
|
||||
function twoargs(i32, f32) {
|
||||
function %twoargs(i32, f32) {
|
||||
ebb0(v90: i32, v91: f32):
|
||||
jump ebb1(v90, v91)
|
||||
|
||||
ebb1(v92: i32, v93: f32):
|
||||
jump ebb0(v92, v93)
|
||||
}
|
||||
; sameln: function twoargs(i32, f32) {
|
||||
; sameln: function %twoargs(i32, f32) {
|
||||
; nextln: ebb0($v90: i32, $v91: f32):
|
||||
; nextln: jump ebb1($v90, $v91)
|
||||
; nextln:
|
||||
@@ -50,14 +50,14 @@ ebb1(v92: i32, v93: f32):
|
||||
; nextln: }
|
||||
|
||||
; Branches with no arguments. The '()' empty argument list is optional.
|
||||
function minimal(i32) {
|
||||
function %minimal(i32) {
|
||||
ebb0(v90: i32):
|
||||
brz v90, ebb1
|
||||
|
||||
ebb1:
|
||||
brnz v90, ebb1()
|
||||
}
|
||||
; sameln: function minimal(i32) {
|
||||
; sameln: function %minimal(i32) {
|
||||
; nextln: ebb0($v90: i32):
|
||||
; nextln: brz $v90, ebb1
|
||||
; nextln:
|
||||
@@ -65,14 +65,14 @@ ebb1:
|
||||
; nextln: brnz.i32 $v90, ebb1
|
||||
; nextln: }
|
||||
|
||||
function twoargs(i32, f32) {
|
||||
function %twoargs(i32, f32) {
|
||||
ebb0(v90: i32, v91: f32):
|
||||
brz v90, ebb1(v90, v91)
|
||||
|
||||
ebb1(v92: i32, v93: f32):
|
||||
brnz v90, ebb0(v92, v93)
|
||||
}
|
||||
; sameln: function twoargs(i32, f32) {
|
||||
; sameln: function %twoargs(i32, f32) {
|
||||
; nextln: ebb0($v90: i32, $v91: f32):
|
||||
; nextln: brz $v90, ebb1($v90, $v91)
|
||||
; nextln:
|
||||
@@ -80,7 +80,7 @@ ebb1(v92: i32, v93: f32):
|
||||
; nextln: brnz.i32 $v90, ebb0($v92, $v93)
|
||||
; nextln: }
|
||||
|
||||
function jumptable(i32) {
|
||||
function %jumptable(i32) {
|
||||
jt200 = jump_table 0, 0
|
||||
jt2 = jump_table 0, 0, ebb10, ebb40, ebb20, ebb30
|
||||
|
||||
@@ -94,7 +94,7 @@ ebb30:
|
||||
ebb40:
|
||||
trap
|
||||
}
|
||||
; sameln: function jumptable(i32) {
|
||||
; sameln: function %jumptable(i32) {
|
||||
; nextln: jt0 = jump_table 0
|
||||
; nextln: jt1 = jump_table 0, 0, ebb0, ebb3, ebb1, ebb2
|
||||
; nextln:
|
||||
|
||||
Reference in New Issue
Block a user