diff options
author | Ayke van Laethem <[email protected]> | 2018-11-29 13:31:16 +0100 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2018-12-10 15:38:02 +0100 |
commit | ecf6ffa62ed45791362952caffefeffea4d96ed7 (patch) | |
tree | 068c79020c0c746a48ab1a4557aedb49686b18b4 /ir | |
parent | b99bbc880a154d2e8df153ae3da25c153f09cf87 (diff) | |
download | tinygo-ecf6ffa62ed45791362952caffefeffea4d96ed7.tar.gz tinygo-ecf6ffa62ed45791362952caffefeffea4d96ed7.zip |
all: add bare-bones Cgo support
Diffstat (limited to 'ir')
-rw-r--r-- | ir/ir.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 "" } |