aboutsummaryrefslogtreecommitdiffhomepage
path: root/compiler/interface.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2021-09-13 18:19:26 +0200
committerRon Evans <[email protected]>2021-10-25 13:39:54 +0200
commit478dd3a28db34d81a8397fa1d6ad3c52371eddb1 (patch)
tree1331a8f2f6261f44f6a980ca48783166151d1fa2 /compiler/interface.go
parent112b369636e58af7e0217aaaf0bc5f5258c49dd2 (diff)
downloadtinygo-478dd3a28db34d81a8397fa1d6ad3c52371eddb1.tar.gz
tinygo-478dd3a28db34d81a8397fa1d6ad3c52371eddb1.zip
compiler: add nounwind attribute
This attribute is also set by Clang when it compiles C source files (unless -fexceptions is set). The advantage is that no unwind tables are emitted on Linux (and perhaps other systems). It also avoids __aeabi_unwind_cpp_pr0 on ARM when using the musl libc.
Diffstat (limited to 'compiler/interface.go')
-rw-r--r--compiler/interface.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/interface.go b/compiler/interface.go
index 5d8895d71..1657a371f 100644
--- a/compiler/interface.go
+++ b/compiler/interface.go
@@ -489,6 +489,7 @@ func (c *compilerContext) getInterfaceInvokeWrapper(fn *ssa.Function, llvmFn llv
paramTypes := append([]llvm.Type{c.i8ptrType}, fnType.ParamTypes()[len(expandedReceiverType):]...)
wrapFnType := llvm.FunctionType(fnType.ReturnType(), paramTypes, false)
wrapper = llvm.AddFunction(c.mod, wrapperName, wrapFnType)
+ c.addStandardAttributes(wrapper)
wrapper.LastParam().SetName("parentHandle")
wrapper.SetLinkage(llvm.LinkOnceODRLinkage)