LinkOnceODR sets this function's linkage to "linkonce_odr". This lets the function be merged with other global symbols with the same name, with the assumption their implementation is identical. Unlike "linkonce" this also preserves inlining.
()
| 56 | // assumption their implementation is identical. Unlike "linkonce" this |
| 57 | // also preserves inlining. |
| 58 | func (f *Function) LinkOnceODR() *Function { |
| 59 | if f.m.target.OS == device.Windows { |
| 60 | c := f.m.llvm.Comdat(f.Name) |
| 61 | c.SetSelectionKind(llvm.AnyComdatSelectionKind) |
| 62 | f.llvm.SetComdat(c) |
| 63 | } |
| 64 | f.llvm.SetLinkage(llvm.WeakODRLinkage) |
| 65 | return f |
| 66 | } |
| 67 | |
| 68 | // LinkPrivate makes this function use private linkage. |
| 69 | func (f *Function) LinkPrivate() *Function { |
no outgoing calls
no test coverage detected