[clang-tools-extra] [clang-doc][NFC] Use LLVM style naming in YAMLGenerator.cpp (PR #136393)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 18 17:42:15 PDT 2025
https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/136393
None
>From 6020b441aef0e3dfa6b33fc82c4a2f82ab208834 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Fri, 18 Apr 2025 17:40:15 -0700
Subject: [PATCH] [clang-doc][NFC] Use LLVM style naming in YAMLGenerator.cpp
---
clang-tools-extra/clang-doc/YAMLGenerator.cpp | 44 +++++++++----------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/clang-tools-extra/clang-doc/YAMLGenerator.cpp b/clang-tools-extra/clang-doc/YAMLGenerator.cpp
index ffabd2fd82229..1b741f52ea5e3 100644
--- a/clang-tools-extra/clang-doc/YAMLGenerator.cpp
+++ b/clang-tools-extra/clang-doc/YAMLGenerator.cpp
@@ -92,11 +92,11 @@ template <> struct ScalarTraits<std::array<unsigned char, 20>> {
std::array<unsigned char, 20> &Value) {
if (Scalar.size() != 40)
return "Error: Incorrect scalar size for USR.";
- Value = StringToSymbol(Scalar);
+ Value = stringToSymbol(Scalar);
return StringRef();
}
- static SymbolID StringToSymbol(llvm::StringRef Value) {
+ static SymbolID stringToSymbol(llvm::StringRef Value) {
SymbolID USR;
std::string HexString = fromHex(Value);
std::copy(HexString.begin(), HexString.end(), USR.begin());
@@ -108,17 +108,17 @@ template <> struct ScalarTraits<std::array<unsigned char, 20>> {
// Helper functions to map infos to YAML.
-static void TypeInfoMapping(IO &IO, TypeInfo &I) {
+static void typeInfoMapping(IO &IO, TypeInfo &I) {
IO.mapOptional("Type", I.Type, Reference());
}
-static void FieldTypeInfoMapping(IO &IO, FieldTypeInfo &I) {
- TypeInfoMapping(IO, I);
+static void fieldTypeInfoMapping(IO &IO, FieldTypeInfo &I) {
+ typeInfoMapping(IO, I);
IO.mapOptional("Name", I.Name, SmallString<16>());
IO.mapOptional("DefaultValue", I.DefaultValue, SmallString<16>());
}
-static void InfoMapping(IO &IO, Info &I) {
+static void infoMapping(IO &IO, Info &I) {
IO.mapRequired("USR", I.USR);
IO.mapOptional("Name", I.Name, SmallString<16>());
IO.mapOptional("Path", I.Path, SmallString<128>());
@@ -126,14 +126,14 @@ static void InfoMapping(IO &IO, Info &I) {
IO.mapOptional("Description", I.Description);
}
-static void SymbolInfoMapping(IO &IO, SymbolInfo &I) {
- InfoMapping(IO, I);
+static void symbolInfoMapping(IO &IO, SymbolInfo &I) {
+ infoMapping(IO, I);
IO.mapOptional("DefLocation", I.DefLoc, std::optional<Location>());
IO.mapOptional("Location", I.Loc, llvm::SmallVector<Location, 2>());
}
-static void RecordInfoMapping(IO &IO, RecordInfo &I) {
- SymbolInfoMapping(IO, I);
+static void recordInfoMapping(IO &IO, RecordInfo &I) {
+ symbolInfoMapping(IO, I);
IO.mapOptional("TagType", I.TagType);
IO.mapOptional("IsTypeDef", I.IsTypeDef, false);
IO.mapOptional("Members", I.Members);
@@ -148,7 +148,7 @@ static void RecordInfoMapping(IO &IO, RecordInfo &I) {
IO.mapOptional("Template", I.Template);
}
-static void CommentInfoMapping(IO &IO, CommentInfo &I) {
+static void commentInfoMapping(IO &IO, CommentInfo &I) {
IO.mapOptional("Kind", I.Kind, SmallString<16>());
IO.mapOptional("Text", I.Text, SmallString<64>());
IO.mapOptional("Name", I.Name, SmallString<16>());
@@ -185,12 +185,12 @@ template <> struct MappingTraits<Reference> {
};
template <> struct MappingTraits<TypeInfo> {
- static void mapping(IO &IO, TypeInfo &I) { TypeInfoMapping(IO, I); }
+ static void mapping(IO &IO, TypeInfo &I) { typeInfoMapping(IO, I); }
};
template <> struct MappingTraits<FieldTypeInfo> {
static void mapping(IO &IO, FieldTypeInfo &I) {
- TypeInfoMapping(IO, I);
+ typeInfoMapping(IO, I);
IO.mapOptional("Name", I.Name, SmallString<16>());
IO.mapOptional("DefaultValue", I.DefaultValue, SmallString<16>());
}
@@ -198,7 +198,7 @@ template <> struct MappingTraits<FieldTypeInfo> {
template <> struct MappingTraits<MemberTypeInfo> {
static void mapping(IO &IO, MemberTypeInfo &I) {
- FieldTypeInfoMapping(IO, I);
+ fieldTypeInfoMapping(IO, I);
// clang::AccessSpecifier::AS_none is used as the default here because it's
// the AS that shouldn't be part of the output. Even though AS_public is the
// default in the struct, it should be displayed in the YAML output.
@@ -209,7 +209,7 @@ template <> struct MappingTraits<MemberTypeInfo> {
template <> struct MappingTraits<NamespaceInfo> {
static void mapping(IO &IO, NamespaceInfo &I) {
- InfoMapping(IO, I);
+ infoMapping(IO, I);
IO.mapOptional("ChildNamespaces", I.Children.Namespaces,
std::vector<Reference>());
IO.mapOptional("ChildRecords", I.Children.Records,
@@ -221,12 +221,12 @@ template <> struct MappingTraits<NamespaceInfo> {
};
template <> struct MappingTraits<RecordInfo> {
- static void mapping(IO &IO, RecordInfo &I) { RecordInfoMapping(IO, I); }
+ static void mapping(IO &IO, RecordInfo &I) { recordInfoMapping(IO, I); }
};
template <> struct MappingTraits<BaseRecordInfo> {
static void mapping(IO &IO, BaseRecordInfo &I) {
- RecordInfoMapping(IO, I);
+ recordInfoMapping(IO, I);
IO.mapOptional("IsVirtual", I.IsVirtual, false);
// clang::AccessSpecifier::AS_none is used as the default here because it's
// the AS that shouldn't be part of the output. Even though AS_public is the
@@ -246,7 +246,7 @@ template <> struct MappingTraits<EnumValueInfo> {
template <> struct MappingTraits<EnumInfo> {
static void mapping(IO &IO, EnumInfo &I) {
- SymbolInfoMapping(IO, I);
+ symbolInfoMapping(IO, I);
IO.mapOptional("Scoped", I.Scoped, false);
IO.mapOptional("BaseType", I.BaseType);
IO.mapOptional("Members", I.Members);
@@ -255,7 +255,7 @@ template <> struct MappingTraits<EnumInfo> {
template <> struct MappingTraits<TypedefInfo> {
static void mapping(IO &IO, TypedefInfo &I) {
- SymbolInfoMapping(IO, I);
+ symbolInfoMapping(IO, I);
IO.mapOptional("Underlying", I.Underlying.Type);
IO.mapOptional("IsUsing", I.IsUsing, false);
}
@@ -263,7 +263,7 @@ template <> struct MappingTraits<TypedefInfo> {
template <> struct MappingTraits<FunctionInfo> {
static void mapping(IO &IO, FunctionInfo &I) {
- SymbolInfoMapping(IO, I);
+ symbolInfoMapping(IO, I);
IO.mapOptional("IsMethod", I.IsMethod, false);
IO.mapOptional("Parent", I.Parent, Reference());
IO.mapOptional("Params", I.Params);
@@ -298,13 +298,13 @@ template <> struct MappingTraits<TemplateInfo> {
};
template <> struct MappingTraits<CommentInfo> {
- static void mapping(IO &IO, CommentInfo &I) { CommentInfoMapping(IO, I); }
+ static void mapping(IO &IO, CommentInfo &I) { commentInfoMapping(IO, I); }
};
template <> struct MappingTraits<std::unique_ptr<CommentInfo>> {
static void mapping(IO &IO, std::unique_ptr<CommentInfo> &I) {
if (I)
- CommentInfoMapping(IO, *I);
+ commentInfoMapping(IO, *I);
}
};
More information about the cfe-commits
mailing list