-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang][ExtractAPI] Create extractapi::RecordLocation #65891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Create and use extractapi::RecordLocation instead of conventional clang::PresumedLoc to track the location of an APIRecord, this reduces the dependency of APISet on SourceManager and would help if someone wants to create APISet from JSON Serialized SymbolGraph. These changes also add extractapi::CommentLine which is similar to RawComment::CommentLine but use RecordLocation instead of PresumedLoc. Differential Revision: https://reviews.llvm.org/D157810
@llvm/pr-subscribers-clang ChangesCreate and use These changes also add This was initially being tracked on llvm Phabricator
|
/// ExtractAPI. | ||
class RecordLocation { | ||
unsigned Line, Col; | ||
std::string Filename; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to some reasons, I am currently unable to open the original deferential revision (https://reviews.llvm.org/D157810).
So for those who are facing the same issue, It had the following review comment from @ributzka
There is an opportunity for optimization by avoiding the allocation of separate strings for each source location, especially since many source locations will be in the same file. As an example, APISet utilizes a BumpPtrAllocator to allocate and deduplicate strings. It is recommended to consider using the same allocator or a similar concept.
Create and use
extractapi::RecordLocation
instead of conventionalclang::PresumedLoc
to track the location of an APIRecord, this reduces the dependency of APISet on SourceManager and would help if someone wants to create APISet from JSON Serialized SymbolGraph.These changes also add
extractapi::CommentLine
which is similar to RawComment::CommentLine but use RecordLocation instead of PresumedLoc.This was initially being tracked on llvm Phabricator
Differential Revision: https://reviews.llvm.org/D157810