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

@@ -5,7 +5,7 @@ isa riscv
; regex: RX=%x\d+
function add(i32, i32) {
function %add(i32, i32) {
ebb0(v1: i32, v2: i32):
v3 = iadd v1, v2
; check: [R#0c,%x5]
@@ -14,7 +14,7 @@ ebb0(v1: i32, v2: i32):
}
; Function with a dead argument.
function dead_arg(i32, i32) -> i32{
function %dead_arg(i32, i32) -> i32{
ebb0(v1: i32, v2: i32):
; not: regmove
; check: return $v1
@@ -22,7 +22,7 @@ ebb0(v1: i32, v2: i32):
}
; Return a value from a different register.
function move1(i32, i32) -> i32 {
function %move1(i32, i32) -> i32 {
ebb0(v1: i32, v2: i32):
; not: regmove
; check: regmove $v2, %x11 -> %x10
@@ -31,7 +31,7 @@ ebb0(v1: i32, v2: i32):
}
; Swap two registers.
function swap(i32, i32) -> i32, i32 {
function %swap(i32, i32) -> i32, i32 {
ebb0(v1: i32, v2: i32):
; not: regmove
; check: regmove $v2, %x11 -> $(tmp=$RX)