Skip to content

Commit 9e507c8

Browse files
committed
factor header
1 parent 35f91b7 commit 9e507c8

37 files changed

+315
-147
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ void WebAssemblyAsmPrinter::emitDecls(const Module &M) {
387387
void WebAssemblyAsmPrinter::emitEndOfAsmFile(Module &M) {
388388
// This is required to emit external declarations (like .functypes) when
389389
// no functions are defined in the compilation unit and therefore,
390-
// emitDirectiveDecls() is not called until now.
390+
// emitDecls() is not called until now.
391391
emitDecls(M);
392392

393393
// When a function's address is taken, a TABLE_INDEX relocation is emitted

mlir/include/mlir/TableGen/AttrOrTypeDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "mlir/Support/LLVM.h"
1818
#include "mlir/TableGen/Builder.h"
1919
#include "mlir/TableGen/Trait.h"
20+
2021
#include "llvm/TableGen/Record.h"
2122

2223
namespace llvm {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//===- ByteCodeGen.h - Generator info ---------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef MLIR_TABLEGEN_BYTECODEGEN_H_
10+
#define MLIR_TABLEGEN_BYTECODEGEN_H_
11+
12+
#include "mlir/Support/LLVM.h"
13+
14+
#include "llvm/ADT/StringRef.h"
15+
#include "llvm/TableGen/Record.h"
16+
17+
namespace mlir::tblgen {
18+
19+
bool emitBCRW(const llvm::RecordKeeper &records, raw_ostream &os,
20+
const std::string &selectedBcDialect);
21+
22+
} // namespace mlir::tblgen
23+
24+
#endif // MLIR_TABLEGEN_BYTECODEGEN_H_
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//===- CAPIGen.h - Generator info -------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef MLIR_TABLEGEN_CAPIGEN_H_
10+
#define MLIR_TABLEGEN_CAPIGEN_H_
11+
12+
#include "mlir/Support/LLVM.h"
13+
14+
#include "llvm/ADT/StringRef.h"
15+
#include "llvm/TableGen/Record.h"
16+
17+
namespace mlir::tblgen {
18+
19+
bool emitCAPIHeader(const llvm::RecordKeeper &records, raw_ostream &os,
20+
std::string groupPrefix);
21+
bool emitCAPIImpl(const llvm::RecordKeeper &records, raw_ostream &os,
22+
std::string groupPrefix);
23+
24+
} // namespace mlir::tblgen
25+
26+
#endif // MLIR_TABLEGEN_CAPIGEN_H_

mlir/include/mlir/TableGen/DialectGenUtilities.h

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

1212
#include "mlir/Support/LLVM.h"
13+
1314
#include "llvm/Support/CommandLine.h"
15+
#include "llvm/TableGen/Record.h"
1416

1517
namespace mlir {
1618
namespace tblgen {
@@ -21,6 +23,13 @@ class Dialect;
2123
std::optional<Dialect>
2224
findDialectToGenerate(ArrayRef<Dialect> dialects,
2325
const std::string &selectedDialect);
26+
bool emitDialectDecls(const llvm::RecordKeeper &recordKeeper, raw_ostream &os,
27+
const std::string &selectedDialect);
28+
bool emitDialectDefs(const llvm::RecordKeeper &recordKeeper, raw_ostream &os,
29+
const std::string &selectedDialect);
30+
bool emitDirectiveDecls(const llvm::RecordKeeper &recordKeeper,
31+
llvm::StringRef dialect, raw_ostream &os);
32+
2433
} // namespace tblgen
2534
} // namespace mlir
2635

mlir/include/mlir/TableGen/DocGenUtilities.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define MLIR_TOOLS_MLIRTBLGEN_DOCGENUTILITIES_H_
1616

1717
#include "llvm/ADT/StringRef.h"
18+
#include "llvm/TableGen/Record.h"
1819

1920
namespace llvm {
2021
class raw_ostream;
@@ -39,6 +40,22 @@ void emitDescription(llvm::StringRef description, llvm::raw_ostream &os);
3940
void emitDescriptionComment(llvm::StringRef description, llvm::raw_ostream &os,
4041
llvm::StringRef prefix = "");
4142

43+
void emitAttrOrTypeDefDoc(const llvm::RecordKeeper &recordKeeper,
44+
llvm::raw_ostream &os,
45+
llvm::StringRef recordTypeName);
46+
47+
void emitOpDoc(const llvm::RecordKeeper &recordKeeper, llvm::raw_ostream &os,
48+
const std::string &emitOpDoc, bool allowHugoSpecificFeatures,
49+
const std::string &opIncFilter, const std::string &opExcFilter);
50+
51+
bool emitDialectDoc(const llvm::RecordKeeper &recordKeeper,
52+
llvm::raw_ostream &os, const std::string &selectedDialect,
53+
const std::string &opIncFilter,
54+
const std::string &opExcFilter,
55+
const std::string &stripPrefix,
56+
bool allowHugoSpecificFeatures);
57+
void emitDocs(const llvm::RecordKeeper &recordKeeper, llvm::raw_ostream &os);
58+
4259
} // namespace tblgen
4360
} // namespace mlir
4461

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//===- EnumGen.h - Generator info -------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef MLIR_TABLEGEN_ENUMGEN_H_
10+
#define MLIR_TABLEGEN_ENUMGEN_H_
11+
12+
#include "mlir/Support/LLVM.h"
13+
14+
#include "llvm/ADT/StringRef.h"
15+
#include "llvm/TableGen/Record.h"
16+
17+
namespace mlir::tblgen {
18+
19+
bool emitEnumDecls(const llvm::RecordKeeper &recordKeeper, raw_ostream &os);
20+
bool emitEnumDefs(const llvm::RecordKeeper &recordKeeper, raw_ostream &os);
21+
22+
} // namespace mlir::tblgen
23+
24+
#endif // MLIR_TABLEGEN_ENUMGEN_H_

mlir/include/mlir/TableGen/FormatGen.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616

1717
#include "mlir/Support/LLVM.h"
1818
#include "mlir/Support/LogicalResult.h"
19+
1920
#include "llvm/ADT/StringRef.h"
2021
#include "llvm/ADT/StringSet.h"
2122
#include "llvm/Support/Allocator.h"
2223
#include "llvm/Support/CommandLine.h"
2324
#include "llvm/Support/SMLoc.h"
25+
2426
#include <vector>
2527

2628
namespace llvm {

mlir/include/mlir/TableGen/GenInfo.h

Lines changed: 2 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
#define MLIR_TABLEGEN_GENINFO_H_
1111

1212
#include "mlir/Support/LLVM.h"
13+
1314
#include "llvm/ADT/StringRef.h"
14-
#include "llvm/Support/CommandLine.h"
15+
1516
#include <functional>
1617
#include <utility>
1718

@@ -70,87 +71,6 @@ struct GenRegistration {
7071
const GenFunction &function);
7172
};
7273

73-
namespace tblgen {
74-
bool emitBCRW(const llvm::RecordKeeper &records, raw_ostream &os,
75-
const std::string &selectedBcDialect);
76-
77-
bool emitOpDecls(const llvm::RecordKeeper &recordKeeper, raw_ostream &os,
78-
const std::string &opIncFilter, const std::string &opExcFilter,
79-
unsigned opShardCount, bool formatErrorIsFatal);
80-
bool emitOpDefs(const llvm::RecordKeeper &recordKeeper, raw_ostream &os,
81-
const std::string &opIncFilter, const std::string &opExcFilter,
82-
unsigned opShardCount, bool formatErrorIsFatal);
83-
84-
bool emitDialectDecls(const llvm::RecordKeeper &recordKeeper, raw_ostream &os,
85-
const std::string &selectedDialect);
86-
bool emitDialectDefs(const llvm::RecordKeeper &recordKeeper, raw_ostream &os,
87-
const std::string &selectedDialect);
88-
bool emitDirectiveDecls(const llvm::RecordKeeper &recordKeeper,
89-
llvm::StringRef dialect, raw_ostream &os);
90-
91-
bool emitPythonEnums(const llvm::RecordKeeper &recordKeeper, raw_ostream &os);
92-
bool emitAllPythonOps(const llvm::RecordKeeper &records, raw_ostream &os,
93-
const std::string &clDialectName,
94-
const std::string &clDialectExtensionName);
95-
96-
bool emitEnumDecls(const llvm::RecordKeeper &recordKeeper, raw_ostream &os);
97-
bool emitEnumDefs(const llvm::RecordKeeper &recordKeeper, raw_ostream &os);
98-
99-
bool emitLLVMBuilders(const llvm::RecordKeeper &recordKeeper, raw_ostream &os);
100-
bool emitLLVMOpMLIRBuilders(const llvm::RecordKeeper &recordKeeper,
101-
raw_ostream &os);
102-
bool emitLLVMIntrMLIRBuilders(const llvm::RecordKeeper &recordKeeper,
103-
raw_ostream &os);
104-
template <bool ConvertTo>
105-
bool emitLLVMEnumConversionDefs(const llvm::RecordKeeper &recordKeeper,
106-
raw_ostream &os);
107-
bool emitLLVMConvertibleIntrinsics(const llvm::RecordKeeper &recordKeeper,
108-
raw_ostream &os);
109-
bool emitLLVMIntrinsics(const llvm::RecordKeeper &records,
110-
llvm::raw_ostream &os, const std::string &nameFilter,
111-
const std::string &accessGroupRegexp,
112-
const std::string &aliasAnalysisRegexp,
113-
const std::string &opBaseClass);
114-
115-
void emitAttrOrTypeDefDoc(const llvm::RecordKeeper &recordKeeper,
116-
raw_ostream &os, StringRef recordTypeName);
117-
void emitOpDoc(const llvm::RecordKeeper &recordKeeper, raw_ostream &os,
118-
const std::string &emitOpDoc, bool allowHugoSpecificFeatures,
119-
const std::string &opIncFilter, const std::string &opExcFilter);
120-
bool emitDialectDoc(const llvm::RecordKeeper &recordKeeper, raw_ostream &os,
121-
const std::string &selectedDialect,
122-
const std::string &opIncFilter,
123-
const std::string &opExcFilter,
124-
const std::string &stripPrefix,
125-
bool allowHugoSpecificFeatures);
126-
void emitDocs(const llvm::RecordKeeper &recordKeeper, raw_ostream &os);
127-
128-
bool emitCAPIHeader(const llvm::RecordKeeper &records, raw_ostream &os,
129-
std::string groupPrefix);
130-
bool emitCAPIImpl(const llvm::RecordKeeper &records, raw_ostream &os,
131-
std::string groupPrefix);
132-
void emitPasses(const llvm::RecordKeeper &recordKeeper, raw_ostream &os,
133-
const std::string &opIncFilter, const std::string &groupName);
134-
void emitRewriters(const llvm::RecordKeeper &recordKeeper, raw_ostream &os);
135-
136-
bool emitSPIRVInterfaceDefs(const llvm::RecordKeeper &recordKeeper,
137-
raw_ostream &os);
138-
bool emitSPIRVInterfaceDecls(const llvm::RecordKeeper &recordKeeper,
139-
raw_ostream &os);
140-
bool emitSPIRVEnumDecls(const llvm::RecordKeeper &recordKeeper,
141-
raw_ostream &os);
142-
bool emitSPIRVEnumDefs(const llvm::RecordKeeper &recordKeeper, raw_ostream &os);
143-
bool emitSPIRVCapabilityImplication(const llvm::RecordKeeper &recordKeeper,
144-
raw_ostream &os);
145-
bool emitSPIRVSerializationFns(const llvm::RecordKeeper &recordKeeper,
146-
raw_ostream &os);
147-
bool emitSPIRVAttrUtils(const llvm::RecordKeeper &recordKeeper,
148-
raw_ostream &os);
149-
bool emitSPIRVAvailabilityImpl(const llvm::RecordKeeper &recordKeeper,
150-
raw_ostream &os);
151-
152-
} // namespace tblgen
153-
15474
} // namespace mlir
15575

15676
#endif // MLIR_TABLEGEN_GENINFO_H_
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//===- LLVMGen.h - Generator info -------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef MLIR_TABLEGEN_LLVMGEN_H_
10+
#define MLIR_TABLEGEN_LLVMGEN_H_
11+
12+
#include "mlir/Support/LLVM.h"
13+
14+
#include "llvm/ADT/StringRef.h"
15+
#include "llvm/TableGen/Record.h"
16+
17+
namespace mlir::tblgen {
18+
19+
bool emitLLVMBuilders(const llvm::RecordKeeper &recordKeeper, raw_ostream &os);
20+
bool emitLLVMOpMLIRBuilders(const llvm::RecordKeeper &recordKeeper,
21+
raw_ostream &os);
22+
bool emitLLVMIntrMLIRBuilders(const llvm::RecordKeeper &recordKeeper,
23+
raw_ostream &os);
24+
template <bool ConvertTo>
25+
bool emitLLVMEnumConversionDefs(const llvm::RecordKeeper &recordKeeper,
26+
raw_ostream &os);
27+
bool emitLLVMConvertibleIntrinsics(const llvm::RecordKeeper &recordKeeper,
28+
raw_ostream &os);
29+
bool emitLLVMIntrinsics(const llvm::RecordKeeper &records,
30+
llvm::raw_ostream &os, const std::string &nameFilter,
31+
const std::string &accessGroupRegexp,
32+
const std::string &aliasAnalysisRegexp,
33+
const std::string &opBaseClass);
34+
35+
} // namespace mlir::tblgen
36+
37+
#endif // MLIR_TABLEGEN_LLVMGEN_H_

0 commit comments

Comments
 (0)