Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clang-tools-extra/clang-doc/JSONGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ static void insertArray(Object &Obj, json::Value &Array, StringRef Key) {
static void serializeInfo(const RecordInfo &I, json::Object &Obj,
const std::optional<StringRef> &RepositoryUrl) {
serializeCommonAttributes(I, Obj, RepositoryUrl);
Obj["FullName"] = I.FullName;
Obj["TagType"] = getTagType(I.TagType);
Obj["IsTypedef"] = I.IsTypeDef;
Obj["MangledName"] = I.MangledName;
Expand Down
8 changes: 0 additions & 8 deletions clang-tools-extra/clang-doc/Representation.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,6 @@ struct FunctionInfo : public SymbolInfo {
// (AS_public = 0, AS_protected = 1, AS_private = 2, AS_none = 3)
AccessSpecifier Access = AccessSpecifier::AS_public;

// Full qualified name of this function, including namespaces and template
// specializations.
SmallString<16> FullName;

// Function Prototype
SmallString<256> Prototype;

Expand All @@ -460,10 +456,6 @@ struct RecordInfo : public SymbolInfo {
// Type of this record (struct, class, union, interface).
TagTypeKind TagType = TagTypeKind::Struct;

// Full qualified name of this record, including namespaces and template
// specializations.
SmallString<16> FullName;

// When present, this record is a template or specialization.
std::optional<TemplateInfo> Template;

Expand Down
50 changes: 0 additions & 50 deletions clang-tools-extra/clang-doc/Serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,55 +178,6 @@ static llvm::SmallString<16> getTypeAlias(const TypeAliasDecl *Alias) {
return Result;
}

// extract full syntax for record declaration
static llvm::SmallString<16> getRecordPrototype(const CXXRecordDecl *CXXRD) {
llvm::SmallString<16> Result;
LangOptions LangOpts;
PrintingPolicy Policy(LangOpts);
Policy.SuppressTagKeyword = false;
Policy.FullyQualifiedName = true;
Policy.IncludeNewlines = false;
llvm::raw_svector_ostream OS(Result);
if (const auto *TD = CXXRD->getDescribedClassTemplate()) {
OS << "template <";
bool FirstParam = true;
for (const auto *Param : *TD->getTemplateParameters()) {
if (!FirstParam)
OS << ", ";
Param->print(OS, Policy);
FirstParam = false;
}
OS << ">\n";
}

if (CXXRD->isStruct())
OS << "struct ";
else if (CXXRD->isClass())
OS << "class ";
else if (CXXRD->isUnion())
OS << "union ";

OS << CXXRD->getNameAsString();

// We need to make sure we have a good enough declaration to check. In the
// case where the class is a forward declaration, we'll fail assertions in
// DeclCXX.
if (CXXRD->isCompleteDefinition() && CXXRD->getNumBases() > 0) {
OS << " : ";
bool FirstBase = true;
for (const auto &Base : CXXRD->bases()) {
if (!FirstBase)
OS << ", ";
if (Base.isVirtual())
OS << "virtual ";
OS << getAccessSpelling(Base.getAccessSpecifier()) << " ";
OS << Base.getType().getAsString(Policy);
FirstBase = false;
}
}
return Result;
}

// A function to extract the appropriate relative path for a given info's
// documentation. The path returned is a composite of the parent namespaces.
//
Expand Down Expand Up @@ -1033,7 +984,6 @@ emitInfo(const RecordDecl *D, const FullComment *FC, Location Loc,
parseFields(*RI, D, PublicOnly);

if (const auto *C = dyn_cast<CXXRecordDecl>(D)) {
RI->FullName = getRecordPrototype(C);
if (const TypedefNameDecl *TD = C->getTypedefNameForAnonDecl()) {
RI->Name = TD->getNameAsString();
RI->IsTypeDef = true;
Expand Down
2 changes: 0 additions & 2 deletions clang-tools-extra/test/clang-doc/json/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ struct MyClass {
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ],
// COM: FIXME: FullName is not emitted correctly.
// CHECK-NEXT: "FullName": "",
// CHECK-NEXT: "HasEnums": true,
// CHECK-NEXT: "HasPublicFunctions": true,
// CHECK-NEXT: "HasPublicMembers": true,
Expand Down
4 changes: 0 additions & 4 deletions clang-tools-extra/unittests/clang-doc/JSONGeneratorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ static std::unique_ptr<Generator> getJSONGenerator() {
TEST(JSONGeneratorTest, emitRecordJSON) {
RecordInfo I;
I.Name = "Foo";
// FIXME: FullName is not emitted correctly.
I.FullName = "";
I.IsTypeDef = false;
I.Namespace.emplace_back(EmptySID, "GlobalNamespace", InfoType::IT_namespace);
I.Path = "GlobalNamespace";
Expand Down Expand Up @@ -64,7 +62,6 @@ TEST(JSONGeneratorTest, emitRecordJSON) {
{
"Access": "public",
"End": true,
"FullName": "",
"HasPublicFunctions": true,
"HasPublicMembers": true,
"InfoType": "record",
Expand Down Expand Up @@ -115,7 +112,6 @@ TEST(JSONGeneratorTest, emitRecordJSON) {
"USR": "0000000000000000000000000000000000000000"
}
],
"FullName": "",
"HasEnums": true,
"HasPublicFunctions": true,
"HasRecords": true,
Expand Down