Skip to content

Commit e47d292

Browse files
committed
Include (Type|Symbol)Record.h less
Most clients only need CVType and CVSymbol, not structs for every type and symbol. Move CVSymbol and CVType to CVRecord.h to accomplish this. Update some of the common headers that need CVSymbol and CVType to use the new location.
1 parent 3672489 commit e47d292

17 files changed

+26
-33
lines changed

llvm/include/llvm/DebugInfo/CodeView/CVRecord.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
#include "llvm/ADT/ArrayRef.h"
1313
#include "llvm/ADT/Optional.h"
14+
#include "llvm/DebugInfo/CodeView/CodeView.h"
1415
#include "llvm/DebugInfo/CodeView/CodeViewError.h"
1516
#include "llvm/DebugInfo/CodeView/RecordSerialization.h"
16-
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
1717
#include "llvm/Support/BinaryStreamReader.h"
1818
#include "llvm/Support/BinaryStreamRef.h"
1919
#include "llvm/Support/Endian.h"
@@ -61,12 +61,9 @@ template <typename Kind> class CVRecord {
6161
ArrayRef<uint8_t> RecordData;
6262
};
6363

64-
template <typename Kind> struct RemappedRecord {
65-
explicit RemappedRecord(const CVRecord<Kind> &R) : OriginalRecord(R) {}
66-
67-
CVRecord<Kind> OriginalRecord;
68-
SmallVector<std::pair<uint32_t, TypeIndex>, 8> Mappings;
69-
};
64+
// There are two kinds of codeview records: type and symbol records.
65+
using CVType = CVRecord<TypeLeafKind>;
66+
using CVSymbol = CVRecord<SymbolKind>;
7067

7168
template <typename Record, typename Func>
7269
Error forEachCodeViewRecord(ArrayRef<uint8_t> StreamBuffer, Func F) {
@@ -126,6 +123,12 @@ struct VarStreamArrayExtractor<codeview::CVRecord<Kind>> {
126123
}
127124
};
128125

126+
namespace codeview {
127+
using CVSymbolArray = VarStreamArray<CVSymbol>;
128+
using CVTypeArray = VarStreamArray<CVType>;
129+
using CVTypeRange = iterator_range<CVTypeArray::Iterator>;
130+
} // namespace codeview
131+
129132
} // end namespace llvm
130133

131134
#endif // LLVM_DEBUGINFO_CODEVIEW_RECORDITERATOR_H

llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
#define LLVM_DEBUGINFO_CODEVIEW_CVSYMBOLVISITOR_H
1111

1212
#include "llvm/DebugInfo/CodeView/CVRecord.h"
13-
#include "llvm/DebugInfo/CodeView/CodeView.h"
14-
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
15-
#include "llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h"
1613
#include "llvm/Support/ErrorOr.h"
1714

1815
namespace llvm {

llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
#include "llvm/ADT/SmallVector.h"
1616
#include "llvm/ADT/StringRef.h"
1717
#include "llvm/DebugInfo/CodeView/CodeViewError.h"
18-
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
18+
#include "llvm/DebugInfo/CodeView/GUID.h"
19+
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
1920
#include "llvm/Support/BinaryStreamReader.h"
2021
#include "llvm/Support/BinaryStreamWriter.h"
2122
#include "llvm/Support/Error.h"

llvm/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
1010
#define LLVM_DEBUGINFO_CODEVIEW_DEBUGSYMBOLSSUBSECTION_H
1111

12+
#include "llvm/DebugInfo/CodeView/CVRecord.h"
1213
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
13-
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
1414
#include "llvm/Support/Error.h"
1515

1616
namespace llvm {

llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "llvm/ADT/StringRef.h"
1515
#include "llvm/DebugInfo/CodeView/TypeCollection.h"
1616
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
17-
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
1817
#include "llvm/Support/Allocator.h"
1918
#include "llvm/Support/BinaryStreamArray.h"
2019
#include "llvm/Support/Error.h"

llvm/include/llvm/DebugInfo/CodeView/RecordName.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#ifndef LLVM_DEBUGINFO_CODEVIEW_RECORDNAME_H
1010
#define LLVM_DEBUGINFO_CODEVIEW_RECORDNAME_H
1111

12-
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
1312
#include "llvm/DebugInfo/CodeView/TypeCollection.h"
1413
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
1514

llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
#include "llvm/ADT/ArrayRef.h"
1313
#include "llvm/ADT/StringSet.h"
14+
#include "llvm/DebugInfo/CodeView/CVRecord.h"
1415
#include "llvm/DebugInfo/CodeView/SymbolDumpDelegate.h"
15-
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
1616
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
1717

1818
namespace llvm {

llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,9 +1003,6 @@ class AnnotationSym : public SymbolRecord {
10031003
uint32_t RecordOffset = 0;
10041004
};
10051005

1006-
using CVSymbol = CVRecord<SymbolKind>;
1007-
using CVSymbolArray = VarStreamArray<CVSymbol>;
1008-
10091006
Expected<CVSymbol> readSymbolFromStream(BinaryStreamRef Stream,
10101007
uint32_t Offset);
10111008

llvm/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
#ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORDHELPERS_H
1010
#define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORDHELPERS_H
1111

12-
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
12+
#include "llvm/DebugInfo/CodeView/CVRecord.h"
13+
#include "llvm/DebugInfo/CodeView/CodeView.h"
1314

1415
namespace llvm {
1516
namespace codeview {

llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
#define LLVM_DEBUGINFO_CODEVIEW_TYPECOLLECTION_H
1111

1212
#include "llvm/ADT/StringRef.h"
13-
13+
#include "llvm/DebugInfo/CodeView/CVRecord.h"
1414
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
15-
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
1615

1716
namespace llvm {
1817
namespace codeview {

0 commit comments

Comments
 (0)