mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 13:33:39 +00:00
compiler: add //go:inline pragma
This commit is contained in:
committed by
Ron Evans
parent
397b90753c
commit
6f6afb0515
@@ -828,6 +828,14 @@ func (c *Compiler) parseFunc(frame *Frame) {
|
||||
frame.fn.LLVMFn.SetFunctionCallConv(85) // CallingConv::AVR_SIGNAL
|
||||
}
|
||||
|
||||
// Some functions have a pragma controlling the inlining level.
|
||||
switch frame.fn.Inline() {
|
||||
case ir.InlineHint:
|
||||
// Add LLVM inline hint to functions with //go:inline pragma.
|
||||
inline := c.ctx.CreateEnumAttribute(llvm.AttributeKindID("inlinehint"), 0)
|
||||
frame.fn.LLVMFn.AddFunctionAttr(inline)
|
||||
}
|
||||
|
||||
// Add debug info, if needed.
|
||||
if c.Debug {
|
||||
if frame.fn.Synthetic == "package initializer" {
|
||||
|
||||
Reference in New Issue
Block a user