Index: include/llvm/DebugInfo/CodeView/CVTypeVisitor.h =================================================================== --- include/llvm/DebugInfo/CodeView/CVTypeVisitor.h +++ include/llvm/DebugInfo/CodeView/CVTypeVisitor.h @@ -43,10 +43,10 @@ /// FIXME: Make the visitor interpret the trailing bytes so that clients don't /// need to. #define TYPE_RECORD(EnumName, EnumVal, Name) \ - void visit##Name(TypeLeafKind LeafType, Name##Record &Record) {} + void visit##Name(Name##Record &Record) {} #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) #define MEMBER_RECORD(EnumName, EnumVal, Name) \ - void visit##Name(TypeLeafKind LeafType, Name##Record &Record) {} + void visit##Name(Name##Record &Record) {} #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) #include "TypeRecords.def" @@ -68,7 +68,7 @@ auto Result = Name##Record::deserialize(RK, LeafData); \ if (Result.getError()) \ return parseError(); \ - DerivedThis->visit##Name(Record.Type, *Result); \ + DerivedThis->visit##Name(*Result); \ break; \ } #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) \ @@ -133,7 +133,7 @@ auto Result = Name##Record::deserialize(RK, FieldData); \ if (Result.getError()) \ return parseError(); \ - DerivedThis->visit##Name(Leaf, *Result); \ + DerivedThis->visit##Name(*Result); \ break; \ } #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) \ Index: lib/DebugInfo/CodeView/TypeDumper.cpp =================================================================== --- lib/DebugInfo/CodeView/TypeDumper.cpp +++ lib/DebugInfo/CodeView/TypeDumper.cpp @@ -201,10 +201,10 @@ /// CVTypeVisitor overrides. #define TYPE_RECORD(EnumName, EnumVal, Name) \ - void visit##Name(TypeLeafKind LeafType, Name##Record &Record); + void visit##Name(Name##Record &Record); #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) #define MEMBER_RECORD(EnumName, EnumVal, Name) \ - void visit##Name(TypeLeafKind LeafType, Name##Record &Record); + void visit##Name(Name##Record &Record); #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) #include "llvm/DebugInfo/CodeView/TypeRecords.def" @@ -274,15 +274,14 @@ W.startLine() << "}\n"; } -void CVTypeDumperImpl::visitStringId(TypeLeafKind Leaf, - StringIdRecord &String) { +void CVTypeDumperImpl::visitStringId(StringIdRecord &String) { printTypeIndex("Id", String.getId()); W.printString("StringData", String.getString()); // Put this in CVUDTNames so it gets printed with LF_UDT_SRC_LINE. Name = String.getString(); } -void CVTypeDumperImpl::visitArgList(TypeLeafKind Leaf, ArgListRecord &Args) { +void CVTypeDumperImpl::visitArgList(ArgListRecord &Args) { auto Indices = Args.getIndices(); uint32_t Size = Indices.size(); W.printNumber("NumArgs", Size); @@ -299,7 +298,7 @@ Name = CVTD.saveName(TypeName); } -void CVTypeDumperImpl::visitClass(TypeLeafKind Leaf, ClassRecord &Class) { +void CVTypeDumperImpl::visitClass(ClassRecord &Class) { uint16_t Props = static_cast(Class.getOptions()); W.printNumber("MemberCount", Class.getMemberCount()); W.printFlags("Properties", Props, makeArrayRef(ClassOptionNames)); @@ -313,7 +312,7 @@ Name = Class.getName(); } -void CVTypeDumperImpl::visitUnion(TypeLeafKind Leaf, UnionRecord &Union) { +void CVTypeDumperImpl::visitUnion(UnionRecord &Union) { uint16_t Props = static_cast(Union.getOptions()); W.printNumber("MemberCount", Union.getMemberCount()); W.printFlags("Properties", Props, makeArrayRef(ClassOptionNames)); @@ -325,7 +324,7 @@ Name = Union.getName(); } -void CVTypeDumperImpl::visitEnum(TypeLeafKind Leaf, EnumRecord &Enum) { +void CVTypeDumperImpl::visitEnum(EnumRecord &Enum) { W.printNumber("NumEnumerators", Enum.getMemberCount()); W.printFlags("Properties", uint16_t(Enum.getOptions()), makeArrayRef(ClassOptionNames)); @@ -335,7 +334,7 @@ Name = Enum.getName(); } -void CVTypeDumperImpl::visitArray(TypeLeafKind Leaf, ArrayRecord &AT) { +void CVTypeDumperImpl::visitArray(ArrayRecord &AT) { printTypeIndex("ElementType", AT.getElementType()); printTypeIndex("IndexType", AT.getIndexType()); W.printNumber("SizeOf", AT.getSize()); @@ -343,7 +342,7 @@ Name = AT.getName(); } -void CVTypeDumperImpl::visitVFTable(TypeLeafKind Leaf, VFTableRecord &VFT) { +void CVTypeDumperImpl::visitVFTable(VFTableRecord &VFT) { printTypeIndex("CompleteClass", VFT.getCompleteClass()); printTypeIndex("OverriddenVFTable", VFT.getOverriddenVTable()); W.printHex("VFPtrOffset", VFT.getVFPtrOffset()); @@ -353,16 +352,14 @@ Name = VFT.getName(); } -void CVTypeDumperImpl::visitMemberFuncId(TypeLeafKind Leaf, - MemberFuncIdRecord &Id) { +void CVTypeDumperImpl::visitMemberFuncId(MemberFuncIdRecord &Id) { printTypeIndex("ClassType", Id.getClassType()); printTypeIndex("FunctionType", Id.getFunctionType()); W.printString("Name", Id.getName()); Name = Id.getName(); } -void CVTypeDumperImpl::visitProcedure(TypeLeafKind Leaf, - ProcedureRecord &Proc) { +void CVTypeDumperImpl::visitProcedure(ProcedureRecord &Proc) { printTypeIndex("ReturnType", Proc.getReturnType()); W.printEnum("CallingConvention", uint8_t(Proc.getCallConv()), makeArrayRef(CallingConventions)); @@ -379,8 +376,7 @@ Name = CVTD.saveName(TypeName); } -void CVTypeDumperImpl::visitMemberFunction(TypeLeafKind Leaf, - MemberFunctionRecord &MF) { +void CVTypeDumperImpl::visitMemberFunction(MemberFunctionRecord &MF) { printTypeIndex("ReturnType", MF.getReturnType()); printTypeIndex("ClassType", MF.getClassType()); printTypeIndex("ThisType", MF.getThisType()); @@ -404,7 +400,7 @@ } void CVTypeDumperImpl::visitMethodOverloadList( - TypeLeafKind Leaf, MethodOverloadListRecord &MethodList) { + MethodOverloadListRecord &MethodList) { for (auto &M : MethodList.getMethods()) { ListScope S(W, "Method"); printMemberAttributes(M.getAccess(), M.getKind(), M.getOptions()); @@ -414,22 +410,21 @@ } } -void CVTypeDumperImpl::visitFuncId(TypeLeafKind Leaf, FuncIdRecord &Func) { +void CVTypeDumperImpl::visitFuncId(FuncIdRecord &Func) { printTypeIndex("ParentScope", Func.getParentScope()); printTypeIndex("FunctionType", Func.getFunctionType()); W.printString("Name", Func.getName()); Name = Func.getName(); } -void CVTypeDumperImpl::visitTypeServer2(TypeLeafKind Leaf, - TypeServer2Record &TS) { +void CVTypeDumperImpl::visitTypeServer2(TypeServer2Record &TS) { W.printBinary("Signature", TS.getGuid()); W.printNumber("Age", TS.getAge()); W.printString("Name", TS.getName()); Name = TS.getName(); } -void CVTypeDumperImpl::visitPointer(TypeLeafKind Leaf, PointerRecord &Ptr) { +void CVTypeDumperImpl::visitPointer(PointerRecord &Ptr) { printTypeIndex("PointeeType", Ptr.getReferentType()); W.printHex("PointerAttributes", uint32_t(Ptr.getOptions())); W.printEnum("PtrType", unsigned(Ptr.getPointerKind()), @@ -478,7 +473,7 @@ } } -void CVTypeDumperImpl::visitModifier(TypeLeafKind Leaf, ModifierRecord &Mod) { +void CVTypeDumperImpl::visitModifier(ModifierRecord &Mod) { uint16_t Mods = static_cast(Mod.getModifiers()); printTypeIndex("ModifiedType", Mod.getModifiedType()); W.printFlags("Modifiers", Mods, makeArrayRef(TypeModifierNames)); @@ -495,35 +490,30 @@ Name = CVTD.saveName(TypeName); } -void CVTypeDumperImpl::visitBitField(TypeLeafKind Leaf, - BitFieldRecord &BitField) { +void CVTypeDumperImpl::visitBitField(BitFieldRecord &BitField) { printTypeIndex("Type", BitField.getType()); W.printNumber("BitSize", BitField.getBitSize()); W.printNumber("BitOffset", BitField.getBitOffset()); } -void CVTypeDumperImpl::visitVFTableShape(TypeLeafKind Leaf, - VFTableShapeRecord &Shape) { +void CVTypeDumperImpl::visitVFTableShape(VFTableShapeRecord &Shape) { W.printNumber("VFEntryCount", Shape.getEntryCount()); } -void CVTypeDumperImpl::visitUdtSourceLine(TypeLeafKind Leaf, - UdtSourceLineRecord &Line) { +void CVTypeDumperImpl::visitUdtSourceLine(UdtSourceLineRecord &Line) { printTypeIndex("UDT", Line.getUDT()); printTypeIndex("SourceFile", Line.getSourceFile()); W.printNumber("LineNumber", Line.getLineNumber()); } -void CVTypeDumperImpl::visitUdtModSourceLine(TypeLeafKind Leaf, - UdtModSourceLineRecord &Line) { +void CVTypeDumperImpl::visitUdtModSourceLine(UdtModSourceLineRecord &Line) { printTypeIndex("UDT", Line.getUDT()); printTypeIndex("SourceFile", Line.getSourceFile()); W.printNumber("LineNumber", Line.getLineNumber()); W.printNumber("Module", Line.getModule()); } -void CVTypeDumperImpl::visitBuildInfo(TypeLeafKind Leaf, - BuildInfoRecord &Args) { +void CVTypeDumperImpl::visitBuildInfo(BuildInfoRecord &Args) { W.printNumber("NumArgs", static_cast(Args.getArgs().size())); ListScope Arguments(W, "Arguments"); @@ -562,16 +552,14 @@ W.printNumber("Length", uint32_t(RecordData.size())); } -void CVTypeDumperImpl::visitNestedType(TypeLeafKind Leaf, - NestedTypeRecord &Nested) { +void CVTypeDumperImpl::visitNestedType(NestedTypeRecord &Nested) { DictScope S(W, "NestedType"); printTypeIndex("Type", Nested.getNestedType()); W.printString("Name", Nested.getName()); Name = Nested.getName(); } -void CVTypeDumperImpl::visitOneMethod(TypeLeafKind Leaf, - OneMethodRecord &Method) { +void CVTypeDumperImpl::visitOneMethod(OneMethodRecord &Method) { DictScope S(W, "OneMethod"); MethodKind K = Method.getKind(); printMemberAttributes(Method.getAccess(), K, Method.getOptions()); @@ -583,8 +571,7 @@ Name = Method.getName(); } -void CVTypeDumperImpl::visitOverloadedMethod(TypeLeafKind Leaf, - OverloadedMethodRecord &Method) { +void CVTypeDumperImpl::visitOverloadedMethod(OverloadedMethodRecord &Method) { DictScope S(W, "OverloadedMethod"); W.printHex("MethodCount", Method.getNumOverloads()); printTypeIndex("MethodListIndex", Method.getMethodList()); @@ -592,8 +579,7 @@ Name = Method.getName(); } -void CVTypeDumperImpl::visitDataMember(TypeLeafKind Leaf, - DataMemberRecord &Field) { +void CVTypeDumperImpl::visitDataMember(DataMemberRecord &Field) { DictScope S(W, "DataMember"); printMemberAttributes(Field.getAccess(), MethodKind::Vanilla, MethodOptions::None); @@ -603,8 +589,7 @@ Name = Field.getName(); } -void CVTypeDumperImpl::visitStaticDataMember(TypeLeafKind Leaf, - StaticDataMemberRecord &Field) { +void CVTypeDumperImpl::visitStaticDataMember(StaticDataMemberRecord &Field) { DictScope S(W, "StaticDataMember"); printMemberAttributes(Field.getAccess(), MethodKind::Vanilla, MethodOptions::None); @@ -613,13 +598,12 @@ Name = Field.getName(); } -void CVTypeDumperImpl::visitVFPtr(TypeLeafKind Leaf, VFPtrRecord &VFTable) { +void CVTypeDumperImpl::visitVFPtr(VFPtrRecord &VFTable) { DictScope S(W, "VFPtr"); printTypeIndex("Type", VFTable.getType()); } -void CVTypeDumperImpl::visitEnumerator(TypeLeafKind Leaf, - EnumeratorRecord &Enum) { +void CVTypeDumperImpl::visitEnumerator(EnumeratorRecord &Enum) { DictScope S(W, "Enumerator"); printMemberAttributes(Enum.getAccess(), MethodKind::Vanilla, MethodOptions::None); @@ -628,8 +612,7 @@ Name = Enum.getName(); } -void CVTypeDumperImpl::visitBaseClass(TypeLeafKind Leaf, - BaseClassRecord &Base) { +void CVTypeDumperImpl::visitBaseClass(BaseClassRecord &Base) { DictScope S(W, "BaseClass"); printMemberAttributes(Base.getAccess(), MethodKind::Vanilla, MethodOptions::None); @@ -637,8 +620,7 @@ W.printHex("BaseOffset", Base.getBaseOffset()); } -void CVTypeDumperImpl::visitVirtualBaseClass(TypeLeafKind Leaf, - VirtualBaseClassRecord &Base) { +void CVTypeDumperImpl::visitVirtualBaseClass(VirtualBaseClassRecord &Base) { DictScope S(W, "VirtualBaseClass"); printMemberAttributes(Base.getAccess(), MethodKind::Vanilla, MethodOptions::None); Index: lib/DebugInfo/CodeView/TypeStreamMerger.cpp =================================================================== --- lib/DebugInfo/CodeView/TypeStreamMerger.cpp +++ lib/DebugInfo/CodeView/TypeStreamMerger.cpp @@ -57,10 +57,10 @@ /// CVTypeVisitor overrides. #define TYPE_RECORD(EnumName, EnumVal, Name) \ - void visit##Name(TypeLeafKind LeafType, Name##Record &Record); + void visit##Name(Name##Record &Record); #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) #define MEMBER_RECORD(EnumName, EnumVal, Name) \ - void visit##Name(TypeLeafKind LeafType, Name##Record &Record); + void visit##Name(Name##Record &Record); #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) #include "llvm/DebugInfo/CodeView/TypeRecords.def" @@ -109,15 +109,13 @@ } #define TYPE_RECORD(EnumName, EnumVal, Name) \ - void TypeStreamMerger::visit##Name(TypeLeafKind LeafType, \ - Name##Record &Record) { \ + void TypeStreamMerger::visit##Name(Name##Record &Record) { \ FoundBadTypeIndex |= !Record.remapTypeIndices(IndexMap); \ IndexMap.push_back(DestStream.write##Name(Record)); \ } #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName) #define MEMBER_RECORD(EnumName, EnumVal, Name) \ - void TypeStreamMerger::visit##Name(TypeLeafKind LeafType, \ - Name##Record &Record) { \ + void TypeStreamMerger::visit##Name(Name##Record &Record) { \ FoundBadTypeIndex |= !Record.remapTypeIndices(IndexMap); \ FieldBuilder.write##Name(Record); \ } Index: lib/DebugInfo/PDB/Raw/TpiStream.cpp =================================================================== --- lib/DebugInfo/PDB/Raw/TpiStream.cpp +++ lib/DebugInfo/PDB/Raw/TpiStream.cpp @@ -90,19 +90,17 @@ uint32_t NumHashBuckets) : HashValues(HashValues), NumHashBuckets(NumHashBuckets) {} - void visitUdtSourceLine(TypeLeafKind, UdtSourceLineRecord &Rec) { - verifySourceLine(Rec); - } + void visitUdtSourceLine(UdtSourceLineRecord &Rec) { verifySourceLine(Rec); } - void visitUdtModSourceLine(TypeLeafKind, UdtModSourceLineRecord &Rec) { + void visitUdtModSourceLine(UdtModSourceLineRecord &Rec) { verifySourceLine(Rec); } - void visitClass(TypeLeafKind, ClassRecord &Rec) { verify(Rec); } - void visitEnum(TypeLeafKind, EnumRecord &Rec) { verify(Rec); } - void visitInterface(TypeLeafKind, ClassRecord &Rec) { verify(Rec); } - void visitStruct(TypeLeafKind, ClassRecord &Rec) { verify(Rec); } - void visitUnion(TypeLeafKind, UnionRecord &Rec) { verify(Rec); } + void visitClass(ClassRecord &Rec) { verify(Rec); } + void visitEnum(EnumRecord &Rec) { verify(Rec); } + void visitInterface(ClassRecord &Rec) { verify(Rec); } + void visitStruct(ClassRecord &Rec) { verify(Rec); } + void visitUnion(UnionRecord &Rec) { verify(Rec); } void visitTypeEnd(TypeLeafKind Leaf, ArrayRef RecordData) { ++Index;