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

@@ -27,7 +27,7 @@ fn test_reverse_postorder_traversal(function_source: &str, ebb_order: Vec<u32>)
#[test]
fn simple_traversal() {
test_reverse_postorder_traversal("
function test(i32) {
function %test(i32) {
ebb0(v0: i32):
brz v0, ebb1
jump ebb2
@@ -56,7 +56,7 @@ fn simple_traversal() {
#[test]
fn loops_one() {
test_reverse_postorder_traversal("
function test(i32) {
function %test(i32) {
ebb0(v0: i32):
jump ebb1
ebb1:
@@ -74,7 +74,7 @@ fn loops_one() {
#[test]
fn loops_two() {
test_reverse_postorder_traversal("
function test(i32) {
function %test(i32) {
ebb0(v0: i32):
brz v0, ebb1
jump ebb2
@@ -99,7 +99,7 @@ fn loops_two() {
#[test]
fn loops_three() {
test_reverse_postorder_traversal("
function test(i32) {
function %test(i32) {
ebb0(v0: i32):
brz v0, ebb1
jump ebb2
@@ -129,7 +129,7 @@ fn loops_three() {
#[test]
fn back_edge_one() {
test_reverse_postorder_traversal("
function test(i32) {
function %test(i32) {
ebb0(v0: i32):
brz v0, ebb1
jump ebb2