Skip to content

[clang-doc] Fix clang-tidy naming diagnostics #136444

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

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

ilovepi
Copy link
Contributor

@ilovepi ilovepi commented Apr 19, 2025

In quite a few places we were not following the project naming
conventions. This patch applies clang-tidy fixes, and updates
some additional names to follow more typical project wide patterns.

In quite a few places we were not following the project naming
conventions. This patch applies clang-tidy fixes, and updates
some additional names to follow more typical project wide patterns.
Copy link
Contributor Author

ilovepi commented Apr 19, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@llvmbot
Copy link
Member

llvmbot commented Apr 19, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: Paul Kirth (ilovepi)

Changes

In quite a few places we were not following the project naming
conventions. This patch applies clang-tidy fixes, and updates
some additional names to follow more typical project wide patterns.


Patch is 24.55 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/136444.diff

3 Files Affected:

  • (modified) clang-tools-extra/clang-doc/BitcodeWriter.cpp (+102-97)
  • (modified) clang-tools-extra/clang-doc/HTMLGenerator.cpp (+1-3)
  • (modified) clang-tools-extra/clang-doc/Serialize.cpp (+41-41)
diff --git a/clang-tools-extra/clang-doc/BitcodeWriter.cpp b/clang-tools-extra/clang-doc/BitcodeWriter.cpp
index 621af4e51e443..6545629f1c739 100644
--- a/clang-tools-extra/clang-doc/BitcodeWriter.cpp
+++ b/clang-tools-extra/clang-doc/BitcodeWriter.cpp
@@ -30,49 +30,50 @@ struct RecordIdToIndexFunctor {
 
 using AbbrevDsc = void (*)(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev);
 
-static void AbbrevGen(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev,
-                      const std::initializer_list<llvm::BitCodeAbbrevOp> Ops) {
+static void
+generateAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev,
+               const std::initializer_list<llvm::BitCodeAbbrevOp> Ops) {
   for (const auto &Op : Ops)
     Abbrev->Add(Op);
 }
 
-static void BoolAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
-  AbbrevGen(Abbrev,
-            {// 0. Boolean
-             llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
-                                   BitCodeConstants::BoolSize)});
+static void genBoolAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
+  generateAbbrev(Abbrev,
+                 {// 0. Boolean
+                  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
+                                        BitCodeConstants::BoolSize)});
 }
 
-static void IntAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
-  AbbrevGen(Abbrev,
-            {// 0. Fixed-size integer
-             llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
-                                   BitCodeConstants::IntSize)});
+static void genIntAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
+  generateAbbrev(Abbrev,
+                 {// 0. Fixed-size integer
+                  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
+                                        BitCodeConstants::IntSize)});
 }
 
-static void SymbolIDAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
-  AbbrevGen(Abbrev,
-            {// 0. Fixed-size integer (length of the sha1'd USR)
-             llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
-                                   BitCodeConstants::USRLengthSize),
-             // 1. Fixed-size array of Char6 (USR)
-             llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Array),
-             llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
-                                   BitCodeConstants::USRBitLengthSize)});
+static void genSymbolIdAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
+  generateAbbrev(Abbrev,
+                 {// 0. Fixed-size integer (length of the sha1'd USR)
+                  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
+                                        BitCodeConstants::USRLengthSize),
+                  // 1. Fixed-size array of Char6 (USR)
+                  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Array),
+                  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
+                                        BitCodeConstants::USRBitLengthSize)});
 }
 
-static void StringAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
-  AbbrevGen(Abbrev,
-            {// 0. Fixed-size integer (length of the following string)
-             llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
-                                   BitCodeConstants::StringLengthSize),
-             // 1. The string blob
-             llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Blob)});
+static void genStringAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
+  generateAbbrev(Abbrev,
+                 {// 0. Fixed-size integer (length of the following string)
+                  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
+                                        BitCodeConstants::StringLengthSize),
+                  // 1. The string blob
+                  llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Blob)});
 }
 
 // Assumes that the file will not have more than 65535 lines.
-static void LocationAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
-  AbbrevGen(
+static void genLocationAbbrev(std::shared_ptr<llvm::BitCodeAbbrev> &Abbrev) {
+  generateAbbrev(
       Abbrev,
       {// 0. Fixed-size integer (line number)
        llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Fixed,
@@ -140,67 +141,68 @@ static const llvm::IndexedMap<RecordIdDsc, RecordIdToIndexFunctor>
       // There is no init-list constructor for the IndexedMap, so have to
       // improvise
       static const std::vector<std::pair<RecordId, RecordIdDsc>> Inits = {
-          {VERSION, {"Version", &IntAbbrev}},
-          {COMMENT_KIND, {"Kind", &StringAbbrev}},
-          {COMMENT_TEXT, {"Text", &StringAbbrev}},
-          {COMMENT_NAME, {"Name", &StringAbbrev}},
-          {COMMENT_DIRECTION, {"Direction", &StringAbbrev}},
-          {COMMENT_PARAMNAME, {"ParamName", &StringAbbrev}},
-          {COMMENT_CLOSENAME, {"CloseName", &StringAbbrev}},
-          {COMMENT_SELFCLOSING, {"SelfClosing", &BoolAbbrev}},
-          {COMMENT_EXPLICIT, {"Explicit", &BoolAbbrev}},
-          {COMMENT_ATTRKEY, {"AttrKey", &StringAbbrev}},
-          {COMMENT_ATTRVAL, {"AttrVal", &StringAbbrev}},
-          {COMMENT_ARG, {"Arg", &StringAbbrev}},
-          {FIELD_TYPE_NAME, {"Name", &StringAbbrev}},
-          {FIELD_DEFAULT_VALUE, {"DefaultValue", &StringAbbrev}},
-          {MEMBER_TYPE_NAME, {"Name", &StringAbbrev}},
-          {MEMBER_TYPE_ACCESS, {"Access", &IntAbbrev}},
-          {MEMBER_TYPE_IS_STATIC, {"IsStatic", &BoolAbbrev}},
-          {NAMESPACE_USR, {"USR", &SymbolIDAbbrev}},
-          {NAMESPACE_NAME, {"Name", &StringAbbrev}},
-          {NAMESPACE_PATH, {"Path", &StringAbbrev}},
-          {ENUM_USR, {"USR", &SymbolIDAbbrev}},
-          {ENUM_NAME, {"Name", &StringAbbrev}},
-          {ENUM_DEFLOCATION, {"DefLocation", &LocationAbbrev}},
-          {ENUM_LOCATION, {"Location", &LocationAbbrev}},
-          {ENUM_SCOPED, {"Scoped", &BoolAbbrev}},
-          {ENUM_VALUE_NAME, {"Name", &StringAbbrev}},
-          {ENUM_VALUE_VALUE, {"Value", &StringAbbrev}},
-          {ENUM_VALUE_EXPR, {"Expr", &StringAbbrev}},
-          {RECORD_USR, {"USR", &SymbolIDAbbrev}},
-          {RECORD_NAME, {"Name", &StringAbbrev}},
-          {RECORD_PATH, {"Path", &StringAbbrev}},
-          {RECORD_DEFLOCATION, {"DefLocation", &LocationAbbrev}},
-          {RECORD_LOCATION, {"Location", &LocationAbbrev}},
-          {RECORD_TAG_TYPE, {"TagType", &IntAbbrev}},
-          {RECORD_IS_TYPE_DEF, {"IsTypeDef", &BoolAbbrev}},
-          {BASE_RECORD_USR, {"USR", &SymbolIDAbbrev}},
-          {BASE_RECORD_NAME, {"Name", &StringAbbrev}},
-          {BASE_RECORD_PATH, {"Path", &StringAbbrev}},
-          {BASE_RECORD_TAG_TYPE, {"TagType", &IntAbbrev}},
-          {BASE_RECORD_IS_VIRTUAL, {"IsVirtual", &BoolAbbrev}},
-          {BASE_RECORD_ACCESS, {"Access", &IntAbbrev}},
-          {BASE_RECORD_IS_PARENT, {"IsParent", &BoolAbbrev}},
-          {FUNCTION_USR, {"USR", &SymbolIDAbbrev}},
-          {FUNCTION_NAME, {"Name", &StringAbbrev}},
-          {FUNCTION_DEFLOCATION, {"DefLocation", &LocationAbbrev}},
-          {FUNCTION_LOCATION, {"Location", &LocationAbbrev}},
-          {FUNCTION_ACCESS, {"Access", &IntAbbrev}},
-          {FUNCTION_IS_METHOD, {"IsMethod", &BoolAbbrev}},
-          {FUNCTION_IS_STATIC, {"IsStatic", &BoolAbbrev}},
-          {REFERENCE_USR, {"USR", &SymbolIDAbbrev}},
-          {REFERENCE_NAME, {"Name", &StringAbbrev}},
-          {REFERENCE_QUAL_NAME, {"QualName", &StringAbbrev}},
-          {REFERENCE_TYPE, {"RefType", &IntAbbrev}},
-          {REFERENCE_PATH, {"Path", &StringAbbrev}},
-          {REFERENCE_FIELD, {"Field", &IntAbbrev}},
-          {TEMPLATE_PARAM_CONTENTS, {"Contents", &StringAbbrev}},
-          {TEMPLATE_SPECIALIZATION_OF, {"SpecializationOf", &SymbolIDAbbrev}},
-          {TYPEDEF_USR, {"USR", &SymbolIDAbbrev}},
-          {TYPEDEF_NAME, {"Name", &StringAbbrev}},
-          {TYPEDEF_DEFLOCATION, {"DefLocation", &LocationAbbrev}},
-          {TYPEDEF_IS_USING, {"IsUsing", &BoolAbbrev}}};
+          {VERSION, {"Version", &genIntAbbrev}},
+          {COMMENT_KIND, {"Kind", &genStringAbbrev}},
+          {COMMENT_TEXT, {"Text", &genStringAbbrev}},
+          {COMMENT_NAME, {"Name", &genStringAbbrev}},
+          {COMMENT_DIRECTION, {"Direction", &genStringAbbrev}},
+          {COMMENT_PARAMNAME, {"ParamName", &genStringAbbrev}},
+          {COMMENT_CLOSENAME, {"CloseName", &genStringAbbrev}},
+          {COMMENT_SELFCLOSING, {"SelfClosing", &genBoolAbbrev}},
+          {COMMENT_EXPLICIT, {"Explicit", &genBoolAbbrev}},
+          {COMMENT_ATTRKEY, {"AttrKey", &genStringAbbrev}},
+          {COMMENT_ATTRVAL, {"AttrVal", &genStringAbbrev}},
+          {COMMENT_ARG, {"Arg", &genStringAbbrev}},
+          {FIELD_TYPE_NAME, {"Name", &genStringAbbrev}},
+          {FIELD_DEFAULT_VALUE, {"DefaultValue", &genStringAbbrev}},
+          {MEMBER_TYPE_NAME, {"Name", &genStringAbbrev}},
+          {MEMBER_TYPE_ACCESS, {"Access", &genIntAbbrev}},
+          {MEMBER_TYPE_IS_STATIC, {"IsStatic", &genBoolAbbrev}},
+          {NAMESPACE_USR, {"USR", &genSymbolIdAbbrev}},
+          {NAMESPACE_NAME, {"Name", &genStringAbbrev}},
+          {NAMESPACE_PATH, {"Path", &genStringAbbrev}},
+          {ENUM_USR, {"USR", &genSymbolIdAbbrev}},
+          {ENUM_NAME, {"Name", &genStringAbbrev}},
+          {ENUM_DEFLOCATION, {"DefLocation", &genLocationAbbrev}},
+          {ENUM_LOCATION, {"Location", &genLocationAbbrev}},
+          {ENUM_SCOPED, {"Scoped", &genBoolAbbrev}},
+          {ENUM_VALUE_NAME, {"Name", &genStringAbbrev}},
+          {ENUM_VALUE_VALUE, {"Value", &genStringAbbrev}},
+          {ENUM_VALUE_EXPR, {"Expr", &genStringAbbrev}},
+          {RECORD_USR, {"USR", &genSymbolIdAbbrev}},
+          {RECORD_NAME, {"Name", &genStringAbbrev}},
+          {RECORD_PATH, {"Path", &genStringAbbrev}},
+          {RECORD_DEFLOCATION, {"DefLocation", &genLocationAbbrev}},
+          {RECORD_LOCATION, {"Location", &genLocationAbbrev}},
+          {RECORD_TAG_TYPE, {"TagType", &genIntAbbrev}},
+          {RECORD_IS_TYPE_DEF, {"IsTypeDef", &genBoolAbbrev}},
+          {BASE_RECORD_USR, {"USR", &genSymbolIdAbbrev}},
+          {BASE_RECORD_NAME, {"Name", &genStringAbbrev}},
+          {BASE_RECORD_PATH, {"Path", &genStringAbbrev}},
+          {BASE_RECORD_TAG_TYPE, {"TagType", &genIntAbbrev}},
+          {BASE_RECORD_IS_VIRTUAL, {"IsVirtual", &genBoolAbbrev}},
+          {BASE_RECORD_ACCESS, {"Access", &genIntAbbrev}},
+          {BASE_RECORD_IS_PARENT, {"IsParent", &genBoolAbbrev}},
+          {FUNCTION_USR, {"USR", &genSymbolIdAbbrev}},
+          {FUNCTION_NAME, {"Name", &genStringAbbrev}},
+          {FUNCTION_DEFLOCATION, {"DefLocation", &genLocationAbbrev}},
+          {FUNCTION_LOCATION, {"Location", &genLocationAbbrev}},
+          {FUNCTION_ACCESS, {"Access", &genIntAbbrev}},
+          {FUNCTION_IS_METHOD, {"IsMethod", &genBoolAbbrev}},
+          {FUNCTION_IS_STATIC, {"IsStatic", &genBoolAbbrev}},
+          {REFERENCE_USR, {"USR", &genSymbolIdAbbrev}},
+          {REFERENCE_NAME, {"Name", &genStringAbbrev}},
+          {REFERENCE_QUAL_NAME, {"QualName", &genStringAbbrev}},
+          {REFERENCE_TYPE, {"RefType", &genIntAbbrev}},
+          {REFERENCE_PATH, {"Path", &genStringAbbrev}},
+          {REFERENCE_FIELD, {"Field", &genIntAbbrev}},
+          {TEMPLATE_PARAM_CONTENTS, {"Contents", &genStringAbbrev}},
+          {TEMPLATE_SPECIALIZATION_OF,
+           {"SpecializationOf", &genSymbolIdAbbrev}},
+          {TYPEDEF_USR, {"USR", &genSymbolIdAbbrev}},
+          {TYPEDEF_NAME, {"Name", &genStringAbbrev}},
+          {TYPEDEF_DEFLOCATION, {"DefLocation", &genLocationAbbrev}},
+          {TYPEDEF_IS_USING, {"IsUsing", &genBoolAbbrev}}};
       assert(Inits.size() == RecordIdCount);
       for (const auto &Init : Inits) {
         RecordIdNameMap[Init.first] = Init.second;
@@ -327,7 +329,7 @@ void ClangDocBitcodeWriter::emitAbbrev(RecordId ID, BlockId Block) {
 
 void ClangDocBitcodeWriter::emitRecord(const SymbolID &Sym, RecordId ID) {
   assert(RecordIdNameMap[ID] && "Unknown RecordId.");
-  assert(RecordIdNameMap[ID].Abbrev == &SymbolIDAbbrev &&
+  assert(RecordIdNameMap[ID].Abbrev == &genSymbolIdAbbrev &&
          "Abbrev type mismatch.");
   if (!prepRecordData(ID, Sym != EmptySID))
     return;
@@ -339,7 +341,7 @@ void ClangDocBitcodeWriter::emitRecord(const SymbolID &Sym, RecordId ID) {
 
 void ClangDocBitcodeWriter::emitRecord(llvm::StringRef Str, RecordId ID) {
   assert(RecordIdNameMap[ID] && "Unknown RecordId.");
-  assert(RecordIdNameMap[ID].Abbrev == &StringAbbrev &&
+  assert(RecordIdNameMap[ID].Abbrev == &genStringAbbrev &&
          "Abbrev type mismatch.");
   if (!prepRecordData(ID, !Str.empty()))
     return;
@@ -350,7 +352,7 @@ void ClangDocBitcodeWriter::emitRecord(llvm::StringRef Str, RecordId ID) {
 
 void ClangDocBitcodeWriter::emitRecord(const Location &Loc, RecordId ID) {
   assert(RecordIdNameMap[ID] && "Unknown RecordId.");
-  assert(RecordIdNameMap[ID].Abbrev == &LocationAbbrev &&
+  assert(RecordIdNameMap[ID].Abbrev == &genLocationAbbrev &&
          "Abbrev type mismatch.");
   if (!prepRecordData(ID, true))
     return;
@@ -364,7 +366,8 @@ void ClangDocBitcodeWriter::emitRecord(const Location &Loc, RecordId ID) {
 
 void ClangDocBitcodeWriter::emitRecord(bool Val, RecordId ID) {
   assert(RecordIdNameMap[ID] && "Unknown RecordId.");
-  assert(RecordIdNameMap[ID].Abbrev == &BoolAbbrev && "Abbrev type mismatch.");
+  assert(RecordIdNameMap[ID].Abbrev == &genBoolAbbrev &&
+         "Abbrev type mismatch.");
   if (!prepRecordData(ID, Val))
     return;
   Record.push_back(Val);
@@ -373,7 +376,8 @@ void ClangDocBitcodeWriter::emitRecord(bool Val, RecordId ID) {
 
 void ClangDocBitcodeWriter::emitRecord(int Val, RecordId ID) {
   assert(RecordIdNameMap[ID] && "Unknown RecordId.");
-  assert(RecordIdNameMap[ID].Abbrev == &IntAbbrev && "Abbrev type mismatch.");
+  assert(RecordIdNameMap[ID].Abbrev == &genIntAbbrev &&
+         "Abbrev type mismatch.");
   if (!prepRecordData(ID, Val))
     return;
   // FIXME: Assert that the integer is of the appropriate size.
@@ -383,7 +387,8 @@ void ClangDocBitcodeWriter::emitRecord(int Val, RecordId ID) {
 
 void ClangDocBitcodeWriter::emitRecord(unsigned Val, RecordId ID) {
   assert(RecordIdNameMap[ID] && "Unknown RecordId.");
-  assert(RecordIdNameMap[ID].Abbrev == &IntAbbrev && "Abbrev type mismatch.");
+  assert(RecordIdNameMap[ID].Abbrev == &genIntAbbrev &&
+         "Abbrev type mismatch.");
   if (!prepRecordData(ID, Val))
     return;
   assert(Val < (1U << BitCodeConstants::IntSize));
diff --git a/clang-tools-extra/clang-doc/HTMLGenerator.cpp b/clang-tools-extra/clang-doc/HTMLGenerator.cpp
index ef6e61d34e1bf..6d061b33a67c1 100644
--- a/clang-tools-extra/clang-doc/HTMLGenerator.cpp
+++ b/clang-tools-extra/clang-doc/HTMLGenerator.cpp
@@ -105,12 +105,10 @@ struct TagNode : public HTMLNode {
   void render(llvm::raw_ostream &OS, int IndentationLevel) override;
 };
 
-constexpr const char *kDoctypeDecl = "<!DOCTYPE html>";
-
 struct HTMLFile {
   std::vector<std::unique_ptr<HTMLNode>> Children; // List of child nodes
   void render(llvm::raw_ostream &OS) {
-    OS << kDoctypeDecl << "\n";
+    OS << "<!DOCTYPE html>\n";
     for (const auto &C : Children) {
       C->render(OS, 0);
       OS << "\n";
diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp
index 1dcccf3c3c2ab..687a7e3e31207 100644
--- a/clang-tools-extra/clang-doc/Serialize.cpp
+++ b/clang-tools-extra/clang-doc/Serialize.cpp
@@ -320,7 +320,7 @@ static void InsertChild(ScopeChildren &Scope, TypedefInfo Info) {
 // parameter. Since each variant is used once, it's not worth having a more
 // elaborate system to automatically deduce this information.
 template <typename ChildType>
-static std::unique_ptr<Info> MakeAndInsertIntoParent(ChildType Child) {
+static std::unique_ptr<Info> makeAndInsertIntoParent(ChildType Child) {
   if (Child.Namespace.empty()) {
     // Insert into unnamed parent namespace.
     auto ParentNS = std::make_unique<NamespaceInfo>();
@@ -498,7 +498,7 @@ populateParentNamespaces(llvm::SmallVector<Reference, 4> &Namespaces,
 }
 
 static void
-PopulateTemplateParameters(std::optional<TemplateInfo> &TemplateInfo,
+populateTemplateParameters(std::optional<TemplateInfo> &TemplateInfo,
                            const clang::Decl *D) {
   if (const TemplateParameterList *ParamList =
           D->getDescribedTemplateParams()) {
@@ -512,8 +512,8 @@ PopulateTemplateParameters(std::optional<TemplateInfo> &TemplateInfo,
   }
 }
 
-static TemplateParamInfo TemplateArgumentToInfo(const clang::Decl *D,
-                                                const TemplateArgument &Arg) {
+static TemplateParamInfo convertTemplateArgToInfo(const clang::Decl *D,
+                                                  const TemplateArgument &Arg) {
   // The TemplateArgument's pretty printing handles all the normal cases
   // well enough for our requirements.
   std::string Str;
@@ -556,7 +556,7 @@ static void populateFunctionInfo(FunctionInfo &I, const FunctionDecl *D,
   I.ReturnType = getTypeInfoForType(D->getReturnType(), LO);
   parseParameters(I, D);
 
-  PopulateTemplateParameters(I.Template, D);
+  populateTemplateParameters(I.Template, D);
 
   // Handle function template specializations.
   if (const FunctionTemplateSpecializationInfo *FTSI =
@@ -571,7 +571,7 @@ static void populateFunctionInfo(FunctionInfo &I, const FunctionDecl *D,
     // Template parameters to the specialization.
     if (FTSI->TemplateArguments) {
       for (const TemplateArgument &Arg : FTSI->TemplateArguments->asArray()) {
-        Specialization.Params.push_back(TemplateArgumentToInfo(D, Arg));
+        Specialization.Params.push_back(convertTemplateArgToInfo(D, Arg));
       }
     }
   }
@@ -588,9 +588,9 @@ static void populateMemberTypeInfo(MemberTypeInfo &I, const Decl *D) {
     return;
 
   Comment->setAttached();
-  if (comments::FullComment *fc = Comment->parse(Context, nullptr, D)) {
+  if (comments::FullComment *Fc = Comment->parse(Context, nullptr, D)) {
     I.Description.emplace_back();
-    parseFullComment(fc, I.Description.back());
+    parseFullComment(Fc, I.Description.back());
   }
 }
 
@@ -665,55 +665,55 @@ parseBases(RecordInfo &I, const CXXRecordDecl *D, bool IsFileInRootDir,
 std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
 emitInfo(const NamespaceDecl *D, const FullComment *FC, int LineNumber,
          llvm::StringRef File, bool IsFileInRootDir, bool PublicOnly) {
-  auto I = std::make_unique<NamespaceInfo>();
+  auto NSI = std::make_unique<NamespaceInfo>();
   bool IsInAnonymousNamespace = false;
-  populateInfo(*I, D, FC, IsInAnonymousNamespace);
+  populateInfo(*NSI, D, FC, IsInAnonymousNamespace);
   if (!shouldSerializeInfo(PublicOnly, IsInAnonymousNamespace, D))
     return {};
 
-  I->Name = D->isAnonymousNamespace()
-                ? llvm::SmallString<16>("@nonymous_namespace")
-                : I->Name;
-  I->Path = getInfoRelativePath(I->Namespace);
-  if (I->Namespace.empty() && I->USR == SymbolID())
-    return {std::unique_ptr<Info>{std::move(I)}, nullptr};
+  NSI->Name = D->isAnonymousNamespace()
+                  ? llvm::SmallString<16>("@nonymous_namespace")
+                  : NSI->Name;
+  NSI->Path = getInfoRelativePath(NSI->Namespace);
+  if (NSI->Namespace.empty() && NSI->USR == SymbolID())
+    return {std::unique_ptr<Info>{std::move(NSI)}, nullptr};
 
   // Namespaces are inserted into the parent by reference, so we need to return
   // both the parent and the record itself.
-  return {std::move(I), MakeAndInsertIntoParent<const NamespaceInfo &>(*I)};
+  return {std::move(NSI), makeAndInsertIntoParent<const NamespaceInfo &>(*NSI)};
 }
 
 std::pair<std::unique_ptr<Info>, std::unique_ptr<Info>>
 emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber,
          llvm::StringRef File, bool IsFileInRootDir, bool PublicOnly) {
-  auto I = std::make_unique<RecordInfo>();
+  auto RI = std::make_unique<RecordInfo>();
   bool IsInAnonymousNamespace = false;
-  populateSymbolInfo(*I, D, FC, LineNumber, File, IsFileInRootDir,
+  populateSymbolInfo(*RI, D, FC, LineNumber, File, IsFileInRootDir,
                      IsInAnonymousNamespace);
   if (!shouldSerializeInfo(PublicOnly, IsInAnonymousNamespace, D))
     return {};
 
-  I->TagType = D->getTagKind();
-  parseFields(*I, D, PublicOnly);
+  RI->TagType = D->getTagKind();
+  parseFie...
[truncated]

Copy link
Contributor Author

ilovepi commented Apr 22, 2025

Merge activity

  • Apr 22, 3:19 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 22, 3:20 PM EDT: A user merged this pull request with Graphite.

@ilovepi ilovepi merged commit 718a509 into main Apr 22, 2025
13 checks passed
@ilovepi ilovepi deleted the users/ilovepi/clang-doc-tidy-rename branch April 22, 2025 19:20
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
In quite a few places we were not following the project naming
conventions. This patch applies clang-tidy fixes, and updates
some additional names to follow more typical project wide patterns.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
In quite a few places we were not following the project naming
conventions. This patch applies clang-tidy fixes, and updates
some additional names to follow more typical project wide patterns.
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
In quite a few places we were not following the project naming
conventions. This patch applies clang-tidy fixes, and updates
some additional names to follow more typical project wide patterns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants