Skip to content

Commit

Permalink
Revert "Emit CodeView type records for nested classes."
Browse files Browse the repository at this point in the history
This reverts commit 256b29322c827a2d94da56468c936596f5509032.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274632 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
amccarth-google committed Jul 6, 2016
1 parent 2b2f63a commit c233a9a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 127 deletions.
34 changes: 6 additions & 28 deletions lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1414,8 +1414,6 @@ struct llvm::ClassInfo {
MemberList Members;
// Direct overloaded methods gathered by name.
MethodsMap Methods;

std::vector<const DICompositeType *> NestedClasses;
};

void CodeViewDebug::clear() {
Expand Down Expand Up @@ -1468,8 +1466,8 @@ ClassInfo CodeViewDebug::collectClassInfo(const DICompositeType *Ty) {
// friends in the past, but modern versions do not.
}
// FIXME: Get Clang to emit function virtual table here and handle it.
} else if (auto *Composite = dyn_cast<DICompositeType>(Element)) {
Info.NestedClasses.push_back(Composite);
// FIXME: Get clang to emit nested types here and do something with
// them.
}
// Skip other unrecognized kinds of elements.
}
Expand Down Expand Up @@ -1498,12 +1496,7 @@ TypeIndex CodeViewDebug::lowerCompleteTypeClass(const DICompositeType *Ty) {
TypeIndex FieldTI;
TypeIndex VShapeTI;
unsigned FieldCount;
bool ContainsNestedClass;
std::tie(FieldTI, VShapeTI, FieldCount, ContainsNestedClass) =
lowerRecordFieldList(Ty);

if (ContainsNestedClass)
CO |= ClassOptions::ContainsNestedClass;
std::tie(FieldTI, VShapeTI, FieldCount) = lowerRecordFieldList(Ty);

std::string FullName = getFullyQualifiedName(Ty);

Expand Down Expand Up @@ -1539,13 +1532,7 @@ TypeIndex CodeViewDebug::lowerCompleteTypeUnion(const DICompositeType *Ty) {
ClassOptions CO = getCommonClassOptions(Ty);
TypeIndex FieldTI;
unsigned FieldCount;
bool ContainsNestedClass;
std::tie(FieldTI, std::ignore, FieldCount, ContainsNestedClass) =
lowerRecordFieldList(Ty);

if (ContainsNestedClass)
CO |= ClassOptions::ContainsNestedClass;

std::tie(FieldTI, std::ignore, FieldCount) = lowerRecordFieldList(Ty);
uint64_t SizeInBytes = Ty->getSizeInBits() / 8;
std::string FullName = getFullyQualifiedName(Ty);

Expand All @@ -1563,7 +1550,7 @@ TypeIndex CodeViewDebug::lowerCompleteTypeUnion(const DICompositeType *Ty) {
return UnionTI;
}

std::tuple<TypeIndex, TypeIndex, unsigned, bool>
std::tuple<TypeIndex, TypeIndex, unsigned>
CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) {
// Manually count members. MSVC appears to count everything that generates a
// field list record. Each individual overload in a method overload group
Expand Down Expand Up @@ -1658,17 +1645,8 @@ CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) {
OverloadedMethodRecord(Methods.size(), MethodList, Name));
}
}

// Create nested classes.
for (const DICompositeType *Nested : Info.NestedClasses) {
NestedTypeRecord R(getTypeIndex(DITypeRef(Nested)), Nested->getName());
Fields.writeNestedType(R);
MemberCount++;
}

TypeIndex FieldTI = TypeTable.writeFieldList(Fields);
return std::make_tuple(FieldTI, TypeIndex(), MemberCount,
!Info.NestedClasses.empty());
return std::make_tuple(FieldTI, TypeIndex(), MemberCount);
}

TypeIndex CodeViewDebug::getVBPTypeIndex() {
Expand Down
2 changes: 1 addition & 1 deletion lib/CodeGen/AsmPrinter/CodeViewDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase {
/// Common record member lowering functionality for record types, which are
/// structs, classes, and unions. Returns the field list index and the member
/// count.
std::tuple<codeview::TypeIndex, codeview::TypeIndex, unsigned, bool>
std::tuple<codeview::TypeIndex, codeview::TypeIndex, unsigned>
lowerRecordFieldList(const DICompositeType *Ty);

/// Inserts {{Node, ClassTy}, TI} into TypeIndices and checks for duplicates.
Expand Down
98 changes: 0 additions & 98 deletions test/DebugInfo/COFF/types-nested-class.ll

This file was deleted.

0 comments on commit c233a9a

Please sign in to comment.