Skip to content

Commit 2dde5c9

Browse files
author
serge-sans-paille
committed
Cleanup llvm/utils/TableGen headers
Based on the output of include-what-you-use. It's an utility directory, so no much impact on other code areas. clang++ -E -Iinclude -I../llvm/include ../llvm/utils/TableGen/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l before: 4327274 after: 4316190 Related discourse thread: https://llvm.discourse.group/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D118466
1 parent b088237 commit 2dde5c9

18 files changed

+27
-34
lines changed

llvm/utils/TableGen/CompressInstEmitter.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
#include "CodeGenTarget.h"
7373
#include "llvm/ADT/IndexedMap.h"
7474
#include "llvm/ADT/SmallVector.h"
75-
#include "llvm/ADT/StringExtras.h"
7675
#include "llvm/ADT/StringMap.h"
7776
#include "llvm/Support/Debug.h"
7877
#include "llvm/Support/ErrorHandling.h"

llvm/utils/TableGen/GICombinerEmitter.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "llvm/Support/CommandLine.h"
2424
#include "llvm/Support/Debug.h"
2525
#include "llvm/Support/ScopedPrinter.h"
26-
#include "llvm/Support/Timer.h"
2726
#include "llvm/TableGen/Error.h"
2827
#include "llvm/TableGen/StringMatcher.h"
2928
#include "llvm/TableGen/TableGenBackend.h"

llvm/utils/TableGen/GlobalISelEmitter.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "CodeGenDAGPatterns.h"
3333
#include "SubtargetFeatureInfo.h"
3434
#include "llvm/ADT/Optional.h"
35-
#include "llvm/ADT/SmallSet.h"
3635
#include "llvm/ADT/Statistic.h"
3736
#include "llvm/Support/CodeGenCoverage.h"
3837
#include "llvm/Support/CommandLine.h"
@@ -668,7 +667,6 @@ MatchTable &operator<<(MatchTable &Table, const MatchTableRecord &Value) {
668667
class OperandMatcher;
669668
class MatchAction;
670669
class PredicateMatcher;
671-
class RuleMatcher;
672670

673671
class Matcher {
674672
public:

llvm/utils/TableGen/InfoByHwMode.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "llvm/Support/Debug.h"
1919
#include "llvm/Support/raw_ostream.h"
2020

21-
#include <set>
2221
#include <string>
2322

2423
using namespace llvm;

llvm/utils/TableGen/InfoByHwMode.h

-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020

2121
#include <map>
2222
#include <string>
23-
#include <vector>
2423

2524
namespace llvm {
2625

27-
struct CodeGenHwModes;
2826
class Record;
2927
class raw_ostream;
3028

llvm/utils/TableGen/IntrinsicEmitter.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "llvm/Support/CommandLine.h"
1919
#include "llvm/TableGen/Error.h"
2020
#include "llvm/TableGen/Record.h"
21-
#include "llvm/TableGen/StringMatcher.h"
2221
#include "llvm/TableGen/StringToOffsetTable.h"
2322
#include "llvm/TableGen/TableGenBackend.h"
2423
#include <algorithm>

llvm/utils/TableGen/OptParserEmitter.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "llvm/Support/raw_ostream.h"
1414
#include "llvm/TableGen/Record.h"
1515
#include "llvm/TableGen/TableGenBackend.h"
16-
#include <cctype>
1716
#include <cstring>
1817
#include <map>
1918
#include <memory>

llvm/utils/TableGen/OptRSTEmitter.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@
88

99
#include "OptEmitter.h"
1010
#include "llvm/ADT/STLExtras.h"
11-
#include "llvm/ADT/SmallString.h"
1211
#include "llvm/ADT/StringMap.h"
13-
#include "llvm/ADT/Twine.h"
14-
#include "llvm/TableGen/Error.h"
1512
#include "llvm/TableGen/Record.h"
16-
#include "llvm/TableGen/TableGenBackend.h"
17-
#include <cctype>
18-
#include <cstring>
19-
#include <map>
2013

2114
using namespace llvm;
2215

llvm/utils/TableGen/PredicateExpander.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
#define LLVM_UTILS_TABLEGEN_PREDICATEEXPANDER_H
1818

1919
#include "llvm/ADT/StringRef.h"
20-
#include "llvm/Support/raw_ostream.h"
21-
#include "llvm/TableGen/Record.h"
20+
#include <vector>
2221

2322
namespace llvm {
2423

2524
class raw_ostream;
25+
class Record;
2626

2727
class PredicateExpander {
2828
bool EmitCallsByRef;

llvm/utils/TableGen/RegisterBankEmitter.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "llvm/TableGen/Record.h"
1818
#include "llvm/TableGen/TableGenBackend.h"
1919

20-
#include "CodeGenHwModes.h"
2120
#include "CodeGenRegisters.h"
2221
#include "CodeGenTarget.h"
2322

llvm/utils/TableGen/SearchableTableEmitter.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
#include "llvm/ADT/ArrayRef.h"
1717
#include "llvm/ADT/DenseMap.h"
1818
#include "llvm/ADT/StringExtras.h"
19-
#include "llvm/Support/Format.h"
20-
#include "llvm/Support/MemoryBuffer.h"
21-
#include "llvm/Support/SourceMgr.h"
2219
#include "llvm/TableGen/Error.h"
2320
#include "llvm/TableGen/Record.h"
2421
#include <algorithm>
@@ -32,8 +29,6 @@ using namespace llvm;
3229

3330
namespace {
3431

35-
struct GenericTable;
36-
3732
int getAsInt(Init *B) {
3833
return cast<IntInit>(B->convertInitializerTo(IntRecTy::get()))->getValue();
3934
}

llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
//===----------------------------------------------------------------------===//
1515

1616
#include "WebAssemblyDisassemblerEmitter.h"
17+
#include "CodeGenInstruction.h"
18+
#include "llvm/ADT/STLExtras.h"
19+
#include "llvm/Support/raw_ostream.h"
1720
#include "llvm/TableGen/Record.h"
1821

1922
namespace llvm {

llvm/utils/TableGen/WebAssemblyDisassemblerEmitter.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
#ifndef LLVM_UTILS_TABLEGEN_WEBASSEMBLYDISASSEMBLEREMITTER_H
1515
#define LLVM_UTILS_TABLEGEN_WEBASSEMBLYDISASSEMBLEREMITTER_H
1616

17-
#include "CodeGenInstruction.h"
1817
#include "llvm/ADT/ArrayRef.h"
19-
#include "llvm/Support/raw_ostream.h"
2018

2119
namespace llvm {
2220

21+
class CodeGenInstruction;
22+
class raw_ostream;
23+
2324
void emitWebAssemblyDisassemblerTables(
2425
raw_ostream &OS,
2526
const ArrayRef<const CodeGenInstruction *> &NumberedInstructions);

llvm/utils/TableGen/X86DisassemblerTables.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515

1616
#include "X86DisassemblerTables.h"
1717
#include "X86DisassemblerShared.h"
18-
#include "llvm/ADT/STLExtras.h"
18+
#include "X86ModRMFilters.h"
19+
#include "llvm/ADT/STLArrayExtras.h"
20+
#include "llvm/ADT/SmallVector.h"
1921
#include "llvm/Support/ErrorHandling.h"
2022
#include "llvm/Support/Format.h"
23+
#include "llvm/Support/raw_ostream.h"
2124
#include <map>
2225

2326
using namespace llvm;

llvm/utils/TableGen/X86DisassemblerTables.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,18 @@
1717
#define LLVM_UTILS_TABLEGEN_X86DISASSEMBLERTABLES_H
1818

1919
#include "X86DisassemblerShared.h"
20-
#include "X86ModRMFilters.h"
21-
#include "llvm/Support/raw_ostream.h"
20+
#include "llvm/Support/X86DisassemblerDecoderCommon.h"
2221
#include <map>
22+
#include <memory>
2323
#include <vector>
2424

2525
namespace llvm {
26+
class raw_ostream;
2627

2728
namespace X86Disassembler {
2829

30+
class ModRMFilter;
31+
2932
/// DisassemblerTables - Encapsulates all the decode tables being generated by
3033
/// the table emitter. Contains functions to populate the tables as well as
3134
/// to emit them as hierarchical C structures suitable for consumption by the

llvm/utils/TableGen/X86FoldTablesEmitter.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ struct ManualMapEntry {
4040
: RegInstStr(RegInstStr), MemInstStr(MemInstStr), Strategy(Strategy) {}
4141
};
4242

43-
class IsMatch;
44-
4543
// List of instructions requiring explicitly aligned memory.
4644
const char *ExplicitAlign[] = {"MOVDQA", "MOVAPS", "MOVAPD", "MOVNTPS",
4745
"MOVNTPD", "MOVNTDQ", "MOVNTDQA"};

llvm/utils/TableGen/X86RecognizableInstr.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515

1616
#include "X86RecognizableInstr.h"
1717
#include "X86DisassemblerShared.h"
18+
#include "X86DisassemblerTables.h"
1819
#include "X86ModRMFilters.h"
1920
#include "llvm/Support/ErrorHandling.h"
21+
#include "llvm/TableGen/Record.h"
2022
#include <string>
2123

2224
using namespace llvm;

llvm/utils/TableGen/X86RecognizableInstr.h

+8-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@
1616
#ifndef LLVM_UTILS_TABLEGEN_X86RECOGNIZABLEINSTR_H
1717
#define LLVM_UTILS_TABLEGEN_X86RECOGNIZABLEINSTR_H
1818

19-
#include "CodeGenTarget.h"
20-
#include "X86DisassemblerTables.h"
19+
#include "CodeGenInstruction.h"
2120
#include "llvm/Support/DataTypes.h"
22-
#include "llvm/TableGen/Record.h"
21+
#include "llvm/Support/X86DisassemblerDecoderCommon.h"
22+
23+
struct InstructionSpecifier;
2324

2425
namespace llvm {
2526

27+
class Record;
28+
2629
#define X86_INSTR_MRM_MAPPING \
2730
MAP(C0, 64) \
2831
MAP(C1, 65) \
@@ -153,6 +156,8 @@ namespace X86Local {
153156

154157
namespace X86Disassembler {
155158

159+
class DisassemblerTables;
160+
156161
/// RecognizableInstr - Encapsulates all information required to decode a single
157162
/// instruction, as extracted from the LLVM instruction tables. Has methods
158163
/// to interpret the information available in the LLVM tables, and to emit the

0 commit comments

Comments
 (0)