Skip to content

Commit 8456b16

Browse files
committed
[CodeView] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 306616
1 parent a236dae commit 8456b16

24 files changed

+312
-161
lines changed

llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@
1212

1313
#include "llvm/ADT/ArrayRef.h"
1414
#include "llvm/ADT/DenseMap.h"
15+
#include "llvm/ADT/StringRef.h"
16+
#include "llvm/DebugInfo/CodeView/CodeView.h"
1517
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
1618
#include "llvm/Support/Allocator.h"
1719
#include "llvm/Support/BinaryStreamArray.h"
1820
#include "llvm/Support/BinaryStreamReader.h"
19-
#include "llvm/Support/Endian.h"
21+
#include "llvm/Support/BinaryStreamRef.h"
22+
#include "llvm/Support/Error.h"
23+
#include <cstdint>
24+
#include <vector>
2025

2126
namespace llvm {
27+
2228
namespace codeview {
2329

2430
class DebugStringTableSubsection;
@@ -28,24 +34,22 @@ struct FileChecksumEntry {
2834
FileChecksumKind Kind; // The type of checksum.
2935
ArrayRef<uint8_t> Checksum; // The bytes of the checksum.
3036
};
31-
}
32-
}
3337

34-
namespace llvm {
38+
} // end namespace codeview
39+
3540
template <> struct VarStreamArrayExtractor<codeview::FileChecksumEntry> {
3641
public:
37-
typedef void ContextType;
42+
using ContextType = void;
3843

3944
Error operator()(BinaryStreamRef Stream, uint32_t &Len,
4045
codeview::FileChecksumEntry &Item);
4146
};
42-
}
4347

44-
namespace llvm {
4548
namespace codeview {
49+
4650
class DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
47-
typedef VarStreamArray<codeview::FileChecksumEntry> FileChecksumArray;
48-
typedef FileChecksumArray::Iterator Iterator;
51+
using FileChecksumArray = VarStreamArray<codeview::FileChecksumEntry>;
52+
using Iterator = FileChecksumArray::Iterator;
4953

5054
public:
5155
DebugChecksumsSubsectionRef()
@@ -89,10 +93,12 @@ class DebugChecksumsSubsection final : public DebugSubsection {
8993

9094
DenseMap<uint32_t, uint32_t> OffsetMap;
9195
uint32_t SerializedSize = 0;
92-
llvm::BumpPtrAllocator Storage;
96+
BumpPtrAllocator Storage;
9397
std::vector<FileChecksumEntry> Checksums;
9498
};
95-
}
96-
}
9799

98-
#endif
100+
} // end namespace codeview
101+
102+
} // end namespace llvm
103+
104+
#endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGCHECKSUMSSUBSECTION_H

llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@
1010
#ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H
1111
#define LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H
1212

13+
#include "llvm/DebugInfo/CodeView/CodeView.h"
1314
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
1415
#include "llvm/Support/BinaryStreamArray.h"
1516
#include "llvm/Support/BinaryStreamReader.h"
16-
#include "llvm/Support/Endian.h"
17-
17+
#include "llvm/Support/BinaryStreamRef.h"
18+
#include "llvm/Support/Error.h"
19+
#include <cstdint>
1820
#include <map>
1921

2022
namespace llvm {
2123
namespace codeview {
24+
2225
class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
23-
typedef FixedStreamArray<CrossModuleExport> ReferenceArray;
24-
typedef ReferenceArray::Iterator Iterator;
26+
using ReferenceArray = FixedStreamArray<CrossModuleExport>;
27+
using Iterator = ReferenceArray::Iterator;
2528

2629
public:
2730
DebugCrossModuleExportsSubsectionRef()
@@ -58,7 +61,8 @@ class DebugCrossModuleExportsSubsection final : public DebugSubsection {
5861
private:
5962
std::map<uint32_t, uint32_t> Mappings;
6063
};
61-
}
62-
}
6364

64-
#endif
65+
} // end namespace codeview
66+
} // end namespace llvm
67+
68+
#endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSEXSUBSECTION_H

llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,43 @@
1111
#define LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSIMPSUBSECTION_H
1212

1313
#include "llvm/ADT/StringMap.h"
14+
#include "llvm/ADT/StringRef.h"
15+
#include "llvm/DebugInfo/CodeView/CodeView.h"
1416
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
1517
#include "llvm/Support/BinaryStreamArray.h"
1618
#include "llvm/Support/BinaryStreamReader.h"
19+
#include "llvm/Support/BinaryStreamRef.h"
1720
#include "llvm/Support/Endian.h"
21+
#include "llvm/Support/Error.h"
22+
#include <cstdint>
23+
#include <vector>
1824

1925
namespace llvm {
26+
2027
namespace codeview {
2128

2229
struct CrossModuleImportItem {
2330
const CrossModuleImport *Header = nullptr;
24-
llvm::FixedStreamArray<support::ulittle32_t> Imports;
31+
FixedStreamArray<support::ulittle32_t> Imports;
2532
};
26-
}
27-
}
2833

29-
namespace llvm {
34+
} // end namespace codeview
35+
3036
template <> struct VarStreamArrayExtractor<codeview::CrossModuleImportItem> {
3137
public:
32-
typedef void ContextType;
38+
using ContextType = void;
3339

3440
Error operator()(BinaryStreamRef Stream, uint32_t &Len,
3541
codeview::CrossModuleImportItem &Item);
3642
};
37-
}
3843

39-
namespace llvm {
4044
namespace codeview {
45+
4146
class DebugStringTableSubsection;
4247

4348
class DebugCrossModuleImportsSubsectionRef final : public DebugSubsectionRef {
44-
typedef VarStreamArray<CrossModuleImportItem> ReferenceArray;
45-
typedef ReferenceArray::Iterator Iterator;
49+
using ReferenceArray = VarStreamArray<CrossModuleImportItem>;
50+
using Iterator = ReferenceArray::Iterator;
4651

4752
public:
4853
DebugCrossModuleImportsSubsectionRef()
@@ -82,7 +87,9 @@ class DebugCrossModuleImportsSubsection final : public DebugSubsection {
8287
DebugStringTableSubsection &Strings;
8388
StringMap<std::vector<support::ulittle32_t>> Mappings;
8489
};
85-
}
86-
}
8790

88-
#endif
91+
} // end namespace codeview
92+
93+
} // end namespace llvm
94+
95+
#endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGCROSSIMPSUBSECTION_H

llvm/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,26 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#ifndef LLVM_DEBUGINFO_CODEVIEW_BUGINLINEELINESSUBSECTION_H
11-
#define LLVM_DEBUGINFO_CODEVIEW_BUGINLINEELINESSUBSECTION_H
10+
#ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGINLINEELINESSUBSECTION_H
11+
#define LLVM_DEBUGINFO_CODEVIEW_DEBUGINLINEELINESSUBSECTION_H
1212

13+
#include "llvm/ADT/StringRef.h"
14+
#include "llvm/DebugInfo/CodeView/CodeView.h"
1315
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
1416
#include "llvm/DebugInfo/CodeView/Line.h"
17+
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
1518
#include "llvm/Support/BinaryStreamArray.h"
1619
#include "llvm/Support/BinaryStreamReader.h"
20+
#include "llvm/Support/BinaryStreamRef.h"
21+
#include "llvm/Support/Endian.h"
1722
#include "llvm/Support/Error.h"
23+
#include <cstdint>
24+
#include <vector>
1825

1926
namespace llvm {
27+
2028
namespace codeview {
2129

22-
class DebugInlineeLinesSubsectionRef;
2330
class DebugChecksumsSubsection;
2431

2532
enum class InlineeLinesSignature : uint32_t {
@@ -40,18 +47,21 @@ struct InlineeSourceLine {
4047
const InlineeSourceLineHeader *Header;
4148
FixedStreamArray<support::ulittle32_t> ExtraFiles;
4249
};
43-
}
50+
51+
} // end namespace codeview
4452

4553
template <> struct VarStreamArrayExtractor<codeview::InlineeSourceLine> {
4654
Error operator()(BinaryStreamRef Stream, uint32_t &Len,
4755
codeview::InlineeSourceLine &Item);
56+
4857
bool HasExtraFiles = false;
4958
};
5059

5160
namespace codeview {
61+
5262
class DebugInlineeLinesSubsectionRef final : public DebugSubsectionRef {
53-
typedef VarStreamArray<InlineeSourceLine> LinesArray;
54-
typedef LinesArray::Iterator Iterator;
63+
using LinesArray = VarStreamArray<InlineeSourceLine>;
64+
using Iterator = LinesArray::Iterator;
5565

5666
public:
5767
DebugInlineeLinesSubsectionRef();
@@ -99,13 +109,13 @@ class DebugInlineeLinesSubsection final : public DebugSubsection {
99109

100110
private:
101111
DebugChecksumsSubsection &Checksums;
102-
103112
bool HasExtraFiles = false;
104113
uint32_t ExtraFileCount = 0;
105-
106114
std::vector<Entry> Entries;
107115
};
108-
}
109-
}
110116

111-
#endif
117+
} // end namespace codeview
118+
119+
} // end namespace llvm
120+
121+
#endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGINLINEELINESSUBSECTION_H

llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- DebugLinesSubsection.h --------------------------------*- C++ -*-===//
1+
//===- DebugLinesSubsection.h -----------------------------------*- C++ -*-===//
22
//
33
// The LLVM Compiler Infrastructure
44
//
@@ -7,14 +7,20 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10-
#ifndef LLVM_DEBUGINFO_CODEVIEW_MODULEDEBUGLINEFRAGMENT_H
11-
#define LLVM_DEBUGINFO_CODEVIEW_MODULEDEBUGLINEFRAGMENT_H
10+
#ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGLINESSUBSECTION_H
11+
#define LLVM_DEBUGINFO_CODEVIEW_DEBUGLINESSUBSECTION_H
1212

13+
#include "llvm/ADT/StringRef.h"
14+
#include "llvm/DebugInfo/CodeView/CodeView.h"
1315
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
1416
#include "llvm/DebugInfo/CodeView/Line.h"
1517
#include "llvm/Support/BinaryStreamArray.h"
1618
#include "llvm/Support/BinaryStreamReader.h"
19+
#include "llvm/Support/BinaryStreamRef.h"
20+
#include "llvm/Support/Endian.h"
1721
#include "llvm/Support/Error.h"
22+
#include <cstdint>
23+
#include <vector>
1824

1925
namespace llvm {
2026
namespace codeview {
@@ -72,8 +78,9 @@ class LineColumnExtractor {
7278

7379
class DebugLinesSubsectionRef final : public DebugSubsectionRef {
7480
friend class LineColumnExtractor;
75-
typedef VarStreamArray<LineColumnEntry, LineColumnExtractor> LineInfoArray;
76-
typedef LineInfoArray::Iterator Iterator;
81+
82+
using LineInfoArray = VarStreamArray<LineColumnEntry, LineColumnExtractor>;
83+
using Iterator = LineInfoArray::Iterator;
7784

7885
public:
7986
DebugLinesSubsectionRef();
@@ -130,14 +137,14 @@ class DebugLinesSubsection final : public DebugSubsection {
130137

131138
private:
132139
DebugChecksumsSubsection &Checksums;
133-
134140
uint32_t RelocOffset = 0;
135141
uint16_t RelocSegment = 0;
136142
uint32_t CodeSize = 0;
137143
LineFlags Flags = LF_None;
138144
std::vector<Block> Blocks;
139145
};
140-
}
141-
}
142146

143-
#endif
147+
} // end namespace codeview
148+
} // end namespace llvm
149+
150+
#endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGLINESSUBSECTION_H

llvm/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@
1212

1313
#include "llvm/ADT/StringMap.h"
1414
#include "llvm/ADT/StringRef.h"
15+
#include "llvm/DebugInfo/CodeView/CodeView.h"
1516
#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
1617
#include "llvm/Support/BinaryStreamRef.h"
1718
#include "llvm/Support/Error.h"
18-
19-
#include <stdint.h>
19+
#include <cstdint>
2020

2121
namespace llvm {
2222

2323
class BinaryStreamReader;
24-
class BinaryStreamRef;
25-
class BinaryStreamWriter;
2624

2725
namespace codeview {
2826

@@ -83,7 +81,9 @@ class DebugStringTableSubsection : public DebugSubsection {
8381
StringMap<uint32_t> Strings;
8482
uint32_t StringSize = 1;
8583
};
86-
}
87-
}
8884

89-
#endif
85+
} // end namespace codeview
86+
87+
} // end namespace llvm
88+
89+
#endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGSTRINGTABLESUBSECTION_H

0 commit comments

Comments
 (0)