Skip to content

Commit

Permalink
Merge pull request #784 from luoliwoshang/c/clang/displayname
Browse files Browse the repository at this point in the history
c/clang:displayname & comment range
  • Loading branch information
xushiwei committed Sep 13, 2024
2 parents d53876e + 2b8d2b0 commit 9f8b9ea
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions c/clang/_wrap/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,14 @@ CXString wrap_clang_getCursorUSR(CXCursor *cur) { return clang_getCursorUSR(*cur

CXString wrap_clang_getCursorSpelling(CXCursor *cur) { return clang_getCursorSpelling(*cur); }

CXString wrap_clang_getCursorDisplayName(CXCursor *cur) { return clang_getCursorDisplayName(*cur); }

unsigned wrap_clang_Cursor_isVariadic(CXCursor *cur) { return clang_Cursor_isVariadic(*cur); }

void wrap_clang_Cursor_getCommentRange(CXCursor *cur, CXSourceRange *range) {
*range = clang_Cursor_getCommentRange(*cur);
}

CXString wrap_clang_Cursor_getRawCommentText(CXCursor *cursor) { return clang_Cursor_getRawCommentText(*cursor); }

CXString wrap_clang_Cursor_getMangling(CXCursor *cur) { return clang_Cursor_getMangling(*cur); }
Expand Down
28 changes: 28 additions & 0 deletions c/clang/clang.go
Original file line number Diff line number Diff line change
Expand Up @@ -2196,6 +2196,21 @@ func (c Cursor) String() (ret String) {
return c.wrapString()
}

/**
* Retrieve the display name for the entity referenced by this cursor.
*
* The display name contains extra information that helps identify the cursor,
* such as the parameters of a function or template or the arguments of a
* class template specialization.
*/
// llgo:link (*Cursor).wrapDisplayName C.wrap_clang_getCursorDisplayName
func (*Cursor) wrapDisplayName() (ret String) {
return
}
func (c Cursor) DisplayName() (ret String) {
return c.wrapDisplayName()
}

/**
* Returns non-zero if the given cursor is a variadic function or method.
*/
Expand All @@ -2204,6 +2219,19 @@ func (*Cursor) wrapIsVariadic() (ret c.Uint) { return 0 }

func (c Cursor) IsVariadic() (ret c.Uint) { return c.wrapIsVariadic() }

/**
* Given a cursor that represents a declaration, return the associated
* comment's source range. The range may include multiple consecutive comments
* with whitespace in between.
*/
// llgo:link (*Cursor).wrapCommentRange C.wrap_clang_Cursor_getCommentRange
func (c *Cursor) wrapCommentRange(ret *SourceRange) {}

func (c Cursor) CommentRange() (loc SourceRange) {
c.wrapCommentRange(&loc)
return
}

/**
* Given a cursor that represents a declaration, return the associated
* comment text, including comment markers.
Expand Down

0 comments on commit 9f8b9ea

Please sign in to comment.