mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 19:23:25 +00:00
ir: sort function pragmas
This commit is contained in:
@@ -223,6 +223,12 @@ func (f *Function) parsePragmas() {
|
|||||||
}
|
}
|
||||||
parts := strings.Fields(comment.Text)
|
parts := strings.Fields(comment.Text)
|
||||||
switch parts[0] {
|
switch parts[0] {
|
||||||
|
case "//go:export":
|
||||||
|
if len(parts) != 2 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
f.linkName = parts[1]
|
||||||
|
f.exported = true
|
||||||
case "//go:linkname":
|
case "//go:linkname":
|
||||||
if len(parts) != 3 || parts[1] != f.Name() {
|
if len(parts) != 3 || parts[1] != f.Name() {
|
||||||
continue
|
continue
|
||||||
@@ -242,12 +248,6 @@ func (f *Function) parsePragmas() {
|
|||||||
if hasUnsafeImport(f.Pkg.Pkg) {
|
if hasUnsafeImport(f.Pkg.Pkg) {
|
||||||
f.nobounds = true
|
f.nobounds = true
|
||||||
}
|
}
|
||||||
case "//go:export":
|
|
||||||
if len(parts) != 2 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
f.linkName = parts[1]
|
|
||||||
f.exported = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user