[llvm] r272843 - [Codeview] Add a class for LF_UDT_MOD_SRC_LINE.
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 15 14:34:57 PDT 2016
On Wed, Jun 15, 2016 at 2:25 PM, Rui Ueyama via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: ruiu
> Date: Wed Jun 15 16:25:29 2016
> New Revision: 272843
>
> URL: http://llvm.org/viewvc/llvm-project?rev=272843&view=rev
> Log:
> [Codeview] Add a class for LF_UDT_MOD_SRC_LINE.
>
> Differential Revision: http://reviews.llvm.org/D21406
>
> Modified:
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecords.def
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h
> llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp
> llvm/trunk/lib/DebugInfo/CodeView/TypeRecord.cpp
> llvm/trunk/lib/DebugInfo/CodeView/TypeTableBuilder.cpp
> llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h?rev=272843&r1=272842&r2=272843&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h Wed Jun 15
> 16:25:29 2016
> @@ -767,6 +767,44 @@ private:
> uint32_t LineNumber;
> };
>
> +// LF_UDT_MOD_SRC_LINE
> +class UdtModSourceLineRecord : public TypeRecord {
> +public:
> + UdtModSourceLineRecord(TypeIndex UDT, TypeIndex SourceFile,
> + uint32_t LineNumber, uint16_t Module)
> + : TypeRecord(TypeRecordKind::UdtSourceLine), UDT(UDT),
> + SourceFile(SourceFile), LineNumber(LineNumber), Module(Module) {}
> +
> + bool remapTypeIndices(ArrayRef<TypeIndex> IndexMap);
> +
> + static ErrorOr<UdtModSourceLineRecord> deserialize(TypeRecordKind Kind,
> + ArrayRef<uint8_t>
> &Data) {
> + const Layout *L = nullptr;
> + CV_DESERIALIZE(Data, L);
> +
> + return UdtModSourceLineRecord(L->UDT, L->SourceFile, L->LineNumber,
> + L->Module);
> + }
> +
> + TypeIndex getUDT() const { return UDT; }
> + TypeIndex getSourceFile() const { return SourceFile; }
> + uint32_t getLineNumber() const { return LineNumber; }
> + uint16_t getModule() const { return Module; }
> +
> +private:
> + struct Layout {
> + TypeIndex UDT; // The user-defined type
> + TypeIndex SourceFile; // StringID containing the source filename
> + ulittle32_t LineNumber;
> + ulittle16_t Module; // Module that contributes this UDT definition
> + };
> +
> + TypeIndex UDT;
> + TypeIndex SourceFile;
> + uint32_t LineNumber;
> + uint16_t Module;
> +};
> +
> // LF_BUILDINFO
> class BuildInfoRecord : public TypeRecord {
> public:
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecords.def
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecords.def?rev=272843&r1=272842&r2=272843&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecords.def (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecords.def Wed Jun 15
> 16:25:29 2016
> @@ -81,6 +81,7 @@ TYPE_RECORD(LF_BUILDINFO, 0x1603, BuildI
> TYPE_RECORD_ALIAS(LF_SUBSTR_LIST, 0x1604, StringList, ArgList)
> TYPE_RECORD(LF_STRING_ID, 0x1605, StringId)
> TYPE_RECORD(LF_UDT_SRC_LINE, 0x1606, UdtSourceLine)
> +TYPE_RECORD(LF_UDT_MOD_SRC_LINE, 0x1607, UdtModSourceLine)
>
> TYPE_RECORD(LF_METHODLIST, 0x1206, MethodOverloadList)
>
> @@ -194,10 +195,6 @@ CV_TYPE(LF_MODIFIER_EX, 0x1518)
> CV_TYPE(LF_VECTOR, 0x151b)
> CV_TYPE(LF_MATRIX, 0x151c)
>
> -// ID leaf records. Subsequent leaf types may be referenced from .debug$S.
> -
> -CV_TYPE(LF_UDT_MOD_SRC_LINE, 0x1607)
> -
> // Numeric leaf types. These are generally contained in other records,
> and not
> // encountered in the main type stream.
>
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h?rev=272843&r1=272842&r2=272843&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h Wed Jun
> 15 16:25:29 2016
> @@ -51,6 +51,7 @@ public:
> TypeIndex writeStringId(const StringIdRecord &Record);
> TypeIndex writeVFTable(const VFTableRecord &Record);
> TypeIndex writeUdtSourceLine(const UdtSourceLineRecord &Record);
> + TypeIndex writeUdtModSourceLine(const UdtModSourceLineRecord &Record);
> TypeIndex writeFuncId(const FuncIdRecord &Record);
> TypeIndex writeMemberFuncId(const MemberFuncIdRecord &Record);
> TypeIndex writeBuildInfo(const BuildInfoRecord &Record);
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp?rev=272843&r1=272842&r2=272843&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp Wed Jun 15 16:25:29
> 2016
> @@ -514,6 +514,14 @@ void CVTypeDumperImpl::visitUdtSourceLin
> W.printNumber("LineNumber", Line.getLineNumber());
> }
>
> +void CVTypeDumperImpl::visitUdtModSourceLine(TypeLeafKind Leaf,
> + UdtModSourceLineRecord
> &Line) {
> + printTypeIndex("UDT", Line.getUDT());
> + printTypeIndex("SourceFile", Line.getSourceFile());
>
Er, isn't this going to be an offset into the string table? I doubt it is
actually a type index.
> + W.printNumber("LineNumber", Line.getLineNumber());
> + W.printNumber("Module", Line.getModule());
> +}
> +
> void CVTypeDumperImpl::visitBuildInfo(TypeLeafKind Leaf,
> BuildInfoRecord &Args) {
> W.printNumber("NumArgs", static_cast<uint32_t>(Args.getArgs().size()));
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/TypeRecord.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/TypeRecord.cpp?rev=272843&r1=272842&r2=272843&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/CodeView/TypeRecord.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/TypeRecord.cpp Wed Jun 15 16:25:29
> 2016
> @@ -491,6 +491,13 @@ bool UdtSourceLineRecord::remapTypeIndic
> return Success;
> }
>
> +bool UdtModSourceLineRecord::remapTypeIndices(ArrayRef<TypeIndex>
> IndexMap) {
> + bool Success = true;
> + Success &= remapIndex(IndexMap, UDT);
> + Success &= remapIndex(IndexMap, SourceFile);
> + return Success;
> +}
> +
> bool BuildInfoRecord::remapTypeIndices(ArrayRef<TypeIndex> IndexMap) {
> bool Success = true;
> for (TypeIndex &Arg : ArgIndices)
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/TypeTableBuilder.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/TypeTableBuilder.cpp?rev=272843&r1=272842&r2=272843&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/CodeView/TypeTableBuilder.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/TypeTableBuilder.cpp Wed Jun 15
> 16:25:29 2016
> @@ -226,7 +226,16 @@ TypeTableBuilder::writeUdtSourceLine(con
> }
>
> TypeIndex
> -TypeTableBuilder::writeFuncId(const FuncIdRecord &Record) {
> +TypeTableBuilder::writeUdtModSourceLine(const UdtModSourceLineRecord
> &Record) {
> + TypeRecordBuilder Builder(Record.getKind());
> + Builder.writeTypeIndex(Record.getUDT());
> + Builder.writeTypeIndex(Record.getSourceFile());
> + Builder.writeUInt32(Record.getLineNumber());
> + Builder.writeUInt16(Record.getModule());
> + return writeRecord(Builder);
> +}
> +
> +TypeIndex TypeTableBuilder::writeFuncId(const FuncIdRecord &Record) {
> TypeRecordBuilder Builder(Record.getKind());
> Builder.writeTypeIndex(Record.getParentScope());
> Builder.writeTypeIndex(Record.getFunctionType());
>
> Modified: llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test?rev=272843&r1=272842&r2=272843&view=diff
>
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test (original)
> +++ llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test Wed Jun 15 16:25:29
> 2016
> @@ -153,72 +153,72 @@
> ; EMPTY-NEXT: Record count: 15
> ; EMPTY-NEXT: Records [
> ; EMPTY-NEXT: {
> -; EMPTY-NEXT: UnknownLeaf (0x104B) {
> +; EMPTY-NEXT: UdtModSourceLine (0x104B) {
> ; EMPTY-NEXT: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: UnknownType {
> -; EMPTY-NEXT: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: Length: 16
> -; EMPTY-NEXT: }
> +; EMPTY-NEXT: UDT: __vc_attributes::threadingAttribute (0x100B)
> +; EMPTY-NEXT: SourceFile: <unknown simple type> (0x1)
> +; EMPTY-NEXT: LineNumber: 481
> +; EMPTY-NEXT: Module: 1
> ; EMPTY-NEXT: }
> ; EMPTY-NEXT: Bytes (
> ; EMPTY-NEXT: 0000: 0B100000 01000000 E1010000 0100F2F1
> |................|
> ; EMPTY-NEXT: )
> ; EMPTY-NEXT: }
> ; EMPTY-NEXT: {
> -; EMPTY-NEXT: UnknownLeaf (0x104C) {
> +; EMPTY-NEXT: UdtModSourceLine (0x104C) {
> ; EMPTY-NEXT: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: UnknownType {
> -; EMPTY-NEXT: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: Length: 16
> -; EMPTY-NEXT: }
> +; EMPTY-NEXT: UDT: __vc_attributes::event_receiverAttribute
> (0x1017)
> +; EMPTY-NEXT: SourceFile: <unknown simple type> (0x1)
> +; EMPTY-NEXT: LineNumber: 194
> +; EMPTY-NEXT: Module: 1
> ; EMPTY-NEXT: }
> ; EMPTY-NEXT: Bytes (
> ; EMPTY-NEXT: 0000: 17100000 01000000 C2000000 0100F2F1
> |................|
> ; EMPTY-NEXT: )
> ; EMPTY-NEXT: }
> ; EMPTY-NEXT: {
> -; EMPTY-NEXT: UnknownLeaf (0x104D) {
> +; EMPTY-NEXT: UdtModSourceLine (0x104D) {
> ; EMPTY-NEXT: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: UnknownType {
> -; EMPTY-NEXT: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: Length: 16
> -; EMPTY-NEXT: }
> +; EMPTY-NEXT: UDT: __vc_attributes::aggregatableAttribute
> (0x1021)
> +; EMPTY-NEXT: SourceFile: <unknown simple type> (0x1)
> +; EMPTY-NEXT: LineNumber: 603
> +; EMPTY-NEXT: Module: 1
> ; EMPTY-NEXT: }
> ; EMPTY-NEXT: Bytes (
> ; EMPTY-NEXT: 0000: 21100000 01000000 5B020000 0100F2F1
> |!.......[.......|
> ; EMPTY-NEXT: )
> ; EMPTY-NEXT: }
> ; EMPTY-NEXT: {
> -; EMPTY-NEXT: UnknownLeaf (0x104E) {
> +; EMPTY-NEXT: UdtModSourceLine (0x104E) {
> ; EMPTY-NEXT: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: UnknownType {
> -; EMPTY-NEXT: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: Length: 16
> -; EMPTY-NEXT: }
> +; EMPTY-NEXT: UDT: __vc_attributes::event_sourceAttribute
> (0x102C)
> +; EMPTY-NEXT: SourceFile: <unknown simple type> (0x1)
> +; EMPTY-NEXT: LineNumber: 1200
> +; EMPTY-NEXT: Module: 1
> ; EMPTY-NEXT: }
> ; EMPTY-NEXT: Bytes (
> ; EMPTY-NEXT: 0000: 2C100000 01000000 B0040000 0100F2F1
> |,...............|
> ; EMPTY-NEXT: )
> ; EMPTY-NEXT: }
> ; EMPTY-NEXT: {
> -; EMPTY-NEXT: UnknownLeaf (0x104F) {
> +; EMPTY-NEXT: UdtModSourceLine (0x104F) {
> ; EMPTY-NEXT: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: UnknownType {
> -; EMPTY-NEXT: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: Length: 16
> -; EMPTY-NEXT: }
> +; EMPTY-NEXT: UDT: __vc_attributes::moduleAttribute (0x103A)
> +; EMPTY-NEXT: SourceFile: <unknown simple type> (0x1)
> +; EMPTY-NEXT: LineNumber: 540
> +; EMPTY-NEXT: Module: 1
> ; EMPTY-NEXT: }
> ; EMPTY-NEXT: Bytes (
> ; EMPTY-NEXT: 0000: 3A100000 01000000 1C020000 0100F2F1
> |:...............|
> ; EMPTY-NEXT: )
> ; EMPTY-NEXT: }
> ; EMPTY-NEXT: {
> -; EMPTY-NEXT: UnknownLeaf (0x1050) {
> +; EMPTY-NEXT: UdtModSourceLine (0x1050) {
> ; EMPTY-NEXT: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: UnknownType {
> -; EMPTY-NEXT: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; EMPTY-NEXT: Length: 16
> -; EMPTY-NEXT: }
> +; EMPTY-NEXT: UDT:
> __vc_attributes::helper_attributes::usageAttribute (0x1042)
> +; EMPTY-NEXT: SourceFile: <unknown simple type> (0x1)
> +; EMPTY-NEXT: LineNumber: 108
> +; EMPTY-NEXT: Module: 1
> ; EMPTY-NEXT: }
> ; EMPTY-NEXT: Bytes (
> ; EMPTY-NEXT: 0000: 42100000 01000000 6C000000 0100F2F1
> |B.......l.......|
> @@ -1003,66 +1003,66 @@
> ; ALL: Record count: 15
> ; ALL: Records [
> ; ALL: {
> -; ALL: UnknownLeaf (0x104B) {
> +; ALL: UdtModSourceLine (0x104B) {
> ; ALL: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: UnknownType {
> -; ALL: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: Length: 16
> -; ALL: }
> +; ALL: UDT: __vc_attributes::threadingAttribute (0x100B)
> +; ALL: SourceFile: <unknown simple type> (0x1)
> +; ALL: LineNumber: 481
> +; ALL: Module: 1
> ; ALL: }
> ; ALL: }
> ; ALL: {
> -; ALL: UnknownLeaf (0x104C) {
> +; ALL: UdtModSourceLine (0x104C) {
> ; ALL: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: UnknownType {
> -; ALL: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: Length: 16
> -; ALL: }
> +; ALL: UDT: __vc_attributes::event_receiverAttribute (0x1017)
> +; ALL: SourceFile: <unknown simple type> (0x1)
> +; ALL: LineNumber: 194
> +; ALL: Module: 1
> ; ALL: }
> ; ALL: }
> ; ALL: {
> -; ALL: UnknownLeaf (0x104D) {
> +; ALL: UdtModSourceLine (0x104D) {
> ; ALL: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: UnknownType {
> -; ALL: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: Length: 16
> -; ALL: }
> +; ALL: UDT: __vc_attributes::aggregatableAttribute (0x1021)
> +; ALL: SourceFile: <unknown simple type> (0x1)
> +; ALL: LineNumber: 603
> +; ALL: Module: 1
> ; ALL: }
> ; ALL: }
> ; ALL: {
> -; ALL: UnknownLeaf (0x104E) {
> +; ALL: UdtModSourceLine (0x104E) {
> ; ALL: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: UnknownType {
> -; ALL: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: Length: 16
> -; ALL: }
> +; ALL: UDT: __vc_attributes::event_sourceAttribute (0x102C)
> +; ALL: SourceFile: <unknown simple type> (0x1)
> +; ALL: LineNumber: 1200
> +; ALL: Module: 1
> ; ALL: }
> ; ALL: }
> ; ALL: {
> -; ALL: UnknownLeaf (0x104F) {
> +; ALL: UdtModSourceLine (0x104F) {
> ; ALL: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: UnknownType {
> -; ALL: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: Length: 16
> -; ALL: }
> +; ALL: UDT: __vc_attributes::moduleAttribute (0x103A)
> +; ALL: SourceFile: <unknown simple type> (0x1)
> +; ALL: LineNumber: 540
> +; ALL: Module: 1
> ; ALL: }
> ; ALL: }
> ; ALL: {
> -; ALL: UnknownLeaf (0x1050) {
> +; ALL: UdtModSourceLine (0x1050) {
> ; ALL: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: UnknownType {
> -; ALL: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: Length: 16
> -; ALL: }
> +; ALL: UDT: __vc_attributes::helper_attributes::usageAttribute
> (0x1042)
> +; ALL: SourceFile: <unknown simple type> (0x1)
> +; ALL: LineNumber: 108
> +; ALL: Module: 1
> ; ALL: }
> ; ALL: }
> ; ALL: {
> -; ALL: UnknownLeaf (0x1051) {
> +; ALL: UdtModSourceLine (0x1051) {
> ; ALL: TypeLeafKind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: UnknownType {
> -; ALL: Kind: LF_UDT_MOD_SRC_LINE (0x1607)
> -; ALL: Length: 16
> -; ALL: }
> +; ALL: UDT:
> __vc_attributes::helper_attributes::v1_alttypeAttribute (0x104A)
> +; ALL: SourceFile: <unknown simple type> (0x1)
> +; ALL: LineNumber: 96
> +; ALL: Module: 1
> ; ALL: }
> ; ALL: }
> ; ALL: {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160615/05fea849/attachment-0001.html>
More information about the llvm-commits
mailing list