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

@@ -2,8 +2,8 @@
test legalizer
isa riscv
function parse_encoding(i32 [%x5]) -> i32 [%x10] {
; check: function parse_encoding(i32 [%x5], i32 link [%x1]) -> i32 [%x10], i32 link [%x1] {
function %parse_encoding(i32 [%x5]) -> i32 [%x10] {
; check: function %parse_encoding(i32 [%x5], i32 link [%x1]) -> i32 [%x10], i32 link [%x1] {
sig0 = signature(i32 [%x10]) -> i32 [%x10]
; check: sig0 = signature(i32 [%x10]) -> i32 [%x10]
@@ -27,9 +27,9 @@ function parse_encoding(i32 [%x5]) -> i32 [%x10] {
; check: sig5 = signature() -> f32 [0]
; function + signature
fn15 = function bar(i32 [%x10]) -> b1 [%x10]
fn15 = function %bar(i32 [%x10]) -> b1 [%x10]
; check: sig6 = signature(i32 [%x10]) -> b1 [%x10]
; nextln: fn0 = sig6 bar
; nextln: fn0 = sig6 %bar
ebb0(v0: i32):
return v0