Skip to content

Commit 34824a9

Browse files
committed
[clang-doc] clang-format + addressing pr comments
1 parent de7305b commit 34824a9

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

clang-tools-extra/clang-doc/Mapper.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,9 @@ namespace doc {
2121
static llvm::StringSet USRVisited;
2222
static llvm::sys::Mutex USRVisitedGuard;
2323

24-
25-
template <typename T> bool isTypedefAnonRecord(const T* D) {
24+
template <typename T> bool isTypedefAnonRecord(const T *D) {
2625
if (const auto *C = dyn_cast<CXXRecordDecl>(D)) {
27-
if (const TypedefNameDecl *TD = C->getTypedefNameForAnonDecl()) {
28-
return true;
29-
}
26+
return C->getTypedefNameForAnonDecl();
3027
}
3128
return false;
3229
}
@@ -35,8 +32,8 @@ void MapASTVisitor::HandleTranslationUnit(ASTContext &Context) {
3532
TraverseDecl(Context.getTranslationUnitDecl());
3633
}
3734

38-
template <typename T> bool MapASTVisitor::mapDecl(const T *D,
39-
bool IsDefinition) {
35+
template <typename T>
36+
bool MapASTVisitor::mapDecl(const T *D, bool IsDefinition) {
4037
// If we're looking a decl not in user files, skip this decl.
4138
if (D->getASTContext().getSourceManager().isInSystemHeader(D->getLocation()))
4239
return true;
@@ -80,7 +77,7 @@ template <typename T> bool MapASTVisitor::mapDecl(const T *D,
8077
}
8178

8279
bool MapASTVisitor::VisitNamespaceDecl(const NamespaceDecl *D) {
83-
return mapDecl(D, true);
80+
return mapDecl(D, /*isDefinition=*/true);
8481
}
8582

8683
bool MapASTVisitor::VisitRecordDecl(const RecordDecl *D) {
@@ -103,11 +100,11 @@ bool MapASTVisitor::VisitFunctionDecl(const FunctionDecl *D) {
103100
}
104101

105102
bool MapASTVisitor::VisitTypedefDecl(const TypedefDecl *D) {
106-
return mapDecl(D, true);
103+
return mapDecl(D, /*isDefinition=*/true);
107104
}
108105

109106
bool MapASTVisitor::VisitTypeAliasDecl(const TypeAliasDecl *D) {
110-
return mapDecl(D, true);
107+
return mapDecl(D, /*isDefinition=*/true);
111108
}
112109

113110
comments::FullComment *

clang-tools-extra/clang-doc/Mapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class MapASTVisitor : public clang::RecursiveASTVisitor<MapASTVisitor>,
4343
bool VisitTypeAliasDecl(const TypeAliasDecl *D);
4444

4545
private:
46-
template <typename T> bool mapDecl(const T *D, bool isDefinition);
46+
template <typename T> bool mapDecl(const T *D, bool IsDefinition);
4747

4848
int getLine(const NamedDecl *D, const ASTContext &Context) const;
4949
llvm::SmallString<128> getFile(const NamedDecl *D, const ASTContext &Context,

0 commit comments

Comments
 (0)