ir: sort function pragmas

This commit is contained in:
Ayke van Laethem
2018-09-23 23:30:13 +02:00
parent 3076ad470e
commit 453450f40d
+6 -6
View File
@@ -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
}
}
}