[PATCH] D21406: [Codeview] Add a class for LF_UDT_MOD_SRC_LINE.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 13:35:15 PDT 2016


ruiu created this revision.
ruiu added a reviewer: zturner.
ruiu added a subscriber: llvm-commits.

I'm going to use this class for the visitor to verify
TPI hash records.

http://reviews.llvm.org/D21406

Files:
  include/llvm/DebugInfo/CodeView/TypeRecord.h

Index: include/llvm/DebugInfo/CodeView/TypeRecord.h
===================================================================
--- include/llvm/DebugInfo/CodeView/TypeRecord.h
+++ include/llvm/DebugInfo/CodeView/TypeRecord.h
@@ -946,6 +946,43 @@
   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:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21406.60898.patch
Type: text/x-patch
Size: 1623 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160615/cfef66f4/attachment.bin>


More information about the llvm-commits mailing list