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:
Aleksey Kuznetsov
2017-06-10 22:30:37 +05:00
committed by Jakob Stoklund Olesen
parent 731278aad8
commit 8b484b1c77
41 changed files with 306 additions and 208 deletions

View File

@@ -1,6 +1,6 @@
test licm
function simple_loop(i32) -> i32 {
function %simple_loop(i32) -> i32 {
ebb1(v0: i32):
v1 = iconst.i32 1
@@ -14,7 +14,7 @@ ebb2(v5: i32):
return v5
}
; sameln: function simple_loop(i32) -> i32 {
; sameln: function %simple_loop(i32) -> i32 {
; nextln: ebb2(v6: i32):
; nextln: v1 = iconst.i32 1
; nextln: v2 = iconst.i32 2

View File

@@ -1,6 +1,6 @@
test licm
function complex(i32) -> i32 {
function %complex(i32) -> i32 {
ebb0(v0: i32):
v1 = iconst.i32 1
@@ -39,7 +39,7 @@ ebb5(v16: i32):
return v17
}
; sameln: function complex(i32) -> i32 {
; sameln: function %complex(i32) -> i32 {
; nextln: ebb6(v20: i32):
; nextln: v1 = iconst.i32 1
; nextln: v2 = iconst.i32 4

View File

@@ -1,6 +1,6 @@
test licm
function multiple_blocks(i32) -> i32 {
function %multiple_blocks(i32) -> i32 {
ebb0(v0: i32):
jump ebb1(v0)
@@ -23,7 +23,7 @@ ebb3(v30: i32):
jump ebb1(v30)
}
; sameln:function multiple_blocks(i32) -> i32 {
; sameln:function %multiple_blocks(i32) -> i32 {
; nextln: ebb0(v0: i32):
; nextln: v2 = iconst.i32 1
; nextln: v3 = iconst.i32 2

View File

@@ -1,6 +1,6 @@
test licm
function nested_loops(i32) -> i32 {
function %nested_loops(i32) -> i32 {
ebb0(v0: i32):
v1 = iconst.i32 1
@@ -25,7 +25,7 @@ ebb3(v30: i32):
}
; sameln:function nested_loops(i32) -> i32 {
; sameln:function %nested_loops(i32) -> i32 {
; nextln: ebb4(v12: i32):
; nextln: v1 = iconst.i32 1
; nextln: v2 = iconst.i32 2