add clang.GoString, clang.File functions for helper of llcppsymg struct_methodname

This commit is contained in:
tsingbx
2024-11-29 09:58:41 +08:00
parent 6a3fce97cf
commit 68b09e87b3
3 changed files with 38 additions and 0 deletions

View File

@@ -1635,6 +1635,14 @@ func (c Cursor) SemanticParent() (parent Cursor) {
return
}
// llgo:link (*Cursor).wrapDefinition C.wrap_clang_getCursorDefinition
func (*Cursor) wrapDefinition(def *Cursor) {}
func (c Cursor) Definition() (def Cursor) {
c.wrapDefinition(&def)
return
}
/**
* Determine the lexical parent of the given cursor.
*
@@ -2795,6 +2803,26 @@ func (l SourceLocation) SpellingLocation(file *File, line, column, offset *c.Uin
l.wrapSpellingLocation(file, line, column, offset)
}
func (l SourceLocation) File() (ret File) {
l.wrapSpellingLocation(&ret, nil, nil, nil)
return
}
func (l SourceLocation) Line() (ret c.Uint) {
l.wrapSpellingLocation(nil, &ret, nil, nil)
return
}
func (l SourceLocation) Column() (ret c.Uint) {
l.wrapSpellingLocation(nil, nil, &ret, nil)
return
}
func (l SourceLocation) Offset() (ret c.Uint) {
l.wrapSpellingLocation(nil, nil, nil, &ret)
return
}
/**
* Retrieve a source location representing the first character within a
* source range.