Merge pull request #763 from luoliwoshang/c/clang/usr
c/clang:usr & range
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user