-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang-doc] serialize friends #146165
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: users/evelez7/clang-doc-precommit-friends
Are you sure you want to change the base?
[clang-doc] serialize friends #146165
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
You can test this locally with the following command:git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- clang-tools-extra/clang-doc/BitcodeReader.cpp clang-tools-extra/clang-doc/BitcodeWriter.cpp clang-tools-extra/clang-doc/BitcodeWriter.h clang-tools-extra/clang-doc/HTMLGenerator.cpp clang-tools-extra/clang-doc/HTMLMustacheGenerator.cpp clang-tools-extra/clang-doc/JSONGenerator.cpp clang-tools-extra/clang-doc/MDGenerator.cpp clang-tools-extra/clang-doc/Representation.cpp clang-tools-extra/clang-doc/Representation.h clang-tools-extra/clang-doc/Serialize.cpp clang-tools-extra/clang-doc/YAMLGenerator.cpp clang-tools-extra/test/clang-doc/json/class.cpp clang-tools-extra/unittests/clang-doc/BitcodeTest.cpp View the diff from clang-format here.diff --git a/clang-tools-extra/clang-doc/Representation.cpp b/clang-tools-extra/clang-doc/Representation.cpp
index ba53329a4..422a76d99 100644
--- a/clang-tools-extra/clang-doc/Representation.cpp
+++ b/clang-tools-extra/clang-doc/Representation.cpp
@@ -435,7 +435,7 @@ llvm::SmallString<16> Info::extractName() const {
case InfoType::IT_variable:
return llvm::SmallString<16>("@nonymous_variable_" +
toHex(llvm::toStringRef(USR)));
- case InfoType::IT_friend:
+ case InfoType::IT_friend:
return llvm::SmallString<16>("@nonymous_friend_" +
toHex(llvm::toStringRef(USR)));
case InfoType::IT_default:
|
@@ -947,6 +952,53 @@ emitInfo(const NamespaceDecl *D, const FullComment *FC, Location Loc, | |||
return {std::move(NSI), makeAndInsertIntoParent<const NamespaceInfo &>(*NSI)}; | |||
} | |||
|
|||
static void parseFriends(RecordInfo &RI, const CXXRecordDecl *D) { | |||
if (D->hasDefinition() && D->hasFriends()) |
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.
I think if you invert the condition you can use early return to avoid a level of nesting.
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.
LGTM, modulo formatting and 1 small suggestion.
bf66a99
to
111fe87
Compare
a373ecb
to
8dd16ca
Compare
No description provided.