Coverage Report

Created: 2017-06-18 22:16

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/include/llvm/DebugInfo/CodeView/TypeDatabaseVisitor.h
Line
Count
Source
1
//===-- TypeDatabaseVisitor.h -----------------------------------*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLVM_DEBUGINFO_CODEVIEW_TYPEDATABASEVISITOR_H
11
#define LLVM_DEBUGINFO_CODEVIEW_TYPEDATABASEVISITOR_H
12
13
#include "llvm/ADT/PointerUnion.h"
14
15
#include "llvm/DebugInfo/CodeView/TypeDatabase.h"
16
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
17
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
18
#include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
19
20
namespace llvm {
21
namespace codeview {
22
23
/// Dumper for CodeView type streams found in COFF object files and PDB files.
24
class TypeDatabaseVisitor : public TypeVisitorCallbacks {
25
public:
26
1.36k
  explicit TypeDatabaseVisitor(TypeDatabase &TypeDB) : TypeDB(&TypeDB) {}
27
28
  /// Paired begin/end actions for all types. Receives all record data,
29
  /// including the fixed-length record prefix.
30
  Error visitTypeBegin(CVType &Record) override;
31
  Error visitTypeBegin(CVType &Record, TypeIndex Index) override;
32
  Error visitTypeEnd(CVType &Record) override;
33
  Error visitMemberBegin(CVMemberRecord &Record) override;
34
  Error visitMemberEnd(CVMemberRecord &Record) override;
35
36
#define TYPE_RECORD(EnumName, EnumVal, Name)                                   \
37
  Error visitKnownRecord(CVType &CVR, Name##Record &Record) override;
38
#define MEMBER_RECORD(EnumName, EnumVal, Name)                                 \
39
  Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record) override;
40
#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
41
#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
42
#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
43
44
private:
45
  StringRef getTypeName(TypeIndex Index) const;
46
  StringRef saveTypeName(StringRef Name);
47
48
  bool IsInFieldList = false;
49
50
  /// Name of the current type. Only valid before visitTypeEnd.
51
  StringRef Name;
52
  /// Current type index.  Only valid before visitTypeEnd, and if we are
53
  /// visiting a random access type database.
54
  Optional<TypeIndex> CurrentTypeIndex;
55
56
  TypeDatabase *TypeDB;
57
};
58
59
} // end namespace codeview
60
} // end namespace llvm
61
62
#endif // LLVM_DEBUGINFO_CODEVIEW_TYPEDUMPER_H