c/clang:usr & range

This commit is contained in:
luoliwoshang
2024-09-03 18:33:40 +08:00
parent 3ce9567f62
commit 57f8d535fb
2 changed files with 48 additions and 0 deletions

View File

@@ -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 }