aboutsummaryrefslogtreecommitdiffhomepage
path: root/cgo/libclang.go
diff options
context:
space:
mode:
Diffstat (limited to 'cgo/libclang.go')
-rw-r--r--cgo/libclang.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cgo/libclang.go b/cgo/libclang.go
index 794d4e81f..54ff9f53f 100644
--- a/cgo/libclang.go
+++ b/cgo/libclang.go
@@ -256,10 +256,18 @@ func (f *cgoFile) createASTNode(name string, c clangCursor) (ast.Node, any) {
},
},
}
+ var doc []string
if C.clang_isFunctionTypeVariadic(cursorType) != 0 {
+ doc = append(doc, "//go:variadic")
+ }
+ if _, ok := f.noescapingFuncs[name]; ok {
+ doc = append(doc, "//go:noescape")
+ f.noescapingFuncs[name].used = true
+ }
+ if len(doc) != 0 {
decl.Doc.List = append(decl.Doc.List, &ast.Comment{
Slash: pos - 1,
- Text: "//go:variadic",
+ Text: strings.Join(doc, "\n"),
})
}
for i := 0; i < numArgs; i++ {