aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2018-09-23 23:30:13 +0200
committerAyke van Laethem <[email protected]>2018-09-23 23:30:13 +0200
commit453450f40df0889a133f4b41199ab7176b3d7e9d (patch)
tree465d569c78a0dd9fd6bd49d729275e7b9da7185c /ir
parent3076ad470e564a5a9b351345fc83acf9834e19cd (diff)
downloadtinygo-453450f40df0889a133f4b41199ab7176b3d7e9d.tar.gz
tinygo-453450f40df0889a133f4b41199ab7176b3d7e9d.zip
ir: sort function pragmas
Diffstat (limited to 'ir')
-rw-r--r--ir/ir.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/ir/ir.go b/ir/ir.go
index 4f098425d..88a2a53bf 100644
--- a/ir/ir.go
+++ b/ir/ir.go
@@ -223,6 +223,12 @@ func (f *Function) parsePragmas() {
}
parts := strings.Fields(comment.Text)
switch parts[0] {
+ case "//go:export":
+ if len(parts) != 2 {
+ continue
+ }
+ f.linkName = parts[1]
+ f.exported = true
case "//go:linkname":
if len(parts) != 3 || parts[1] != f.Name() {
continue
@@ -242,12 +248,6 @@ func (f *Function) parsePragmas() {
if hasUnsafeImport(f.Pkg.Pkg) {
f.nobounds = true
}
- case "//go:export":
- if len(parts) != 2 {
- continue
- }
- f.linkName = parts[1]
- f.exported = true
}
}
}