[llvm] r367623 - Changes to improve CodeView debug info type record inline comments

Nilanjana Basu via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 15:05:15 PDT 2019


Author: nilanjana_basu
Date: Thu Aug  1 15:05:14 2019
New Revision: 367623

URL: http://llvm.org/viewvc/llvm-project?rev=367623&view=rev
Log:
Changes to improve CodeView debug info type record inline comments

Signed-off-by: Nilanjana Basu <nilanjana.basu87 at gmail.com>

Modified:
    llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
    llvm/trunk/include/llvm/DebugInfo/CodeView/EnumTables.h
    llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
    llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
    llvm/trunk/lib/DebugInfo/CodeView/EnumTables.cpp
    llvm/trunk/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
    llvm/trunk/test/DebugInfo/COFF/class-options-common.ll
    llvm/trunk/test/DebugInfo/COFF/types-basic.ll
    llvm/trunk/test/DebugInfo/COFF/types-data-members.ll

Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h?rev=367623&r1=367622&r2=367623&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h Thu Aug  1 15:05:14 2019
@@ -33,6 +33,9 @@ public:
   virtual void EmitIntValue(uint64_t Value, unsigned Size) = 0;
   virtual void EmitBinaryData(StringRef Data) = 0;
   virtual void AddComment(const Twine &T) = 0;
+  virtual void AddRawComment(const Twine &T) = 0;
+  virtual bool isVerboseAsm() = 0;
+  virtual StringRef getTypeName(TypeIndex TI) = 0;
   virtual ~CodeViewRecordStreamer() = default;
 };
 
@@ -206,6 +209,11 @@ public:
     return 0;
   }
 
+  void emitRawComment(const Twine &T) {
+    if (isStreaming())
+      Streamer->AddRawComment(T);
+  }
+
 private:
   void emitEncodedSignedInteger(const int64_t &Value,
                                 const Twine &Comment = "");
@@ -225,7 +233,7 @@ private:
   }
 
   void emitComment(const Twine &Comment) {
-    if (isStreaming()) {
+    if (isStreaming() && Streamer->isVerboseAsm()) {
       Twine TComment(Comment);
       if (!TComment.isTriviallyEmpty())
         Streamer->AddComment(TComment);

Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/EnumTables.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/EnumTables.h?rev=367623&r1=367622&r2=367623&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/EnumTables.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/EnumTables.h Thu Aug  1 15:05:14 2019
@@ -37,6 +37,17 @@ ArrayRef<EnumEntry<uint8_t>> getThunkOrd
 ArrayRef<EnumEntry<uint16_t>> getTrampolineNames();
 ArrayRef<EnumEntry<COFF::SectionCharacteristics>>
 getImageSectionCharacteristicNames();
+ArrayRef<EnumEntry<uint16_t>> getClassOptionNames();
+ArrayRef<EnumEntry<uint8_t>> getMemberAccessNames();
+ArrayRef<EnumEntry<uint16_t>> getMethodOptionNames();
+ArrayRef<EnumEntry<uint16_t>> getMemberKindNames();
+ArrayRef<EnumEntry<uint8_t>> getPtrKindNames();
+ArrayRef<EnumEntry<uint8_t>> getPtrModeNames();
+ArrayRef<EnumEntry<uint16_t>> getPtrMemberRepNames();
+ArrayRef<EnumEntry<uint16_t>> getTypeModifierNames();
+ArrayRef<EnumEntry<uint8_t>> getCallingConventions();
+ArrayRef<EnumEntry<uint8_t>> getFunctionOptionEnum();
+ArrayRef<EnumEntry<uint16_t>> getLabelTypeEnum();
 
 } // end namespace codeview
 } // end namespace llvm

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=367623&r1=367622&r2=367623&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp Thu Aug  1 15:05:14 2019
@@ -98,7 +98,8 @@ using namespace llvm::codeview;
 namespace {
 class CVMCAdapter : public CodeViewRecordStreamer {
 public:
-  CVMCAdapter(MCStreamer &OS) : OS(&OS) {}
+  CVMCAdapter(MCStreamer &OS, TypeCollection &TypeTable)
+      : OS(&OS), TypeTable(TypeTable) {}
 
   void EmitBytes(StringRef Data) { OS->EmitBytes(Data); }
 
@@ -110,8 +111,24 @@ public:
 
   void AddComment(const Twine &T) { OS->AddComment(T); }
 
+  void AddRawComment(const Twine &T) { OS->emitRawComment(T); }
+
+  bool isVerboseAsm() { return OS->isVerboseAsm(); }
+
+  StringRef getTypeName(TypeIndex TI) {
+    StringRef TypeName;
+    if (!TI.isNoneType()) {
+      if (TI.isSimple())
+        TypeName = TypeIndex::simpleTypeName(TI);
+      else
+        TypeName = TypeTable.getTypeName(TI);
+    }
+    return TypeName;
+  }
+
 private:
   MCStreamer *OS = nullptr;
+  TypeCollection &TypeTable;
 };
 } // namespace
 
@@ -617,13 +634,6 @@ emitNullTerminatedSymbolName(MCStreamer
   OS.EmitBytes(NullTerminatedString);
 }
 
-static StringRef getTypeLeafName(TypeLeafKind TypeKind) {
-  for (const EnumEntry<TypeLeafKind> &EE : getTypeLeafNames())
-    if (EE.Value == TypeKind)
-      return EE.Name;
-  return "";
-}
-
 void CodeViewDebug::emitTypeInformation() {
   if (TypeTable.empty())
     return;
@@ -640,11 +650,11 @@ void CodeViewDebug::emitTypeInformation(
   }
 
   TypeTableCollection Table(TypeTable.records());
+  TypeVisitorCallbackPipeline Pipeline;
   SmallString<512> CommentBlock;
   raw_svector_ostream CommentOS(CommentBlock);
   std::unique_ptr<ScopedPrinter> SP;
   std::unique_ptr<TypeDumpVisitor> TDV;
-  TypeVisitorCallbackPipeline Pipeline;
 
   if (OS.isVerboseAsm()) {
     // To construct block comment describing the type record for readability.
@@ -655,7 +665,7 @@ void CodeViewDebug::emitTypeInformation(
   }
 
   // To emit type record using Codeview MCStreamer adapter
-  CVMCAdapter CVMCOS(OS);
+  CVMCAdapter CVMCOS(OS, Table);
   TypeRecordMapping typeMapping(CVMCOS);
   Pipeline.addCallbackToPipeline(typeMapping);
 
@@ -665,16 +675,6 @@ void CodeViewDebug::emitTypeInformation(
     CVType Record = Table.getType(*B);
 
     CommentBlock.clear();
-
-    auto RecordLen = Record.length();
-    auto RecordKind = Record.kind();
-    if (OS.isVerboseAsm())
-      CVMCOS.AddComment("Record length");
-    CVMCOS.EmitIntValue(RecordLen - 2, 2);
-    if (OS.isVerboseAsm())
-      CVMCOS.AddComment("Record kind: " + getTypeLeafName(RecordKind));
-    CVMCOS.EmitIntValue(RecordKind, sizeof(RecordKind));
-
     Error E = codeview::visitTypeRecord(Record, *B, Pipeline);
 
     if (E) {

Modified: llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp?rev=367623&r1=367622&r2=367623&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp Thu Aug  1 15:05:14 2019
@@ -126,7 +126,11 @@ Error CodeViewRecordIO::mapByteVectorTai
 
 Error CodeViewRecordIO::mapInteger(TypeIndex &TypeInd, const Twine &Comment) {
   if (isStreaming()) {
-    emitComment(Comment);
+    StringRef TypeNameStr = Streamer->getTypeName(TypeInd);
+    if (!TypeNameStr.empty())
+      emitComment(Comment + ": " + TypeNameStr);
+    else
+      emitComment(Comment);
     Streamer->EmitIntValue(TypeInd.getIndex(), sizeof(TypeInd.getIndex()));
     incrStreamedLen(sizeof(TypeInd.getIndex()));
   } else if (isWriting()) {

Modified: llvm/trunk/lib/DebugInfo/CodeView/EnumTables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/EnumTables.cpp?rev=367623&r1=367622&r2=367623&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/EnumTables.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/EnumTables.cpp Thu Aug  1 15:05:14 2019
@@ -300,6 +300,128 @@ static const EnumEntry<COFF::SectionChar
         CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_READ),
         CV_ENUM_ENT(COFF, IMAGE_SCN_MEM_WRITE)};
 
+static const EnumEntry<uint16_t> ClassOptionNames[] = {
+    CV_ENUM_CLASS_ENT(ClassOptions, Packed),
+    CV_ENUM_CLASS_ENT(ClassOptions, HasConstructorOrDestructor),
+    CV_ENUM_CLASS_ENT(ClassOptions, HasOverloadedOperator),
+    CV_ENUM_CLASS_ENT(ClassOptions, Nested),
+    CV_ENUM_CLASS_ENT(ClassOptions, ContainsNestedClass),
+    CV_ENUM_CLASS_ENT(ClassOptions, HasOverloadedAssignmentOperator),
+    CV_ENUM_CLASS_ENT(ClassOptions, HasConversionOperator),
+    CV_ENUM_CLASS_ENT(ClassOptions, ForwardReference),
+    CV_ENUM_CLASS_ENT(ClassOptions, Scoped),
+    CV_ENUM_CLASS_ENT(ClassOptions, HasUniqueName),
+    CV_ENUM_CLASS_ENT(ClassOptions, Sealed),
+    CV_ENUM_CLASS_ENT(ClassOptions, Intrinsic),
+};
+
+static const EnumEntry<uint8_t> MemberAccessNames[] = {
+    CV_ENUM_CLASS_ENT(MemberAccess, None),
+    CV_ENUM_CLASS_ENT(MemberAccess, Private),
+    CV_ENUM_CLASS_ENT(MemberAccess, Protected),
+    CV_ENUM_CLASS_ENT(MemberAccess, Public),
+};
+
+static const EnumEntry<uint16_t> MethodOptionNames[] = {
+    CV_ENUM_CLASS_ENT(MethodOptions, Pseudo),
+    CV_ENUM_CLASS_ENT(MethodOptions, NoInherit),
+    CV_ENUM_CLASS_ENT(MethodOptions, NoConstruct),
+    CV_ENUM_CLASS_ENT(MethodOptions, CompilerGenerated),
+    CV_ENUM_CLASS_ENT(MethodOptions, Sealed),
+};
+
+static const EnumEntry<uint16_t> MemberKindNames[] = {
+    CV_ENUM_CLASS_ENT(MethodKind, Vanilla),
+    CV_ENUM_CLASS_ENT(MethodKind, Virtual),
+    CV_ENUM_CLASS_ENT(MethodKind, Static),
+    CV_ENUM_CLASS_ENT(MethodKind, Friend),
+    CV_ENUM_CLASS_ENT(MethodKind, IntroducingVirtual),
+    CV_ENUM_CLASS_ENT(MethodKind, PureVirtual),
+    CV_ENUM_CLASS_ENT(MethodKind, PureIntroducingVirtual),
+};
+
+static const EnumEntry<uint8_t> PtrKindNames[] = {
+    CV_ENUM_CLASS_ENT(PointerKind, Near16),
+    CV_ENUM_CLASS_ENT(PointerKind, Far16),
+    CV_ENUM_CLASS_ENT(PointerKind, Huge16),
+    CV_ENUM_CLASS_ENT(PointerKind, BasedOnSegment),
+    CV_ENUM_CLASS_ENT(PointerKind, BasedOnValue),
+    CV_ENUM_CLASS_ENT(PointerKind, BasedOnSegmentValue),
+    CV_ENUM_CLASS_ENT(PointerKind, BasedOnAddress),
+    CV_ENUM_CLASS_ENT(PointerKind, BasedOnSegmentAddress),
+    CV_ENUM_CLASS_ENT(PointerKind, BasedOnType),
+    CV_ENUM_CLASS_ENT(PointerKind, BasedOnSelf),
+    CV_ENUM_CLASS_ENT(PointerKind, Near32),
+    CV_ENUM_CLASS_ENT(PointerKind, Far32),
+    CV_ENUM_CLASS_ENT(PointerKind, Near64),
+};
+
+static const EnumEntry<uint8_t> PtrModeNames[] = {
+    CV_ENUM_CLASS_ENT(PointerMode, Pointer),
+    CV_ENUM_CLASS_ENT(PointerMode, LValueReference),
+    CV_ENUM_CLASS_ENT(PointerMode, PointerToDataMember),
+    CV_ENUM_CLASS_ENT(PointerMode, PointerToMemberFunction),
+    CV_ENUM_CLASS_ENT(PointerMode, RValueReference),
+};
+
+static const EnumEntry<uint16_t> PtrMemberRepNames[] = {
+    CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, Unknown),
+    CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, SingleInheritanceData),
+    CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, MultipleInheritanceData),
+    CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, VirtualInheritanceData),
+    CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, GeneralData),
+    CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, SingleInheritanceFunction),
+    CV_ENUM_CLASS_ENT(PointerToMemberRepresentation,
+                      MultipleInheritanceFunction),
+    CV_ENUM_CLASS_ENT(PointerToMemberRepresentation,
+                      VirtualInheritanceFunction),
+    CV_ENUM_CLASS_ENT(PointerToMemberRepresentation, GeneralFunction),
+};
+
+static const EnumEntry<uint16_t> TypeModifierNames[] = {
+    CV_ENUM_CLASS_ENT(ModifierOptions, Const),
+    CV_ENUM_CLASS_ENT(ModifierOptions, Volatile),
+    CV_ENUM_CLASS_ENT(ModifierOptions, Unaligned),
+};
+
+static const EnumEntry<uint8_t> CallingConventions[] = {
+    CV_ENUM_CLASS_ENT(CallingConvention, NearC),
+    CV_ENUM_CLASS_ENT(CallingConvention, FarC),
+    CV_ENUM_CLASS_ENT(CallingConvention, NearPascal),
+    CV_ENUM_CLASS_ENT(CallingConvention, FarPascal),
+    CV_ENUM_CLASS_ENT(CallingConvention, NearFast),
+    CV_ENUM_CLASS_ENT(CallingConvention, FarFast),
+    CV_ENUM_CLASS_ENT(CallingConvention, NearStdCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, FarStdCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, NearSysCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, FarSysCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, ThisCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, MipsCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, Generic),
+    CV_ENUM_CLASS_ENT(CallingConvention, AlphaCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, PpcCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, SHCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, ArmCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, AM33Call),
+    CV_ENUM_CLASS_ENT(CallingConvention, TriCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, SH5Call),
+    CV_ENUM_CLASS_ENT(CallingConvention, M32RCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, ClrCall),
+    CV_ENUM_CLASS_ENT(CallingConvention, Inline),
+    CV_ENUM_CLASS_ENT(CallingConvention, NearVector),
+};
+
+static const EnumEntry<uint8_t> FunctionOptionEnum[] = {
+    CV_ENUM_CLASS_ENT(FunctionOptions, CxxReturnUdt),
+    CV_ENUM_CLASS_ENT(FunctionOptions, Constructor),
+    CV_ENUM_CLASS_ENT(FunctionOptions, ConstructorWithVirtualBases),
+};
+
+static const EnumEntry<uint16_t> LabelTypeEnum[] = {
+    CV_ENUM_CLASS_ENT(LabelType, Near),
+    CV_ENUM_CLASS_ENT(LabelType, Far),
+};
+
 namespace llvm {
 namespace codeview {
 
@@ -379,5 +501,49 @@ getImageSectionCharacteristicNames() {
   return makeArrayRef(ImageSectionCharacteristicNames);
 }
 
+ArrayRef<EnumEntry<uint16_t>> getClassOptionNames() {
+  return makeArrayRef(ClassOptionNames);
+}
+
+ArrayRef<EnumEntry<uint8_t>> getMemberAccessNames() {
+  return makeArrayRef(MemberAccessNames);
+}
+
+ArrayRef<EnumEntry<uint16_t>> getMethodOptionNames() {
+  return makeArrayRef(MethodOptionNames);
+}
+
+ArrayRef<EnumEntry<uint16_t>> getMemberKindNames() {
+  return makeArrayRef(MemberKindNames);
+}
+
+ArrayRef<EnumEntry<uint8_t>> getPtrKindNames() {
+  return makeArrayRef(PtrKindNames);
+}
+
+ArrayRef<EnumEntry<uint8_t>> getPtrModeNames() {
+  return makeArrayRef(PtrModeNames);
+}
+
+ArrayRef<EnumEntry<uint16_t>> getPtrMemberRepNames() {
+  return makeArrayRef(PtrMemberRepNames);
+}
+
+ArrayRef<EnumEntry<uint16_t>> getTypeModifierNames() {
+  return makeArrayRef(TypeModifierNames);
+}
+
+ArrayRef<EnumEntry<uint8_t>> getCallingConventions() {
+  return makeArrayRef(CallingConventions);
+}
+
+ArrayRef<EnumEntry<uint8_t>> getFunctionOptionEnum() {
+  return makeArrayRef(FunctionOptionEnum);
+}
+
+ArrayRef<EnumEntry<uint16_t>> getLabelTypeEnum() {
+  return makeArrayRef(LabelTypeEnum);
+}
+
 } // end namespace codeview
 } // end namespace llvm

Modified: llvm/trunk/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/TypeRecordMapping.cpp?rev=367623&r1=367622&r2=367623&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/TypeRecordMapping.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/TypeRecordMapping.cpp Thu Aug  1 15:05:14 2019
@@ -7,24 +7,124 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/DebugInfo/CodeView/TypeRecordMapping.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/DebugInfo/CodeView/EnumTables.h"
 
 using namespace llvm;
 using namespace llvm::codeview;
 
+namespace {
+
 #define error(X)                                                               \
   if (auto EC = X)                                                             \
     return EC;
 
-namespace {
+static const EnumEntry<TypeLeafKind> LeafTypeNames[] = {
+#define CV_TYPE(enum, val) {#enum, enum},
+#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
+};
+
+static StringRef getLeafTypeName(TypeLeafKind LT) {
+  switch (LT) {
+#define TYPE_RECORD(ename, value, name)                                        \
+  case ename:                                                                  \
+    return #name;
+#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
+  default:
+    break;
+  }
+  return "UnknownLeaf";
+}
+
+template <typename T>
+static bool compEnumNames(const EnumEntry<T> &lhs, const EnumEntry<T> &rhs) {
+  return lhs.Name < rhs.Name;
+}
+
+template <typename T, typename TFlag>
+static StringRef getFlagNames(CodeViewRecordIO &IO, T Value,
+                              ArrayRef<EnumEntry<TFlag>> Flags) {
+  if (!IO.isStreaming())
+    return "";
+  typedef EnumEntry<TFlag> FlagEntry;
+  typedef SmallVector<FlagEntry, 10> FlagVector;
+  FlagVector SetFlags;
+  for (const auto &Flag : Flags) {
+    if (Flag.Value == 0)
+      continue;
+    if ((Value & Flag.Value) == Flag.Value) {
+      SetFlags.push_back(Flag);
+    }
+  }
+
+  llvm::sort(SetFlags, &compEnumNames<TFlag>);
+
+  SmallString<128> FlagLabel;
+  bool FirstOcc = true;
+  for (const auto &Flag : SetFlags) {
+    if (FirstOcc)
+      FirstOcc = false;
+    else
+      FlagLabel += (" | ");
+
+    FlagLabel += (Flag.Name + " (0x" + utohexstr(Flag.Value) + ")").str();
+  }
+
+  if (!FlagLabel.empty()) {
+    SmallString<128> LabelWithBraces(" ( ");
+    LabelWithBraces += (FlagLabel + " )").str();
+    return LabelWithBraces.str();
+  } else
+    return FlagLabel.str();
+}
+
+template <typename T, typename TEnum>
+static StringRef getEnumName(CodeViewRecordIO &IO, T Value,
+                             ArrayRef<EnumEntry<TEnum>> EnumValues) {
+  if (!IO.isStreaming())
+    return "";
+  StringRef Name;
+  for (const auto &EnumItem : EnumValues) {
+    if (EnumItem.Value == Value) {
+      Name = EnumItem.Name;
+      break;
+    }
+  }
+
+  return Name;
+}
+
+static StringRef getMemberAttributes(CodeViewRecordIO &IO, MemberAccess Access,
+                                     MethodKind Kind, MethodOptions Options) {
+  if (!IO.isStreaming())
+    return "";
+  SmallString<256> AccessSpecifier =
+      getEnumName(IO, uint8_t(Access), makeArrayRef(getMemberAccessNames()));
+  SmallString<256> MemberAttrs(AccessSpecifier);
+  if (Kind != MethodKind::Vanilla) {
+    SmallString<256> MethodKind =
+        getEnumName(IO, unsigned(Kind), makeArrayRef(getMemberKindNames()));
+    MemberAttrs += (", " + MethodKind).str();
+  }
+  if (Options != MethodOptions::None) {
+    SmallString<256> MethodOptions = getFlagNames(
+        IO, unsigned(Options), makeArrayRef(getMethodOptionNames()));
+    MemberAttrs += (", " + MethodOptions).str();
+  }
+  return MemberAttrs.str();
+}
+
 struct MapOneMethodRecord {
   explicit MapOneMethodRecord(bool IsFromOverloadList)
       : IsFromOverloadList(IsFromOverloadList) {}
 
   Error operator()(CodeViewRecordIO &IO, OneMethodRecord &Method) const {
-    error(IO.mapInteger(Method.Attrs.Attrs, "AccessSpecifier"));
+    StringRef Attrs = getMemberAttributes(
+        IO, Method.getAccess(), Method.getMethodKind(), Method.getOptions());
+    error(IO.mapInteger(Method.Attrs.Attrs, "Attrs: " + Attrs));
     if (IsFromOverloadList) {
       uint16_t Padding = 0;
-      error(IO.mapInteger(Padding, "Padding"));
+      error(IO.mapInteger(Padding));
     }
     error(IO.mapInteger(Method.Type, "Type"));
     if (Method.isIntroducingVirtual()) {
@@ -41,7 +141,7 @@ struct MapOneMethodRecord {
 private:
   bool IsFromOverloadList;
 };
-}
+} // namespace
 
 static Error mapNameAndUniqueName(CodeViewRecordIO &IO, StringRef &Name,
                                   StringRef &UniqueName, bool HasUniqueName) {
@@ -83,18 +183,6 @@ static Error mapNameAndUniqueName(CodeVi
   return Error::success();
 }
 
-static StringRef getLeafTypeName(TypeLeafKind LT) {
-  switch (LT) {
-#define TYPE_RECORD(ename, value, name)                                        \
-  case ename:                                                                  \
-    return #ename;
-#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
-  default:
-    break;
-  }
-  return "UnknownLeaf";
-}
-
 Error TypeRecordMapping::visitTypeBegin(CVType &CVR) {
   assert(!TypeKind.hasValue() && "Already in a type mapping!");
   assert(!MemberKind.hasValue() && "Already in a member mapping!");
@@ -108,10 +196,22 @@ Error TypeRecordMapping::visitTypeBegin(
     MaxLen = MaxRecordLength - sizeof(RecordPrefix);
   error(IO.beginRecord(MaxLen));
   TypeKind = CVR.kind();
+
+  if (IO.isStreaming()) {
+    auto RecordKind = CVR.kind();
+    uint16_t RecordLen = CVR.length() - 2;
+    SmallString<128> RecordKindName =
+        getEnumName(IO, unsigned(RecordKind), makeArrayRef(LeafTypeNames));
+    error(IO.mapInteger(RecordLen, "Record length"));
+    error(IO.mapEnum(RecordKind, "Record kind: " + RecordKindName));
+  }
   return Error::success();
 }
 
 Error TypeRecordMapping::visitTypeBegin(CVType &CVR, TypeIndex Index) {
+  if (IO.isStreaming())
+    IO.emitRawComment(" " + getLeafTypeName(CVR.kind()) + " (0x" +
+                      utohexstr(Index.getIndex()) + ")");
   return visitTypeBegin(CVR);
 }
 
@@ -140,8 +240,13 @@ Error TypeRecordMapping::visitMemberBegi
 
   MemberKind = Record.Kind;
   if (IO.isStreaming()) {
-    error(IO.mapEnum(Record.Kind,
-                     "Member kind: " + getLeafTypeName(Record.Kind)));
+    SmallString<128> MemberKindName = getLeafTypeName(Record.Kind);
+    MemberKindName +=
+        (" ( " +
+         getEnumName(IO, unsigned(Record.Kind), makeArrayRef(LeafTypeNames)) +
+         " )")
+            .str();
+    error(IO.mapEnum(Record.Kind, "Member kind: " + MemberKindName));
   }
   return Error::success();
 }
@@ -161,16 +266,24 @@ Error TypeRecordMapping::visitMemberEnd(
 }
 
 Error TypeRecordMapping::visitKnownRecord(CVType &CVR, ModifierRecord &Record) {
+  SmallString<256> ModifierNames =
+      getFlagNames(IO, static_cast<uint16_t>(Record.Modifiers),
+                   makeArrayRef(getTypeModifierNames()));
   error(IO.mapInteger(Record.ModifiedType, "ModifiedType"));
-  error(IO.mapEnum(Record.Modifiers, "Modifiers"));
+  error(IO.mapEnum(Record.Modifiers, "Modifiers" + ModifierNames));
   return Error::success();
 }
 
 Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
                                           ProcedureRecord &Record) {
+  SmallString<256> CallingConvName = getEnumName(
+      IO, uint8_t(Record.CallConv), makeArrayRef(getCallingConventions()));
+  SmallString<256> FuncOptionNames =
+      getFlagNames(IO, static_cast<uint16_t>(Record.Options),
+                   makeArrayRef(getFunctionOptionEnum()));
   error(IO.mapInteger(Record.ReturnType, "ReturnType"));
-  error(IO.mapEnum(Record.CallConv, "CallingConvention"));
-  error(IO.mapEnum(Record.Options, "FunctionOptions"));
+  error(IO.mapEnum(Record.CallConv, "CallingConvention: " + CallingConvName));
+  error(IO.mapEnum(Record.Options, "FunctionOptions" + FuncOptionNames));
   error(IO.mapInteger(Record.ParameterCount, "NumParameters"));
   error(IO.mapInteger(Record.ArgumentList, "ArgListType"));
 
@@ -179,11 +292,16 @@ Error TypeRecordMapping::visitKnownRecor
 
 Error TypeRecordMapping::visitKnownRecord(CVType &CVR,
                                           MemberFunctionRecord &Record) {
+  SmallString<256> CallingConvName = getEnumName(
+      IO, uint8_t(Record.CallConv), makeArrayRef(getCallingConventions()));
+  SmallString<256> FuncOptionNames =
+      getFlagNames(IO, static_cast<uint16_t>(Record.Options),
+                   makeArrayRef(getFunctionOptionEnum()));
   error(IO.mapInteger(Record.ReturnType, "ReturnType"));
   error(IO.mapInteger(Record.ClassType, "ClassType"));
   error(IO.mapInteger(Record.ThisType, "ThisType"));
-  error(IO.mapEnum(Record.CallConv, "CallingConvention"));
-  error(IO.mapEnum(Record.Options, "FunctionOptions"));
+  error(IO.mapEnum(Record.CallConv, "CallingConvention: " + CallingConvName));
+  error(IO.mapEnum(Record.Options, "FunctionOptions" + FuncOptionNames));
   error(IO.mapInteger(Record.ParameterCount, "NumParameters"));
   error(IO.mapInteger(Record.ArgumentList, "ArgListType"));
   error(IO.mapInteger(Record.ThisPointerAdjustment, "ThisAdjustment"));
@@ -214,8 +332,40 @@ Error TypeRecordMapping::visitKnownRecor
 }
 
 Error TypeRecordMapping::visitKnownRecord(CVType &CVR, PointerRecord &Record) {
+
+  SmallString<128> Attr("Attrs: ");
+
+  if (IO.isStreaming()) {
+    SmallString<128> PtrType = getEnumName(
+        IO, unsigned(Record.getPointerKind()), makeArrayRef(getPtrKindNames()));
+    Attr += ("[ Type: " + PtrType).str();
+
+    SmallString<128> PtrMode = getEnumName(IO, unsigned(Record.getMode()),
+                                           makeArrayRef(getPtrModeNames()));
+    Attr += (", Mode: " + PtrMode).str();
+
+    auto PtrSizeOf = Record.getSize();
+    Attr += ", SizeOf: " + itostr(PtrSizeOf);
+
+    if (auto PtrIsFlat = Record.isFlat())
+      Attr += ", isFlat";
+    if (auto PtrIsConst = Record.isConst())
+      Attr += ", isConst";
+    if (auto PtrIsVolatile = Record.isVolatile())
+      Attr += ", isVolatile";
+    if (auto PtrIsUnaligned = Record.isUnaligned())
+      Attr += ", isUnaligned";
+    if (auto PtrIsRestrict = Record.isRestrict())
+      Attr += ", isRestricted";
+    if (auto PtrIsLValueReferenceThisPtr = Record.isLValueReferenceThisPtr())
+      Attr += ", isThisPtr&";
+    if (auto PtrIsRValueReferenceThisPtr = Record.isRValueReferenceThisPtr())
+      Attr += ", isThisPtr&&";
+    Attr += " ]";
+  }
+
   error(IO.mapInteger(Record.ReferentType, "PointeeType"));
-  error(IO.mapInteger(Record.Attrs, "Attributes"));
+  error(IO.mapInteger(Record.Attrs, Attr));
 
   if (Record.isPointerToMember()) {
     if (IO.isReading())
@@ -223,7 +373,10 @@ Error TypeRecordMapping::visitKnownRecor
 
     MemberPointerInfo &M = *Record.MemberInfo;
     error(IO.mapInteger(M.ContainingType, "ClassType"));
-    error(IO.mapEnum(M.Representation, "Representation"));
+    SmallString<256> PtrMemberGetRepresentation = getEnumName(
+        IO, uint16_t(M.Representation), makeArrayRef(getPtrMemberRepNames()));
+    error(IO.mapEnum(M.Representation,
+                     "Representation: " + PtrMemberGetRepresentation));
   }
 
   return Error::success();
@@ -243,8 +396,11 @@ Error TypeRecordMapping::visitKnownRecor
          (CVR.kind() == TypeLeafKind::LF_CLASS) ||
          (CVR.kind() == TypeLeafKind::LF_INTERFACE));
 
+  SmallString<256> PropertiesNames =
+      getFlagNames(IO, static_cast<uint16_t>(Record.Options),
+                   makeArrayRef(getClassOptionNames()));
   error(IO.mapInteger(Record.MemberCount, "MemberCount"));
-  error(IO.mapEnum(Record.Options, "Properties"));
+  error(IO.mapEnum(Record.Options, "Properties" + PropertiesNames));
   error(IO.mapInteger(Record.FieldList, "FieldList"));
   error(IO.mapInteger(Record.DerivationList, "DerivedFrom"));
   error(IO.mapInteger(Record.VTableShape, "VShape"));
@@ -256,8 +412,11 @@ Error TypeRecordMapping::visitKnownRecor
 }
 
 Error TypeRecordMapping::visitKnownRecord(CVType &CVR, UnionRecord &Record) {
+  SmallString<256> PropertiesNames =
+      getFlagNames(IO, static_cast<uint16_t>(Record.Options),
+                   makeArrayRef(getClassOptionNames()));
   error(IO.mapInteger(Record.MemberCount, "MemberCount"));
-  error(IO.mapEnum(Record.Options, "Properties"));
+  error(IO.mapEnum(Record.Options, "Properties" + PropertiesNames));
   error(IO.mapInteger(Record.FieldList, "FieldList"));
   error(IO.mapEncodedInteger(Record.Size, "SizeOf"));
   error(mapNameAndUniqueName(IO, Record.Name, Record.UniqueName,
@@ -267,8 +426,11 @@ Error TypeRecordMapping::visitKnownRecor
 }
 
 Error TypeRecordMapping::visitKnownRecord(CVType &CVR, EnumRecord &Record) {
+  SmallString<256> PropertiesNames =
+      getFlagNames(IO, static_cast<uint16_t>(Record.Options),
+                   makeArrayRef(getClassOptionNames()));
   error(IO.mapInteger(Record.MemberCount, "NumEnumerators"));
-  error(IO.mapEnum(Record.Options, "Properties"));
+  error(IO.mapEnum(Record.Options, "Properties" + PropertiesNames));
   error(IO.mapInteger(Record.UnderlyingType, "UnderlyingType"));
   error(IO.mapInteger(Record.FieldList, "FieldListType"));
   error(mapNameAndUniqueName(IO, Record.Name, Record.UniqueName,
@@ -418,13 +580,17 @@ Error TypeRecordMapping::visitKnownRecor
 }
 
 Error TypeRecordMapping::visitKnownRecord(CVType &CVR, LabelRecord &Record) {
-  error(IO.mapEnum(Record.Mode, "Mode"));
+  SmallString<256> ModeName =
+      getEnumName(IO, uint16_t(Record.Mode), makeArrayRef(getLabelTypeEnum()));
+  error(IO.mapEnum(Record.Mode, "Mode: " + ModeName));
   return Error::success();
 }
 
 Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
                                           BaseClassRecord &Record) {
-  error(IO.mapInteger(Record.Attrs.Attrs, "AccessSpecifier"));
+  StringRef Attrs = getMemberAttributes(
+      IO, Record.getAccess(), MethodKind::Vanilla, MethodOptions::None);
+  error(IO.mapInteger(Record.Attrs.Attrs, "Attrs: " + Attrs));
   error(IO.mapInteger(Record.Type, "BaseType"));
   error(IO.mapEncodedInteger(Record.Offset, "BaseOffset"));
 
@@ -433,7 +599,9 @@ Error TypeRecordMapping::visitKnownMembe
 
 Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
                                           EnumeratorRecord &Record) {
-  error(IO.mapInteger(Record.Attrs.Attrs));
+  StringRef Attrs = getMemberAttributes(
+      IO, Record.getAccess(), MethodKind::Vanilla, MethodOptions::None);
+  error(IO.mapInteger(Record.Attrs.Attrs, "Attrs: " + Attrs));
 
   // FIXME: Handle full APInt such as __int128.
   error(IO.mapEncodedInteger(Record.Value, "EnumValue"));
@@ -444,7 +612,9 @@ Error TypeRecordMapping::visitKnownMembe
 
 Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
                                           DataMemberRecord &Record) {
-  error(IO.mapInteger(Record.Attrs.Attrs, "AccessSpecifier"));
+  StringRef Attrs = getMemberAttributes(
+      IO, Record.getAccess(), MethodKind::Vanilla, MethodOptions::None);
+  error(IO.mapInteger(Record.Attrs.Attrs, "Attrs: " + Attrs));
   error(IO.mapInteger(Record.Type, "Type"));
   error(IO.mapEncodedInteger(Record.FieldOffset, "FieldOffset"));
   error(IO.mapStringZ(Record.Name, "Name"));
@@ -481,7 +651,9 @@ Error TypeRecordMapping::visitKnownMembe
 Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
                                           StaticDataMemberRecord &Record) {
 
-  error(IO.mapInteger(Record.Attrs.Attrs, "AccessSpecifier"));
+  StringRef Attrs = getMemberAttributes(
+      IO, Record.getAccess(), MethodKind::Vanilla, MethodOptions::None);
+  error(IO.mapInteger(Record.Attrs.Attrs, "Attrs: " + Attrs));
   error(IO.mapInteger(Record.Type, "Type"));
   error(IO.mapStringZ(Record.Name, "Name"));
 
@@ -491,7 +663,9 @@ Error TypeRecordMapping::visitKnownMembe
 Error TypeRecordMapping::visitKnownMember(CVMemberRecord &CVR,
                                           VirtualBaseClassRecord &Record) {
 
-  error(IO.mapInteger(Record.Attrs.Attrs, "AccessSpecifier"));
+  StringRef Attrs = getMemberAttributes(
+      IO, Record.getAccess(), MethodKind::Vanilla, MethodOptions::None);
+  error(IO.mapInteger(Record.Attrs.Attrs, "Attrs: " + Attrs));
   error(IO.mapInteger(Record.BaseType, "BaseType"));
   error(IO.mapInteger(Record.VBPtrType, "VBPtrType"));
   error(IO.mapEncodedInteger(Record.VBPtrOffset, "VBPtrOffset"));

Modified: llvm/trunk/test/DebugInfo/COFF/class-options-common.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/class-options-common.ll?rev=367623&r1=367622&r2=367623&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/class-options-common.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/class-options-common.ll Thu Aug  1 15:05:14 2019
@@ -1,5 +1,6 @@
 ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s
 ; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s
+; RUN: llc < %s | FileCheck %s --check-prefix=ASM-INLINE-COMMENTS
 ;
 ; Command to generate function-options.ll
 ; $ clang++ class-options-common.cpp -S -emit-llvm -g -gcodeview -o class-options-common.ll
@@ -651,6 +652,28 @@
 ; CHECK:   }
 ; CHECK: ]
 
+; ASM-INLINE-COMMENTS: # MethodOverloadList (0x1088)
+; ASM-INLINE-COMMENTS: .short	0x12                    # Record length
+; ASM-INLINE-COMMENTS: .short	0x1206                  # Record kind: LF_METHODLIST
+; ASM-INLINE-COMMENTS: .short	0x3                     # Method
+; ASM-INLINE-COMMENTS:                                       # Attrs: Public
+; ASM-INLINE-COMMENTS: .short	0x0
+; ASM-INLINE-COMMENTS: .long	0x1083                  # Type: void Foo::()
+; ASM-INLINE-COMMENTS: .short	0x3                     # Attrs: Public
+; ASM-INLINE-COMMENTS: .short	0x0
+; ASM-INLINE-COMMENTS: .long	0x1087                  # Type: void Foo::(const Foo&)
+; ASM-INLINE-COMMENTS: # MethodOverloadList (0x1088) {
+; ASM-INLINE-COMMENTS: #   TypeLeafKind: LF_METHODLIST (0x1206)
+; ASM-INLINE-COMMENTS: #   Method [
+; ASM-INLINE-COMMENTS: #     AccessSpecifier: Public (0x3)
+; ASM-INLINE-COMMENTS: #     Type: void Foo::() (0x1083)
+; ASM-INLINE-COMMENTS: #   ]
+; ASM-INLINE-COMMENTS: #   Method [
+; ASM-INLINE-COMMENTS: #     AccessSpecifier: Public (0x3)
+; ASM-INLINE-COMMENTS: #     Type: void Foo::(const Foo&) (0x1087)
+; ASM-INLINE-COMMENTS: #   ]
+; ASM-INLINE-COMMENTS: # }
+
 
 ; ModuleID = 'class-options-common.cpp'
 source_filename = "class-options.cpp"

Modified: llvm/trunk/test/DebugInfo/COFF/types-basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/types-basic.ll?rev=367623&r1=367622&r2=367623&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/types-basic.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/types-basic.ll Thu Aug  1 15:05:14 2019
@@ -350,12 +350,13 @@
 ; ASM: .section	.debug$T,"dr"
 ; ASM: .p2align	2
 ; ASM: .long	4                       # Debug section magic
+; ASM: # ArgList (0x1000)
 ; ASM: .short	0x12                    # Record length
 ; ASM: .short	0x1201                  # Record kind: LF_ARGLIST
 ; ASM: .long	0x3                     # NumArgs
-; ASM: .long	0x40                    # Argument
-; ASM: .long	0x41                    # Argument
-; ASM: .long	0x13                    # Argument
+; ASM: .long	0x40                    # Argument: float
+; ASM: .long	0x41                    # Argument: double
+; ASM: .long	0x13                    # Argument: __int64
 ; ASM: # ArgList (0x1000) {
 ; ASM: #   TypeLeafKind: LF_ARGLIST (0x1201)
 ; ASM: #   NumArgs: 3
@@ -365,13 +366,14 @@
 ; ASM: #     ArgType: __int64 (0x13)
 ; ASM: #   ]
 ; ASM: # }
+; ASM: # Procedure (0x1001)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1008                  # Record kind: LF_PROCEDURE
-; ASM: .long	0x3                     # ReturnType
-; ASM: .byte	0x0                     # CallingConvention
+; ASM: .long	0x3                     # ReturnType: void
+; ASM: .byte	0x0                     # CallingConvention: NearC
 ; ASM: .byte	0x0                     # FunctionOptions
 ; ASM: .short	0x3                     # NumParameters
-; ASM: .long	0x1000                  # ArgListType
+; ASM: .long	0x1000                  # ArgListType: (float, double, __int64)
 ; ASM: # Procedure (0x1001) {
 ; ASM: #   TypeLeafKind: LF_PROCEDURE (0x1008)
 ; ASM: #   ReturnType: void (0x3)
@@ -381,10 +383,11 @@
 ; ASM: #   NumParameters: 3
 ; ASM: #   ArgListType: (float, double, __int64) (0x1000)
 ; ASM: # }
+; ASM: # FuncId (0x1002)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1601                  # Record kind: LF_FUNC_ID
 ; ASM: .long	0x0                     # ParentScope
-; ASM: .long	0x1001                  # FunctionType
+; ASM: .long	0x1001                  # FunctionType: void (float, double, __int64)
 ; ASM: .asciz	"f"                     # Name
 ; ASM: .byte	242
 ; ASM: .byte	241
@@ -394,10 +397,11 @@
 ; ASM: #   FunctionType: void (float, double, __int64) (0x1001)
 ; ASM: #   Name: f
 ; ASM: # }
+; ASM: # Modifier (0x1003)
 ; ASM: .short	0xa                     # Record length
 ; ASM: .short	0x1001                  # Record kind: LF_MODIFIER
-; ASM: .long	0x74                    # ModifiedType
-; ASM: .short	0x1                     # Modifiers
+; ASM: .long	0x74                    # ModifiedType: int
+; ASM: .short	0x1                     # Modifiers ( Const (0x1) )
 ; ASM: .byte	242
 ; ASM: .byte	241
 ; ASM: # Modifier (0x1003) {
@@ -407,10 +411,11 @@
 ; ASM: #     Const (0x1)
 ; ASM: #   ]
 ; ASM: # }
+; ASM: # Pointer (0x1004)
 ; ASM: .short	0xa                     # Record length
 ; ASM: .short	0x1002                  # Record kind: LF_POINTER
-; ASM: .long	0x1003                  # PointeeType
-; ASM: .long	0x1000c                 # Attributes
+; ASM: .long	0x1003                  # PointeeType: const int
+; ASM: .long	0x1000c                 # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8 ]
 ; ASM: # Pointer (0x1004) {
 ; ASM: #   TypeLeafKind: LF_POINTER (0x1002)
 ; ASM: #   PointeeType: const int (0x1003)
@@ -425,10 +430,11 @@
 ; ASM: #   IsThisPtr&&: 0
 ; ASM: #   SizeOf: 8
 ; ASM: # }
+; ASM: # Struct (0x1005)
 ; ASM: .short	0x16                    # Record length
 ; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
 ; ASM: .short	0x0                     # MemberCount
-; ASM: .short	0x80                    # Properties
+; ASM: .short	0x80                    # Properties ( ForwardReference (0x80) )
 ; ASM: .long	0x0                     # FieldList
 ; ASM: .long	0x0                     # DerivedFrom
 ; ASM: .long	0x0                     # VShape
@@ -446,12 +452,13 @@
 ; ASM: #   SizeOf: 0
 ; ASM: #   Name: A
 ; ASM: # }
+; ASM: # Pointer (0x1006)
 ; ASM: .short	0x12                    # Record length
 ; ASM: .short	0x1002                  # Record kind: LF_POINTER
-; ASM: .long	0x74                    # PointeeType
-; ASM: .long	0x804c                  # Attributes
-; ASM: .long	0x1005                  # ClassType
-; ASM: .short	0x4                     # Representation
+; ASM: .long	0x74                    # PointeeType: int
+; ASM: .long	0x804c                  # Attrs: [ Type: Near64, Mode: PointerToDataMember, SizeOf: 4 ]
+; ASM: .long	0x1005                  # ClassType: A
+; ASM: .short	0x4                     # Representation: GeneralData
 ; ASM: .byte	242
 ; ASM: .byte	241
 ; ASM: # Pointer (0x1006) {
@@ -470,10 +477,11 @@
 ; ASM: #   ClassType: A (0x1005)
 ; ASM: #   Representation: GeneralData (0x4)
 ; ASM: # }
+; ASM: # Pointer (0x1007)
 ; ASM: .short	0xa                     # Record length
 ; ASM: .short	0x1002                  # Record kind: LF_POINTER
-; ASM: .long	0x1005                  # PointeeType
-; ASM: .long	0x1040c                 # Attributes
+; ASM: .long	0x1005                  # PointeeType: A
+; ASM: .long	0x1040c                 # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8, isConst ]
 ; ASM: # Pointer (0x1007) {
 ; ASM: #   TypeLeafKind: LF_POINTER (0x1002)
 ; ASM: #   PointeeType: A (0x1005)
@@ -488,6 +496,7 @@
 ; ASM: #   IsThisPtr&&: 0
 ; ASM: #   SizeOf: 8
 ; ASM: # }
+; ASM: # ArgList (0x1008)
 ; ASM: .short	0x6                     # Record length
 ; ASM: .short	0x1201                  # Record kind: LF_ARGLIST
 ; ASM: .long	0x0                     # NumArgs
@@ -497,15 +506,16 @@
 ; ASM: #   Arguments [
 ; ASM: #   ]
 ; ASM: # }
+; ASM: # MemberFunction (0x1009)
 ; ASM: .short	0x1a                    # Record length
 ; ASM: .short	0x1009                  # Record kind: LF_MFUNCTION
-; ASM: .long	0x3                     # ReturnType
-; ASM: .long	0x1005                  # ClassType
-; ASM: .long	0x1007                  # ThisType
-; ASM: .byte	0x0                     # CallingConvention
+; ASM: .long	0x3                     # ReturnType: void
+; ASM: .long	0x1005                  # ClassType: A
+; ASM: .long	0x1007                  # ThisType: A* const
+; ASM: .byte	0x0                     # CallingConvention: NearC
 ; ASM: .byte	0x0                     # FunctionOptions
 ; ASM: .short	0x0                     # NumParameters
-; ASM: .long	0x1008                  # ArgListType
+; ASM: .long	0x1008                  # ArgListType: ()
 ; ASM: .long	0x0                     # ThisAdjustment
 ; ASM: # MemberFunction (0x1009) {
 ; ASM: #   TypeLeafKind: LF_MFUNCTION (0x1009)
@@ -519,16 +529,17 @@
 ; ASM: #   ArgListType: () (0x1008)
 ; ASM: #   ThisAdjustment: 0
 ; ASM: # }
+; ASM: # FieldList (0x100A)
 ; ASM: .short	0x1e                    # Record length
 ; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
-; ASM: .short	0x150d                  # Member kind: LF_MEMBER
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x74                    # Type
+; ASM: .short	0x150d                  # Member kind: DataMember ( LF_MEMBER )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x74                    # Type: int
 ; ASM: .short	0x0                     # FieldOffset
 ; ASM: .asciz	"a"                     # Name
-; ASM: .short	0x1511                  # Member kind: LF_ONEMETHOD
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x1009                  # Type
+; ASM: .short	0x1511                  # Member kind: OneMethod ( LF_ONEMETHOD )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x1009                  # Type: void A::()
 ; ASM: .asciz	"A::f"                  # Name
 ; ASM: .byte	243
 ; ASM: .byte	242
@@ -549,11 +560,12 @@
 ; ASM: #     Name: A::f
 ; ASM: #   }
 ; ASM: # }
+; ASM: # Struct (0x100B)
 ; ASM: .short	0x16                    # Record length
 ; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
 ; ASM: .short	0x2                     # MemberCount
 ; ASM: .short	0x0                     # Properties
-; ASM: .long	0x100a                  # FieldList
+; ASM: .long	0x100a                  # FieldList: <field list>
 ; ASM: .long	0x0                     # DerivedFrom
 ; ASM: .long	0x0                     # VShape
 ; ASM: .short	0x4                     # SizeOf
@@ -569,6 +581,7 @@
 ; ASM: #   SizeOf: 4
 ; ASM: #   Name: A
 ; ASM: # }
+; ASM: # StringId (0x100C)
 ; ASM: .short	0x1e                    # Record length
 ; ASM: .short	0x1605                  # Record kind: LF_STRING_ID
 ; ASM: .long	0x0                     # Id
@@ -578,10 +591,11 @@
 ; ASM: #   Id: 0x0
 ; ASM: #   StringData: D:\src\llvm\build\t.cpp
 ; ASM: # }
+; ASM: # UdtSourceLine (0x100D)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1606                  # Record kind: LF_UDT_SRC_LINE
-; ASM: .long	0x100b                  # UDT
-; ASM: .long	0x100c                  # SourceFile
+; ASM: .long	0x100b                  # UDT: A
+; ASM: .long	0x100c                  # SourceFile: D:\src\llvm\build\t.cpp
 ; ASM: .long	0x1                     # LineNumber
 ; ASM: # UdtSourceLine (0x100D) {
 ; ASM: #   TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
@@ -589,12 +603,13 @@
 ; ASM: #   SourceFile: D:\src\llvm\build\t.cpp (0x100C)
 ; ASM: #   LineNumber: 1
 ; ASM: # }
+; ASM: # Pointer (0x100E)
 ; ASM: .short	0x12                    # Record length
 ; ASM: .short	0x1002                  # Record kind: LF_POINTER
-; ASM: .long	0x1009                  # PointeeType
-; ASM: .long	0x1006c                 # Attributes
-; ASM: .long	0x1005                  # ClassType
-; ASM: .short	0x8                     # Representation
+; ASM: .long	0x1009                  # PointeeType: void A::()
+; ASM: .long	0x1006c                 # Attrs: [ Type: Near64, Mode: PointerToMemberFunction, SizeOf: 8 ]
+; ASM: .long	0x1005                  # ClassType: A
+; ASM: .short	0x8                     # Representation: GeneralFunction
 ; ASM: .byte	242
 ; ASM: .byte	241
 ; ASM: # Pointer (0x100E) {
@@ -613,10 +628,11 @@
 ; ASM: #   ClassType: A (0x1005)
 ; ASM: #   Representation: GeneralFunction (0x8)
 ; ASM: # }
+; ASM: # Modifier (0x100F)
 ; ASM: .short	0xa                     # Record length
 ; ASM: .short	0x1001                  # Record kind: LF_MODIFIER
-; ASM: .long	0x3                     # ModifiedType
-; ASM: .short	0x1                     # Modifiers
+; ASM: .long	0x3                     # ModifiedType: void
+; ASM: .short	0x1                     # Modifiers ( Const (0x1) )
 ; ASM: .byte	242
 ; ASM: .byte	241
 ; ASM: # Modifier (0x100F) {
@@ -626,10 +642,11 @@
 ; ASM: #     Const (0x1)
 ; ASM: #   ]
 ; ASM: # }
+; ASM: # Pointer (0x1010)
 ; ASM: .short	0xa                     # Record length
 ; ASM: .short	0x1002                  # Record kind: LF_POINTER
-; ASM: .long	0x100f                  # PointeeType
-; ASM: .long	0x1000c                 # Attributes
+; ASM: .long	0x100f                  # PointeeType: const void
+; ASM: .long	0x1000c                 # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8 ]
 ; ASM: # Pointer (0x1010) {
 ; ASM: #   TypeLeafKind: LF_POINTER (0x1002)
 ; ASM: #   PointeeType: const void (0x100F)
@@ -644,13 +661,14 @@
 ; ASM: #   IsThisPtr&&: 0
 ; ASM: #   SizeOf: 8
 ; ASM: # }
+; ASM: # Procedure (0x1011)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1008                  # Record kind: LF_PROCEDURE
-; ASM: .long	0x3                     # ReturnType
-; ASM: .byte	0x0                     # CallingConvention
+; ASM: .long	0x3                     # ReturnType: void
+; ASM: .byte	0x0                     # CallingConvention: NearC
 ; ASM: .byte	0x0                     # FunctionOptions
 ; ASM: .short	0x0                     # NumParameters
-; ASM: .long	0x1008                  # ArgListType
+; ASM: .long	0x1008                  # ArgListType: ()
 ; ASM: # Procedure (0x1011) {
 ; ASM: #   TypeLeafKind: LF_PROCEDURE (0x1008)
 ; ASM: #   ReturnType: void (0x3)
@@ -660,10 +678,11 @@
 ; ASM: #   NumParameters: 0
 ; ASM: #   ArgListType: () (0x1008)
 ; ASM: # }
+; ASM: # FuncId (0x1012)
 ; ASM: .short	0x16                    # Record length
 ; ASM: .short	0x1601                  # Record kind: LF_FUNC_ID
 ; ASM: .long	0x0                     # ParentScope
-; ASM: .long	0x1011                  # FunctionType
+; ASM: .long	0x1011                  # FunctionType: void ()
 ; ASM: .asciz	"CharTypes"             # Name
 ; ASM: .byte	242
 ; ASM: .byte	241
@@ -673,6 +692,7 @@
 ; ASM: #   FunctionType: void () (0x1011)
 ; ASM: #   Name: CharTypes
 ; ASM: # }
+; ASM: # StringId (0x1013)
 ; ASM: .short	0x1a                    # Record length
 ; ASM: .short	0x1605                  # Record kind: LF_STRING_ID
 ; ASM: .long	0x0                     # Id
@@ -684,6 +704,7 @@
 ; ASM: #   Id: 0x0
 ; ASM: #   StringData: D:\src\llvm\build
 ; ASM: # }
+; ASM: # StringId (0x1014)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1605                  # Record kind: LF_STRING_ID
 ; ASM: .long	0x0                     # Id
@@ -695,12 +716,13 @@
 ; ASM: #   Id: 0x0
 ; ASM: #   StringData: t.cpp
 ; ASM: # }
+; ASM: # BuildInfo (0x1015)
 ; ASM: .short	0x1a                    # Record length
 ; ASM: .short	0x1603                  # Record kind: LF_BUILDINFO
 ; ASM: .short	0x5                     # NumArgs
-; ASM: .long	0x1013                  # Argument
+; ASM: .long	0x1013                  # Argument: D:\src\llvm\build
 ; ASM: .long	0x0                     # Argument
-; ASM: .long	0x1014                  # Argument
+; ASM: .long	0x1014                  # Argument: t.cpp
 ; ASM: .long	0x0                     # Argument
 ; ASM: .long	0x0                     # Argument
 ; ASM: .byte	242

Modified: llvm/trunk/test/DebugInfo/COFF/types-data-members.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/types-data-members.ll?rev=367623&r1=367622&r2=367623&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/types-data-members.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/types-data-members.ll Thu Aug  1 15:05:14 2019
@@ -393,6 +393,7 @@
 ; ASM: .section	.debug$T,"dr"
 ; ASM: .p2align	2
 ; ASM: .long	4                       # Debug section magic
+; ASM: # ArgList (0x1000)
 ; ASM: .short	0x6                     # Record length
 ; ASM: .short	0x1201                  # Record kind: LF_ARGLIST
 ; ASM: .long	0x0                     # NumArgs
@@ -402,13 +403,14 @@
 ; ASM: #   Arguments [
 ; ASM: #   ]
 ; ASM: # }
+; ASM: # Procedure (0x1001)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1008                  # Record kind: LF_PROCEDURE
-; ASM: .long	0x3                     # ReturnType
-; ASM: .byte	0x0                     # CallingConvention
+; ASM: .long	0x3                     # ReturnType: void
+; ASM: .byte	0x0                     # CallingConvention: NearC
 ; ASM: .byte	0x0                     # FunctionOptions
 ; ASM: .short	0x0                     # NumParameters
-; ASM: .long	0x1000                  # ArgListType
+; ASM: .long	0x1000                  # ArgListType: ()
 ; ASM: # Procedure (0x1001) {
 ; ASM: #   TypeLeafKind: LF_PROCEDURE (0x1008)
 ; ASM: #   ReturnType: void (0x3)
@@ -418,10 +420,11 @@
 ; ASM: #   NumParameters: 0
 ; ASM: #   ArgListType: () (0x1000)
 ; ASM: # }
+; ASM: # FuncId (0x1002)
 ; ASM: .short	0x16                    # Record length
 ; ASM: .short	0x1601                  # Record kind: LF_FUNC_ID
 ; ASM: .long	0x0                     # ParentScope
-; ASM: .long	0x1001                  # FunctionType
+; ASM: .long	0x1001                  # FunctionType: void ()
 ; ASM: .asciz	"UseTypes"              # Name
 ; ASM: .byte	243
 ; ASM: .byte	242
@@ -432,10 +435,11 @@
 ; ASM: #   FunctionType: void () (0x1001)
 ; ASM: #   Name: UseTypes
 ; ASM: # }
+; ASM: # Struct (0x1003)
 ; ASM: .short	0x2a                    # Record length
 ; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
 ; ASM: .short	0x0                     # MemberCount
-; ASM: .short	0x280                   # Properties
+; ASM: .short	0x280                   # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )
 ; ASM: .long	0x0                     # FieldList
 ; ASM: .long	0x0                     # DerivedFrom
 ; ASM: .long	0x0                     # VShape
@@ -458,10 +462,11 @@
 ; ASM: #   Name: Struct
 ; ASM: #   LinkageName: .?AUStruct@@
 ; ASM: # }
+; ASM: # Modifier (0x1004)
 ; ASM: .short	0xa                     # Record length
 ; ASM: .short	0x1001                  # Record kind: LF_MODIFIER
-; ASM: .long	0x74                    # ModifiedType
-; ASM: .short	0x1                     # Modifiers
+; ASM: .long	0x74                    # ModifiedType: int
+; ASM: .short	0x1                     # Modifiers ( Const (0x1) )
 ; ASM: .byte	242
 ; ASM: .byte	241
 ; ASM: # Modifier (0x1004) {
@@ -471,35 +476,36 @@
 ; ASM: #     Const (0x1)
 ; ASM: #   ]
 ; ASM: # }
+; ASM: # FieldList (0x1005)
 ; ASM: .short	0x3e                    # Record length
 ; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
-; ASM: .short	0x150d                  # Member kind: LF_MEMBER
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x74                    # Type
+; ASM: .short	0x150d                  # Member kind: DataMember ( LF_MEMBER )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x74                    # Type: int
 ; ASM: .short	0x0                     # FieldOffset
 ; ASM: .asciz	"s1"                    # Name
 ; ASM: .byte	243
 ; ASM: .byte	242
 ; ASM: .byte	241
-; ASM: .short	0x150d                  # Member kind: LF_MEMBER
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x74                    # Type
+; ASM: .short	0x150d                  # Member kind: DataMember ( LF_MEMBER )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x74                    # Type: int
 ; ASM: .short	0x4                     # FieldOffset
 ; ASM: .asciz	"s2"                    # Name
 ; ASM: .byte	243
 ; ASM: .byte	242
 ; ASM: .byte	241
-; ASM: .short	0x150d                  # Member kind: LF_MEMBER
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x74                    # Type
+; ASM: .short	0x150d                  # Member kind: DataMember ( LF_MEMBER )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x74                    # Type: int
 ; ASM: .short	0x8                     # FieldOffset
 ; ASM: .asciz	"s3"                    # Name
 ; ASM: .byte	243
 ; ASM: .byte	242
 ; ASM: .byte	241
-; ASM: .short	0x150e                  # Member kind: LF_STMEMBER
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x1004                  # Type
+; ASM: .short	0x150e                  # Member kind: StaticDataMember ( LF_STMEMBER )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x1004                  # Type: const int
 ; ASM: .asciz	"sdm"                   # Name
 ; ASM: # FieldList (0x1005) {
 ; ASM: #   TypeLeafKind: LF_FIELDLIST (0x1203)
@@ -531,11 +537,12 @@
 ; ASM: #     Name: sdm
 ; ASM: #   }
 ; ASM: # }
+; ASM: # Struct (0x1006)
 ; ASM: .short	0x2a                    # Record length
 ; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
 ; ASM: .short	0x4                     # MemberCount
-; ASM: .short	0x200                   # Properties
-; ASM: .long	0x1005                  # FieldList
+; ASM: .short	0x200                   # Properties ( HasUniqueName (0x200) )
+; ASM: .long	0x1005                  # FieldList: <field list>
 ; ASM: .long	0x0                     # DerivedFrom
 ; ASM: .long	0x0                     # VShape
 ; ASM: .short	0xc                     # SizeOf
@@ -556,6 +563,7 @@
 ; ASM: #   Name: Struct
 ; ASM: #   LinkageName: .?AUStruct@@
 ; ASM: # }
+; ASM: # StringId (0x1007)
 ; ASM: .short	0x1e                    # Record length
 ; ASM: .short	0x1605                  # Record kind: LF_STRING_ID
 ; ASM: .long	0x0                     # Id
@@ -565,10 +573,11 @@
 ; ASM: #   Id: 0x0
 ; ASM: #   StringData: D:\src\llvm\build\t.cpp
 ; ASM: # }
+; ASM: # UdtSourceLine (0x1008)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1606                  # Record kind: LF_UDT_SRC_LINE
-; ASM: .long	0x1006                  # UDT
-; ASM: .long	0x1007                  # SourceFile
+; ASM: .long	0x1006                  # UDT: Struct
+; ASM: .long	0x1007                  # SourceFile: D:\src\llvm\build\t.cpp
 ; ASM: .long	0x1                     # LineNumber
 ; ASM: # UdtSourceLine (0x1008) {
 ; ASM: #   TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
@@ -576,10 +585,11 @@
 ; ASM: #   SourceFile: D:\src\llvm\build\t.cpp (0x1007)
 ; ASM: #   LineNumber: 1
 ; ASM: # }
+; ASM: # Union (0x1009)
 ; ASM: .short	0x1e                    # Record length
 ; ASM: .short	0x1506                  # Record kind: LF_UNION
 ; ASM: .short	0x0                     # MemberCount
-; ASM: .short	0x280                   # Properties
+; ASM: .short	0x280                   # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )
 ; ASM: .long	0x0                     # FieldList
 ; ASM: .short	0x0                     # SizeOf
 ; ASM: .asciz	"Union"                 # Name
@@ -596,16 +606,17 @@
 ; ASM: #   Name: Union
 ; ASM: #   LinkageName: .?ATUnion@@
 ; ASM: # }
+; ASM: # FieldList (0x100A)
 ; ASM: .short	0x1a                    # Record length
 ; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
-; ASM: .short	0x150d                  # Member kind: LF_MEMBER
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x74                    # Type
+; ASM: .short	0x150d                  # Member kind: DataMember ( LF_MEMBER )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x74                    # Type: int
 ; ASM: .short	0x0                     # FieldOffset
 ; ASM: .asciz	"a"                     # Name
-; ASM: .short	0x150d                  # Member kind: LF_MEMBER
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x40                    # Type
+; ASM: .short	0x150d                  # Member kind: DataMember ( LF_MEMBER )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x40                    # Type: float
 ; ASM: .short	0x0                     # FieldOffset
 ; ASM: .asciz	"b"                     # Name
 ; ASM: # FieldList (0x100A) {
@@ -625,11 +636,12 @@
 ; ASM: #     Name: b
 ; ASM: #   }
 ; ASM: # }
+; ASM: # Union (0x100B)
 ; ASM: .short	0x1e                    # Record length
 ; ASM: .short	0x1506                  # Record kind: LF_UNION
 ; ASM: .short	0x2                     # MemberCount
-; ASM: .short	0x600                   # Properties
-; ASM: .long	0x100a                  # FieldList
+; ASM: .short	0x600                   # Properties ( HasUniqueName (0x200) | Sealed (0x400) )
+; ASM: .long	0x100a                  # FieldList: <field list>
 ; ASM: .short	0x4                     # SizeOf
 ; ASM: .asciz	"Union"                 # Name
 ; ASM: .asciz	".?ATUnion@@"           # LinkageName
@@ -645,10 +657,11 @@
 ; ASM: #   Name: Union
 ; ASM: #   LinkageName: .?ATUnion@@
 ; ASM: # }
+; ASM: # UdtSourceLine (0x100C)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1606                  # Record kind: LF_UDT_SRC_LINE
-; ASM: .long	0x100b                  # UDT
-; ASM: .long	0x1007                  # SourceFile
+; ASM: .long	0x100b                  # UDT: Union
+; ASM: .long	0x1007                  # SourceFile: D:\src\llvm\build\t.cpp
 ; ASM: .long	0x7                     # LineNumber
 ; ASM: # UdtSourceLine (0x100C) {
 ; ASM: #   TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
@@ -656,10 +669,11 @@
 ; ASM: #   SourceFile: D:\src\llvm\build\t.cpp (0x1007)
 ; ASM: #   LineNumber: 7
 ; ASM: # }
+; ASM: # Class (0x100D)
 ; ASM: .short	0x26                    # Record length
 ; ASM: .short	0x1504                  # Record kind: LF_CLASS
 ; ASM: .short	0x0                     # MemberCount
-; ASM: .short	0x280                   # Properties
+; ASM: .short	0x280                   # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )
 ; ASM: .long	0x0                     # FieldList
 ; ASM: .long	0x0                     # DerivedFrom
 ; ASM: .long	0x0                     # VShape
@@ -680,24 +694,25 @@
 ; ASM: #   Name: Class
 ; ASM: #   LinkageName: .?AVClass@@
 ; ASM: # }
+; ASM: # FieldList (0x100E)
 ; ASM: .short	0x32                    # Record length
 ; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
-; ASM: .short	0x150d                  # Member kind: LF_MEMBER
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x74                    # Type
+; ASM: .short	0x150d                  # Member kind: DataMember ( LF_MEMBER )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x74                    # Type: int
 ; ASM: .short	0x0                     # FieldOffset
 ; ASM: .asciz	"pub"                   # Name
 ; ASM: .byte	242
 ; ASM: .byte	241
-; ASM: .short	0x150d                  # Member kind: LF_MEMBER
-; ASM: .short	0x1                     # AccessSpecifier
-; ASM: .long	0x74                    # Type
+; ASM: .short	0x150d                  # Member kind: DataMember ( LF_MEMBER )
+; ASM: .short	0x1                     # Attrs: Private
+; ASM: .long	0x74                    # Type: int
 ; ASM: .short	0x4                     # FieldOffset
 ; ASM: .asciz	"priv"                  # Name
 ; ASM: .byte	241
-; ASM: .short	0x150d                  # Member kind: LF_MEMBER
-; ASM: .short	0x2                     # AccessSpecifier
-; ASM: .long	0x74                    # Type
+; ASM: .short	0x150d                  # Member kind: DataMember ( LF_MEMBER )
+; ASM: .short	0x2                     # Attrs: Protected
+; ASM: .long	0x74                    # Type: int
 ; ASM: .short	0x8                     # FieldOffset
 ; ASM: .asciz	"prot"                  # Name
 ; ASM: .byte	241
@@ -725,11 +740,12 @@
 ; ASM: #     Name: prot
 ; ASM: #   }
 ; ASM: # }
+; ASM: # Class (0x100F)
 ; ASM: .short	0x26                    # Record length
 ; ASM: .short	0x1504                  # Record kind: LF_CLASS
 ; ASM: .short	0x3                     # MemberCount
-; ASM: .short	0x200                   # Properties
-; ASM: .long	0x100e                  # FieldList
+; ASM: .short	0x200                   # Properties ( HasUniqueName (0x200) )
+; ASM: .long	0x100e                  # FieldList: <field list>
 ; ASM: .long	0x0                     # DerivedFrom
 ; ASM: .long	0x0                     # VShape
 ; ASM: .short	0xc                     # SizeOf
@@ -748,10 +764,11 @@
 ; ASM: #   Name: Class
 ; ASM: #   LinkageName: .?AVClass@@
 ; ASM: # }
+; ASM: # UdtSourceLine (0x1010)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1606                  # Record kind: LF_UDT_SRC_LINE
-; ASM: .long	0x100f                  # UDT
-; ASM: .long	0x1007                  # SourceFile
+; ASM: .long	0x100f                  # UDT: Class
+; ASM: .long	0x1007                  # SourceFile: D:\src\llvm\build\t.cpp
 ; ASM: .long	0xb                     # LineNumber
 ; ASM: # UdtSourceLine (0x1010) {
 ; ASM: #   TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
@@ -759,10 +776,11 @@
 ; ASM: #   SourceFile: D:\src\llvm\build\t.cpp (0x1007)
 ; ASM: #   LineNumber: 11
 ; ASM: # }
+; ASM: # Struct (0x1011)
 ; ASM: .short	0x36                    # Record length
 ; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
 ; ASM: .short	0x0                     # MemberCount
-; ASM: .short	0x280                   # Properties
+; ASM: .short	0x280                   # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )
 ; ASM: .long	0x0                     # FieldList
 ; ASM: .long	0x0                     # DerivedFrom
 ; ASM: .long	0x0                     # VShape
@@ -785,10 +803,11 @@
 ; ASM: #   Name: DerivedClass
 ; ASM: #   LinkageName: .?AUDerivedClass@@
 ; ASM: # }
+; ASM: # Pointer (0x1012)
 ; ASM: .short	0xa                     # Record length
 ; ASM: .short	0x1002                  # Record kind: LF_POINTER
-; ASM: .long	0x1004                  # PointeeType
-; ASM: .long	0x1000c                 # Attributes
+; ASM: .long	0x1004                  # PointeeType: const int
+; ASM: .long	0x1000c                 # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8 ]
 ; ASM: # Pointer (0x1012) {
 ; ASM: #   TypeLeafKind: LF_POINTER (0x1002)
 ; ASM: #   PointeeType: const int (0x1004)
@@ -803,6 +822,7 @@
 ; ASM: #   IsThisPtr&&: 0
 ; ASM: #   SizeOf: 8
 ; ASM: # }
+; ASM: # VFTableShape (0x1013)
 ; ASM: .short	0x6                     # Record length
 ; ASM: .short	0xa                     # Record kind: LF_VTSHAPE
 ; ASM: .short	0x1                     # VFEntryCount
@@ -812,10 +832,11 @@
 ; ASM: #   TypeLeafKind: LF_VTSHAPE (0xA)
 ; ASM: #   VFEntryCount: 1
 ; ASM: # }
+; ASM: # Pointer (0x1014)
 ; ASM: .short	0xa                     # Record length
 ; ASM: .short	0x1002                  # Record kind: LF_POINTER
-; ASM: .long	0x1013                  # PointeeType
-; ASM: .long	0x1000c                 # Attributes
+; ASM: .long	0x1013                  # PointeeType: <vftable 1 methods>
+; ASM: .long	0x1000c                 # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8 ]
 ; ASM: # Pointer (0x1014) {
 ; ASM: #   TypeLeafKind: LF_POINTER (0x1002)
 ; ASM: #   PointeeType: <vftable 1 methods> (0x1013)
@@ -830,26 +851,27 @@
 ; ASM: #   IsThisPtr&&: 0
 ; ASM: #   SizeOf: 8
 ; ASM: # }
+; ASM: # FieldList (0x1015)
 ; ASM: .short	0x32                    # Record length
 ; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
-; ASM: .short	0x1400                  # Member kind: LF_BCLASS
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x1003                  # BaseType
+; ASM: .short	0x1400                  # Member kind: BaseClass ( LF_BCLASS )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x1003                  # BaseType: Struct
 ; ASM: .short	0x0                     # BaseOffset
 ; ASM: .byte	242
 ; ASM: .byte	241
-; ASM: .short	0x1401                  # Member kind: LF_VBCLASS
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x100d                  # BaseType
-; ASM: .long	0x1012                  # VBPtrType
+; ASM: .short	0x1401                  # Member kind: VirtualBaseClass ( LF_VBCLASS )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x100d                  # BaseType: Class
+; ASM: .long	0x1012                  # VBPtrType: const int*
 ; ASM: .short	0x0                     # VBPtrOffset
 ; ASM: .short	0x1                     # VBTableIndex
-; ASM: .short	0x1409                  # Member kind: LF_VFUNCTAB
+; ASM: .short	0x1409                  # Member kind: VFPtr ( LF_VFUNCTAB )
 ; ASM: .short	0x0                     # Padding
-; ASM: .long	0x1014                  # Type
-; ASM: .short	0x150d                  # Member kind: LF_MEMBER
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x74                    # Type
+; ASM: .long	0x1014                  # Type: <vftable 1 methods>*
+; ASM: .short	0x150d                  # Member kind: DataMember ( LF_MEMBER )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x74                    # Type: int
 ; ASM: .short	0x18                    # FieldOffset
 ; ASM: .asciz	"d"                     # Name
 ; ASM: # FieldList (0x1015) {
@@ -880,11 +902,12 @@
 ; ASM: #     Name: d
 ; ASM: #   }
 ; ASM: # }
+; ASM: # Struct (0x1016)
 ; ASM: .short	0x36                    # Record length
 ; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
 ; ASM: .short	0x4                     # MemberCount
-; ASM: .short	0x200                   # Properties
-; ASM: .long	0x1015                  # FieldList
+; ASM: .short	0x200                   # Properties ( HasUniqueName (0x200) )
+; ASM: .long	0x1015                  # FieldList: <field list>
 ; ASM: .long	0x0                     # DerivedFrom
 ; ASM: .long	0x0                     # VShape
 ; ASM: .short	0x30                    # SizeOf
@@ -905,10 +928,11 @@
 ; ASM: #   Name: DerivedClass
 ; ASM: #   LinkageName: .?AUDerivedClass@@
 ; ASM: # }
+; ASM: # UdtSourceLine (0x1017)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1606                  # Record kind: LF_UDT_SRC_LINE
-; ASM: .long	0x1016                  # UDT
-; ASM: .long	0x1007                  # SourceFile
+; ASM: .long	0x1016                  # UDT: DerivedClass
+; ASM: .long	0x1007                  # SourceFile: D:\src\llvm\build\t.cpp
 ; ASM: .long	0x14                    # LineNumber
 ; ASM: # UdtSourceLine (0x1017) {
 ; ASM: #   TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
@@ -916,10 +940,11 @@
 ; ASM: #   SourceFile: D:\src\llvm\build\t.cpp (0x1007)
 ; ASM: #   LineNumber: 20
 ; ASM: # }
+; ASM: # Struct (0x1018)
 ; ASM: .short	0x36                    # Record length
 ; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
 ; ASM: .short	0x0                     # MemberCount
-; ASM: .short	0x288                   # Properties
+; ASM: .short	0x288                   # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) | Nested (0x8) )
 ; ASM: .long	0x0                     # FieldList
 ; ASM: .long	0x0                     # DerivedFrom
 ; ASM: .long	0x0                     # VShape
@@ -942,11 +967,12 @@
 ; ASM: #   Name: Class::Nested
 ; ASM: #   LinkageName: .?AUNested at Class@@
 ; ASM: # }
+; ASM: # FieldList (0x1019)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1203                  # Record kind: LF_FIELDLIST
-; ASM: .short	0x150d                  # Member kind: LF_MEMBER
-; ASM: .short	0x3                     # AccessSpecifier
-; ASM: .long	0x74                    # Type
+; ASM: .short	0x150d                  # Member kind: DataMember ( LF_MEMBER )
+; ASM: .short	0x3                     # Attrs: Public
+; ASM: .long	0x74                    # Type: int
 ; ASM: .short	0x0                     # FieldOffset
 ; ASM: .asciz	"n"                     # Name
 ; ASM: # FieldList (0x1019) {
@@ -959,11 +985,12 @@
 ; ASM: #     Name: n
 ; ASM: #   }
 ; ASM: # }
+; ASM: # Struct (0x101A)
 ; ASM: .short	0x36                    # Record length
 ; ASM: .short	0x1505                  # Record kind: LF_STRUCTURE
 ; ASM: .short	0x1                     # MemberCount
-; ASM: .short	0x208                   # Properties
-; ASM: .long	0x1019                  # FieldList
+; ASM: .short	0x208                   # Properties ( HasUniqueName (0x200) | Nested (0x8) )
+; ASM: .long	0x1019                  # FieldList: <field list>
 ; ASM: .long	0x0                     # DerivedFrom
 ; ASM: .long	0x0                     # VShape
 ; ASM: .short	0x4                     # SizeOf
@@ -984,10 +1011,11 @@
 ; ASM: #   Name: Class::Nested
 ; ASM: #   LinkageName: .?AUNested at Class@@
 ; ASM: # }
+; ASM: # UdtSourceLine (0x101B)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1606                  # Record kind: LF_UDT_SRC_LINE
-; ASM: .long	0x101a                  # UDT
-; ASM: .long	0x1007                  # SourceFile
+; ASM: .long	0x101a                  # UDT: Class::Nested
+; ASM: .long	0x1007                  # SourceFile: D:\src\llvm\build\t.cpp
 ; ASM: .long	0x17                    # LineNumber
 ; ASM: # UdtSourceLine (0x101B) {
 ; ASM: #   TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
@@ -995,10 +1023,11 @@
 ; ASM: #   SourceFile: D:\src\llvm\build\t.cpp (0x1007)
 ; ASM: #   LineNumber: 23
 ; ASM: # }
+; ASM: # Pointer (0x101C)
 ; ASM: .short	0xa                     # Record length
 ; ASM: .short	0x1002                  # Record kind: LF_POINTER
-; ASM: .long	0x1011                  # PointeeType
-; ASM: .long	0x1040c                 # Attributes
+; ASM: .long	0x1011                  # PointeeType: DerivedClass
+; ASM: .long	0x1040c                 # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8, isConst ]
 ; ASM: # Pointer (0x101C) {
 ; ASM: #   TypeLeafKind: LF_POINTER (0x1002)
 ; ASM: #   PointeeType: DerivedClass (0x1011)
@@ -1013,15 +1042,16 @@
 ; ASM: #   IsThisPtr&&: 0
 ; ASM: #   SizeOf: 8
 ; ASM: # }
+; ASM: # MemberFunction (0x101D)
 ; ASM: .short	0x1a                    # Record length
 ; ASM: .short	0x1009                  # Record kind: LF_MFUNCTION
-; ASM: .long	0x3                     # ReturnType
-; ASM: .long	0x1011                  # ClassType
-; ASM: .long	0x101c                  # ThisType
-; ASM: .byte	0x0                     # CallingConvention
+; ASM: .long	0x3                     # ReturnType: void
+; ASM: .long	0x1011                  # ClassType: DerivedClass
+; ASM: .long	0x101c                  # ThisType: DerivedClass* const
+; ASM: .byte	0x0                     # CallingConvention: NearC
 ; ASM: .byte	0x0                     # FunctionOptions
 ; ASM: .short	0x0                     # NumParameters
-; ASM: .long	0x1000                  # ArgListType
+; ASM: .long	0x1000                  # ArgListType: ()
 ; ASM: .long	0x0                     # ThisAdjustment
 ; ASM: # MemberFunction (0x101D) {
 ; ASM: #   TypeLeafKind: LF_MFUNCTION (0x1009)
@@ -1035,10 +1065,11 @@
 ; ASM: #   ArgListType: () (0x1000)
 ; ASM: #   ThisAdjustment: 0
 ; ASM: # }
+; ASM: # MemberFuncId (0x101E)
 ; ASM: .short	0x26                    # Record length
 ; ASM: .short	0x1602                  # Record kind: LF_MFUNC_ID
-; ASM: .long	0x1011                  # ClassType
-; ASM: .long	0x101d                  # FunctionType
+; ASM: .long	0x1011                  # ClassType: DerivedClass
+; ASM: .long	0x101d                  # FunctionType: void DerivedClass::()
 ; ASM: .asciz	"DerivedClass::DerivedClass" # Name
 ; ASM: .byte	241
 ; ASM: # MemberFuncId (0x101E) {
@@ -1047,10 +1078,11 @@
 ; ASM: #   FunctionType: void DerivedClass::() (0x101D)
 ; ASM: #   Name: DerivedClass::DerivedClass
 ; ASM: # }
+; ASM: # Pointer (0x101F)
 ; ASM: .short	0xa                     # Record length
 ; ASM: .short	0x1002                  # Record kind: LF_POINTER
-; ASM: .long	0x1011                  # PointeeType
-; ASM: .long	0x1000c                 # Attributes
+; ASM: .long	0x1011                  # PointeeType: DerivedClass
+; ASM: .long	0x1000c                 # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8 ]
 ; ASM: # Pointer (0x101F) {
 ; ASM: #   TypeLeafKind: LF_POINTER (0x1002)
 ; ASM: #   PointeeType: DerivedClass (0x1011)
@@ -1065,6 +1097,7 @@
 ; ASM: #   IsThisPtr&&: 0
 ; ASM: #   SizeOf: 8
 ; ASM: # }
+; ASM: # StringId (0x1020)
 ; ASM: .short	0x1a                    # Record length
 ; ASM: .short	0x1605                  # Record kind: LF_STRING_ID
 ; ASM: .long	0x0                     # Id
@@ -1076,6 +1109,7 @@
 ; ASM: #   Id: 0x0
 ; ASM: #   StringData: D:\src\llvm\build
 ; ASM: # }
+; ASM: # StringId (0x1021)
 ; ASM: .short	0xe                     # Record length
 ; ASM: .short	0x1605                  # Record kind: LF_STRING_ID
 ; ASM: .long	0x0                     # Id
@@ -1087,12 +1121,13 @@
 ; ASM: #   Id: 0x0
 ; ASM: #   StringData: t.cpp
 ; ASM: # }
+; ASM: # BuildInfo (0x1022)
 ; ASM: .short	0x1a                    # Record length
 ; ASM: .short	0x1603                  # Record kind: LF_BUILDINFO
 ; ASM: .short	0x5                     # NumArgs
-; ASM: .long	0x1020                  # Argument
+; ASM: .long	0x1020                  # Argument: D:\src\llvm\build
 ; ASM: .long	0x0                     # Argument
-; ASM: .long	0x1021                  # Argument
+; ASM: .long	0x1021                  # Argument: t.cpp
 ; ASM: .long	0x0                     # Argument
 ; ASM: .long	0x0                     # Argument
 ; ASM: .byte	242




More information about the llvm-commits mailing list