mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 06:23:39 +00:00
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.
This commit is contained in:
committed by
Ron Evans
parent
112b369636
commit
478dd3a28d
@@ -23,7 +23,7 @@ import (
|
||||
// Version of the compiler pacakge. Must be incremented each time the compiler
|
||||
// package changes in a way that affects the generated LLVM module.
|
||||
// This version is independent of the TinyGo version number.
|
||||
const Version = 20 // last change: fix export math functions issue
|
||||
const Version = 21 // last change: add nounwind attribute
|
||||
|
||||
func init() {
|
||||
llvm.InitializeAllTargets()
|
||||
@@ -814,6 +814,7 @@ func (b *builder) createFunction() {
|
||||
b.addError(b.fn.Pos(), errValue)
|
||||
return
|
||||
}
|
||||
b.addStandardAttributes(b.llvmFn)
|
||||
if !b.info.exported {
|
||||
b.llvmFn.SetVisibility(llvm.HiddenVisibility)
|
||||
b.llvmFn.SetUnnamedAddr(true)
|
||||
|
||||
Reference in New Issue
Block a user