Ejemplo n.º 1
0
static Error visitMemberRecord(CVMemberRecord &Record,
                               TypeVisitorCallbacks &Callbacks) {
  if (auto EC = Callbacks.visitMemberBegin(Record))
    return EC;

  switch (Record.Kind) {
  default:
    if (auto EC = Callbacks.visitUnknownMember(Record))
      return EC;
    break;
#define MEMBER_RECORD(EnumName, EnumVal, Name)                                 \
  case EnumName: {                                                             \
    if (auto EC = visitKnownMember<Name##Record>(Record, Callbacks))           \
      return EC;                                                               \
    break;                                                                     \
  }
#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)                \
  MEMBER_RECORD(EnumVal, EnumVal, AliasName)
#define TYPE_RECORD(EnumName, EnumVal, Name)
#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
#include "llvm/DebugInfo/CodeView/TypeRecords.def"
  }

  if (auto EC = Callbacks.visitMemberEnd(Record))
    return EC;

  return Error::success();
}
Ejemplo n.º 2
0
static Error visitKnownMember(msf::StreamReader &Reader, TypeLeafKind Leaf,
                              TypeVisitorCallbacks &Callbacks) {
  auto ExpectedRecord = deserializeMemberRecord<MR>(Reader, Leaf);
  if (!ExpectedRecord)
    return ExpectedRecord.takeError();
  CVMemberRecord &Record = *ExpectedRecord;
  if (auto EC = Callbacks.visitMemberBegin(Record))
    return EC;
  if (auto EC = visitKnownMember<MR>(Record, Callbacks))
    return EC;
  if (auto EC = Callbacks.visitMemberEnd(Record))
    return EC;
  return Error::success();
}
Ejemplo n.º 3
0
static Error visitKnownRecord(CVType &Record, TypeVisitorCallbacks &Callbacks) {
  TypeRecordKind RK = static_cast<TypeRecordKind>(Record.Type);
  T KnownRecord(RK);
  if (auto EC = Callbacks.visitKnownRecord(Record, KnownRecord))
    return EC;
  return Error::success();
}