Merge pull request #893 from tsingbx/clang
add clang.GoString, clang.File functions for helper of llcppsymg struct_methodname
This commit is contained in:
@@ -35,6 +35,8 @@ int wrap_clang_Cursor_isNull(CXCursor *cursor) { return clang_Cursor_isNull(*cur
|
|||||||
|
|
||||||
void wrap_clang_getCursorSemanticParent(CXCursor *C, CXCursor *parent) { *parent = clang_getCursorSemanticParent(*C); }
|
void wrap_clang_getCursorSemanticParent(CXCursor *C, CXCursor *parent) { *parent = clang_getCursorSemanticParent(*C); }
|
||||||
|
|
||||||
|
void wrap_clang_getCursorDefinition(CXCursor *C, CXCursor *def) { *def = clang_getCursorDefinition(*C); }
|
||||||
|
|
||||||
void wrap_clang_getCursorLexicalParent(CXCursor *C, CXCursor *parent) { *parent = clang_getCursorLexicalParent(*C); }
|
void wrap_clang_getCursorLexicalParent(CXCursor *C, CXCursor *parent) { *parent = clang_getCursorLexicalParent(*C); }
|
||||||
|
|
||||||
void wrap_clang_getOverriddenCursors(CXCursor *cursor, CXCursor **overridden, unsigned *num_overridden) {
|
void wrap_clang_getOverriddenCursors(CXCursor *cursor, CXCursor **overridden, unsigned *num_overridden) {
|
||||||
|
|||||||
@@ -57,3 +57,12 @@ type StringSet struct {
|
|||||||
*/
|
*/
|
||||||
// llgo:link (*StringSet).Dispose C.clang_disposeStringSet
|
// llgo:link (*StringSet).Dispose C.clang_disposeStringSet
|
||||||
func (*StringSet) Dispose() {}
|
func (*StringSet) Dispose() {}
|
||||||
|
|
||||||
|
func GoString(clangStr String) (str string) {
|
||||||
|
defer clangStr.Dispose()
|
||||||
|
cstr := clangStr.CStr()
|
||||||
|
if cstr != nil {
|
||||||
|
str = c.GoString(cstr)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@@ -1635,6 +1635,14 @@ func (c Cursor) SemanticParent() (parent Cursor) {
|
|||||||
return
|
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.
|
* 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)
|
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
|
* Retrieve a source location representing the first character within a
|
||||||
* source range.
|
* source range.
|
||||||
|
|||||||
Reference in New Issue
Block a user