diff --git a/c/clang/_wrap/cursor.cpp b/c/clang/_wrap/cursor.cpp index da3ef9a9..db63dbc4 100644 --- a/c/clang/_wrap/cursor.cpp +++ b/c/clang/_wrap/cursor.cpp @@ -109,6 +109,8 @@ enum CX_StorageClass wrap_clang_Cursor_getStorageClass(CXCursor *cursor) { return clang_Cursor_getStorageClass(*cursor); } +CXString wrap_clang_getCursorUSR(CXCursor *cur) { return clang_getCursorUSR(*cur); } + CXString wrap_clang_getCursorSpelling(CXCursor *cur) { return clang_getCursorSpelling(*cur); } unsigned wrap_clang_Cursor_isVariadic(CXCursor *cur) { return clang_Cursor_isVariadic(*cur); } @@ -181,4 +183,8 @@ void wrap_clang_getSpellingLocation(CXSourceLocation *loc, CXFile *file, unsigne clang_getSpellingLocation(*loc, file, line, column, offset); } +void wrap_clang_getRangeStart(CXSourceRange *range, CXSourceLocation *loc) { *loc = clang_getRangeStart(*range); } + +void wrap_clang_getRangeEnd(CXSourceRange *range, CXSourceLocation *loc) { *loc = clang_getRangeEnd(*range); } + } // extern "C" diff --git a/c/clang/clang.go b/c/clang/clang.go index e7e0ff2b..422252a8 100644 --- a/c/clang/clang.go +++ b/c/clang/clang.go @@ -2166,6 +2166,24 @@ func (c Cursor) StorageClass() (ret StorageClass) { return c.wrapStorageClass() } +/** + * Retrieve a Unified Symbol Resolution (USR) for the entity referenced + * by the given cursor. + * + * A Unified Symbol Resolution (USR) is a string that identifies a particular + * entity (function, class, variable, etc.) within a program. USRs can be + * compared across translation units to determine, e.g., when references in + * one translation refer to an entity defined in another translation unit. + */ +// llgo:link (*Cursor).wrapUSR C.wrap_clang_getCursorUSR +func (*Cursor) wrapUSR() (ret String) { + return +} + +func (c Cursor) USR() (ret String) { + return c.wrapUSR() +} + /** * Retrieve a name for the entity referenced by this cursor. */ @@ -2637,5 +2655,29 @@ func (l SourceLocation) SpellingLocation(file *File, line, column, offset *c.Uin l.wrapSpellingLocation(file, line, column, offset) } +/** + * Retrieve a source location representing the first character within a + * source range. + */ +// llgo:link (*SourceRange).wrapRangeStart C.wrap_clang_getRangeStart +func (r *SourceRange) wrapRangeStart(loc *SourceLocation) { return } + +func (r SourceRange) RangeStart() (loc SourceLocation) { + r.wrapRangeStart(&loc) + return +} + +/** + * Retrieve a source location representing the last character within a + * source range. + */ +// llgo:link (*SourceRange).wrapRangeEnd C.wrap_clang_getRangeEnd +func (r *SourceRange) wrapRangeEnd(loc *SourceLocation) { return } + +func (r SourceRange) RangeEnd() (loc SourceLocation) { + r.wrapRangeEnd(&loc) + return +} + //llgo:link File.FileName C.clang_getFileName func (File) FileName() (ret String) { return }