MCPcopy Create free account
hub / github.com/google/gapid / LinkOnceODR

Method LinkOnceODR

core/codegen/function.go:58–66  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

56// assumption their implementation is identical. Unlike "linkonce" this
57// also preserves inlining.
58func (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.
69func (f *Function) LinkPrivate() *Function {

Callers 6

defineMapTypesMethod · 0.80
buildTypesMethod · 0.80
declareMethod · 0.80
buildWriteFuncsMethod · 0.80
declareClonesMethod · 0.80
implementClonesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected