summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-05-12 17:45:51 +0000
committerZachary Turner <zturner@google.com>2016-05-12 17:45:51 +0000
commit123a52735d44471e9bb01d74d39b3b5ce355d948 (patch)
treeabfcfb09df4839505186eb1ab74ca07bb274839d /llvm/lib/DebugInfo
parent38cc8b3f210ec8b90c85bd8a106da44439c2d651 (diff)
downloadbcm5719-llvm-123a52735d44471e9bb01d74d39b3b5ce355d948.tar.gz
bcm5719-llvm-123a52735d44471e9bb01d74d39b3b5ce355d948.zip
Get rid of CVLeafTypes.def and combine with TypeRecords.def
This merges the functionality of the macros in `CVLeafTypes.def` and the macros in `TypeRecords.def` into a single set of macros. Differential Revision: http://reviews.llvm.org/D20190 Reviewed By: rnk, amccarth llvm-svn: 269316
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/CodeView/TypeDumper.cpp43
1 files changed, 17 insertions, 26 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp b/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp
index b675d3c2c6d..6b47eae63ba 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp
@@ -65,8 +65,8 @@ static const EnumEntry<SimpleTypeKind> SimpleTypeNames[] = {
};
static const EnumEntry<TypeLeafKind> LeafTypeNames[] = {
-#define LEAF_TYPE(enum, val) { #enum, enum },
-#include "llvm/DebugInfo/CodeView/CVLeafTypes.def"
+#define CV_TYPE(enum, val) {#enum, enum},
+#include "llvm/DebugInfo/CodeView/TypeRecords.def"
};
#define ENUM_ENTRY(enum_class, enum) \
@@ -200,17 +200,14 @@ public:
: CVTD(CVTD), W(W), PrintRecordBytes(PrintRecordBytes) {}
/// CVTypeVisitor overrides.
-#define TYPE_RECORD(ClassName, LeafEnum) \
+#define TYPE_RECORD(EnumName, EnumVal, ClassName, PrintName) \
void visit##ClassName(TypeLeafKind LeafType, ClassName &Record);
-#define TYPE_RECORD_ALIAS(ClassName, LeafEnum)
-#define MEMBER_RECORD(ClassName, LeafEnum) \
+#define TYPE_RECORD_ALIAS(EnumName, EnumVal, ClassName, PrintName)
+#define MEMBER_RECORD(EnumName, EnumVal, ClassName, PrintName) \
void visit##ClassName(TypeLeafKind LeafType, ClassName &Record);
-#define MEMBER_RECORD_ALIAS(ClassName, LeafEnum)
+#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, ClassName, PrintName)
#include "llvm/DebugInfo/CodeView/TypeRecords.def"
- /// Method overload lists are a special case.
- void visitMethodList(TypeLeafKind Leaf, ArrayRef<uint8_t> LeafData);
-
void visitUnknownMember(TypeLeafKind Leaf);
void visitTypeBegin(TypeLeafKind Leaf, ArrayRef<uint8_t> LeafData);
@@ -242,9 +239,10 @@ private:
static StringRef getLeafTypeName(TypeLeafKind LT) {
switch (LT) {
-#define KNOWN_TYPE(LeafName, Value, ClassName) \
- case LeafName: return #ClassName;
-#include "llvm/DebugInfo/CodeView/CVLeafTypes.def"
+#define TYPE_RECORD(ename, value, class_name, print_name) \
+ case ename: \
+ return #print_name;
+#include "llvm/DebugInfo/CodeView/TypeRecords.def"
default:
break;
}
@@ -405,21 +403,14 @@ void CVTypeDumperImpl::visitMemberFunctionRecord(TypeLeafKind Leaf,
Name = CVTD.saveName(TypeName);
}
-void CVTypeDumperImpl::visitMethodList(TypeLeafKind Leaf,
- ArrayRef<uint8_t> LeafData) {
- while (!LeafData.empty()) {
- auto Method =
- MethodListRecord::deserialize(TypeRecordKind::MethodList, LeafData);
- if (Method)
- return;
- const MethodListRecord &M = *Method;
-
+void CVTypeDumperImpl::visitMethodOverloadListRecord(TypeLeafKind Leaf,
+ MethodOverloadListRecord &MethodList) {
+ for (auto &M : MethodList.getMethods()) {
ListScope S(W, "Method");
- printMemberAttributes(M.getAccess(), M.getMethodKind(), M.getOptions());
- printTypeIndex("Type", Method->getType());
- if (Method->getMethodKind() == MethodKind::IntroducingVirtual ||
- Method->getMethodKind() == MethodKind::PureIntroducingVirtual)
- W.printHex("VFTableOffset", Method->getVFTableOffset());
+ printMemberAttributes(M.getAccess(), M.getKind(), M.getOptions());
+ printTypeIndex("Type", M.getType());
+ if (M.isIntroducingVirtual())
+ W.printHex("VFTableOffset", M.getVFTableOffset());
}
}
OpenPOWER on IntegriCloud