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

@@ -389,8 +389,8 @@ preamble`:
This simple example illustrates direct function calls and signatures::
function gcd(i32 uext, i32 uext) -> i32 uext "C" {
fn1 = function divmod(i32 uext, i32 uext) -> i32 uext, i32 uext
function %gcd(i32 uext, i32 uext) -> i32 uext "C" {
fn1 = function %divmod(i32 uext, i32 uext) -> i32 uext, i32 uext
ebb1(v1: i32, v2: i32):
brz v2, ebb2
@@ -530,7 +530,7 @@ and address computations from the memory accesses.
A small example using heaps::
function vdup(i32, i32) {
function %vdup(i32, i32) {
h1 = heap "main"
ebb1(v1: i32, v2: i32):