aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2018-11-29 13:31:16 +0100
committerAyke van Laethem <[email protected]>2018-12-10 15:38:02 +0100
commitecf6ffa62ed45791362952caffefeffea4d96ed7 (patch)
tree068c79020c0c746a48ab1a4557aedb49686b18b4 /ir
parentb99bbc880a154d2e8df153ae3da25c153f09cf87 (diff)
downloadtinygo-ecf6ffa62ed45791362952caffefeffea4d96ed7.tar.gz
tinygo-ecf6ffa62ed45791362952caffefeffea4d96ed7.zip
all: add bare-bones Cgo support
Diffstat (limited to 'ir')
-rw-r--r--ir/ir.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/ir/ir.go b/ir/ir.go
index 91822695d..242755abe 100644
--- a/ir/ir.go
+++ b/ir/ir.go
@@ -362,8 +362,13 @@ func (f *Function) LinkName() string {
func (f *Function) CName() string {
name := f.Name()
if strings.HasPrefix(name, "_Cfunc_") {
+ // emitted by `go tool cgo`
return name[len("_Cfunc_"):]
}
+ if strings.HasPrefix(name, "C.") {
+ // created by ../loader/cgo.go
+ return name[2:]
+ }
return ""
}