clang:included & system header

This commit is contained in:
luoliwoshang
2024-11-12 20:26:33 +08:00
parent 73ca579056
commit 288b705450
2 changed files with 27 additions and 0 deletions

View File

@@ -33,6 +33,8 @@ void wrap_clang_getOverriddenCursors(CXCursor *cursor, CXCursor **overridden, un
clang_getOverriddenCursors(*cursor, overridden, num_overridden);
}
CXFile wrap_clang_getIncludedFile(CXCursor *cursor) { return clang_getIncludedFile(*cursor); }
void wrap_clang_getCursor(CXTranslationUnit uint, CXSourceLocation *loc, CXCursor *cur) {
*cur = clang_getCursor(uint, *loc);
}
@@ -192,6 +194,8 @@ unsigned wrap_clang_visitChildren(CXCursor *parent, wrap_CXCursorVisitor visitor
return clang_visitChildren(*parent, wrap_visitor, CXClientData(&data));
}
int wrap_clang_Location_isInSystemHeader(CXSourceLocation *loc) { return clang_Location_isInSystemHeader(*loc); }
void wrap_clang_getSpellingLocation(CXSourceLocation *loc, CXFile *file, unsigned *line, unsigned *column,
unsigned *offset) {
clang_getSpellingLocation(*loc, file, line, column, offset);

View File

@@ -1710,6 +1710,19 @@ func (c Cursor) OverriddenCursors(overridden **Cursor, numOverridden *c.Uint) {
// llgo:link (*Cursor).DisposeOverriddenCursors C.clang_disposeOverriddenCursors
func (c *Cursor) DisposeOverriddenCursors() {}
/**
* Retrieve the file that is included by the given inclusion directive
* cursor.
*/
// llgo:link (*Cursor).wrapIncludedFile C.wrap_clang_getIncludedFile
func (c *Cursor) wrapIncludedFile() File {
return 0
}
func (c Cursor) IncludedFile() (file File) {
return c.wrapIncludedFile()
}
/**
* Map a source location to the cursor that describes the entity at that
* location in the source code.
@@ -2719,6 +2732,16 @@ func (t *TranslationUnit) Tokenize(ran SourceRange, tokens **Token, numTokens *c
// llgo:link (*TranslationUnit).DisposeTokens C.clang_disposeTokens
func (t *TranslationUnit) DisposeTokens(tokens *Token, numTokens c.Uint) {}
/**
* Returns non-zero if the given source location is in a system header.
*/
// llgo:link (*SourceLocation).wrapIsInSystemHeader C.wrap_clang_Location_isInSystemHeader
func (l *SourceLocation) wrapIsInSystemHeader() (ret c.Uint) { return 0 }
func (l SourceLocation) IsInSystemHeader() (ret c.Uint) {
return l.wrapIsInSystemHeader()
}
/**
* Retrieve the file, line, column, and offset represented by
* the given source location.