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 2f33848fcd
commit 706eef23d3
41 changed files with 306 additions and 208 deletions

View File

@@ -2,8 +2,8 @@
test print-cfg
test verifier
function nonsense(i32, i32) -> f32 {
; check: digraph nonsense {
function %nonsense(i32, i32) -> f32 {
; check: digraph %nonsense {
; regex: I=\binst\d+\b
; check: label="{ebb0 | <$(BRZ=$I)>brz ebb2 | <$(JUMP=$I)>jump ebb1}"]

View File

@@ -3,8 +3,8 @@
test print-cfg
test verifier
function nonsense(i32) {
; check: digraph nonsense {
function %nonsense(i32) {
; check: digraph %nonsense {
ebb0(v1: i32):
trap ; error: terminator instruction was encountered before the end

View File

@@ -1,8 +1,8 @@
; For testing cfg generation where some block is never reached.
test print-cfg
function not_reached(i32) -> i32 {
; check: digraph not_reached {
function %not_reached(i32) -> i32 {
; check: digraph %not_reached {
; check: ebb0 [shape=record, label="{ebb0 | <inst0>brnz ebb2}"]
; check: ebb1 [shape=record, label="{ebb1 | <inst4>jump ebb0}"]
; check: ebb2 [shape=record, label="{ebb2}"]