Skip to content

Commit 504736c

Browse files
[clang][extract-api] Don't emit symbols prefixed with an underscore
These symbols are understood to not be used for client API consumption by convention so they should not appear in the generated symbol graph. Differential Revision: https://reviews.llvm.org/D125678
1 parent 23bb550 commit 504736c

File tree

2 files changed

+401
-0
lines changed

2 files changed

+401
-0
lines changed

clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,11 @@ bool SymbolGraphSerializer::shouldSkip(const APIRecord &Record) const {
467467
if (Record.Availability.isUnconditionallyUnavailable())
468468
return true;
469469

470+
// Filter out symbols prefixed with an underscored as they are understood to
471+
// be symbols clients should not use.
472+
if (Record.Name.startswith("_"))
473+
return true;
474+
470475
return false;
471476
}
472477

0 commit comments

Comments
 (0)