Skip to content

Commit ec6da06

Browse files
committed
Apply clang-tidy fixes for misc-include-cleaner in MLIR examples
1 parent fd06155 commit ec6da06

36 files changed

+345
-29
lines changed

mlir/examples/toy/Ch2/toyc.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,19 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#include "toy/AST.h"
1314
#include "toy/Dialect.h"
15+
#include "toy/Lexer.h"
1416
#include "toy/MLIRGen.h"
1517
#include "toy/Parser.h"
1618
#include <memory>
19+
#include <string>
20+
#include <system_error>
21+
#include <utility>
1722

1823
#include "mlir/IR/AsmState.h"
1924
#include "mlir/IR/BuiltinOps.h"
2025
#include "mlir/IR/MLIRContext.h"
21-
#include "mlir/IR/Verifier.h"
2226
#include "mlir/Parser/Parser.h"
2327

2428
#include "llvm/ADT/StringRef.h"

mlir/examples/toy/Ch3/mlir/Dialect.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,22 @@
1313

1414
#include "toy/Dialect.h"
1515

16+
#include "mlir/IR/Attributes.h"
1617
#include "mlir/IR/Builders.h"
1718
#include "mlir/IR/BuiltinTypes.h"
1819
#include "mlir/IR/OpImplementation.h"
20+
#include "mlir/IR/Operation.h"
21+
#include "mlir/IR/OperationSupport.h"
22+
#include "mlir/IR/Value.h"
1923
#include "mlir/Interfaces/FunctionImplementation.h"
24+
#include "mlir/Support/LLVM.h"
25+
#include "mlir/Support/LogicalResult.h"
26+
#include "llvm/ADT/ArrayRef.h"
27+
#include "llvm/ADT/STLExtras.h"
28+
#include "llvm/ADT/StringRef.h"
29+
#include "llvm/Support/Casting.h"
30+
#include <algorithm>
31+
#include <string>
2032

2133
using namespace mlir;
2234
using namespace mlir::toy;

mlir/examples/toy/Ch3/mlir/MLIRGen.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,31 @@
1212
//===----------------------------------------------------------------------===//
1313

1414
#include "toy/MLIRGen.h"
15+
#include "mlir/IR/Block.h"
16+
#include "mlir/IR/Diagnostics.h"
17+
#include "mlir/IR/Value.h"
18+
#include "mlir/Support/LogicalResult.h"
1519
#include "toy/AST.h"
1620
#include "toy/Dialect.h"
1721

18-
#include "mlir/IR/Attributes.h"
1922
#include "mlir/IR/Builders.h"
2023
#include "mlir/IR/BuiltinOps.h"
2124
#include "mlir/IR/BuiltinTypes.h"
2225
#include "mlir/IR/MLIRContext.h"
2326
#include "mlir/IR/Verifier.h"
27+
#include "toy/Lexer.h"
2428

2529
#include "llvm/ADT/STLExtras.h"
2630
#include "llvm/ADT/ScopedHashTable.h"
27-
#include "llvm/Support/raw_ostream.h"
31+
#include "llvm/ADT/SmallVector.h"
32+
#include "llvm/ADT/StringRef.h"
33+
#include "llvm/ADT/Twine.h"
34+
#include <cassert>
35+
#include <cstdint>
36+
#include <functional>
2837
#include <numeric>
38+
#include <optional>
39+
#include <vector>
2940

3041
using namespace mlir::toy;
3142
using namespace toy;

mlir/examples/toy/Ch3/mlir/ToyCombine.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#include "mlir/IR/Matchers.h"
14+
#include "mlir/IR/MLIRContext.h"
1515
#include "mlir/IR/PatternMatch.h"
16+
#include "mlir/IR/Value.h"
17+
#include "mlir/Support/LogicalResult.h"
1618
#include "toy/Dialect.h"
17-
#include <numeric>
1819
using namespace mlir;
1920
using namespace toy;
2021

mlir/examples/toy/Ch3/parser/AST.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212

1313
#include "toy/AST.h"
1414

15+
#include "llvm/ADT/STLExtras.h"
1516
#include "llvm/ADT/Twine.h"
1617
#include "llvm/ADT/TypeSwitch.h"
18+
#include "llvm/Support/Casting.h"
1719
#include "llvm/Support/raw_ostream.h"
20+
#include <string>
1821

1922
using namespace toy;
2023

mlir/examples/toy/Ch3/toyc.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#include "mlir/IR/Diagnostics.h"
14+
#include "mlir/Support/LogicalResult.h"
15+
#include "toy/AST.h"
1316
#include "toy/Dialect.h"
17+
#include "toy/Lexer.h"
1418
#include "toy/MLIRGen.h"
1519
#include "toy/Parser.h"
1620

@@ -19,7 +23,6 @@
1923
#include "mlir/IR/MLIRContext.h"
2024
#include "mlir/IR/Verifier.h"
2125
#include "mlir/Parser/Parser.h"
22-
#include "mlir/Pass/Pass.h"
2326
#include "mlir/Pass/PassManager.h"
2427
#include "mlir/Transforms/Passes.h"
2528

@@ -29,6 +32,10 @@
2932
#include "llvm/Support/MemoryBuffer.h"
3033
#include "llvm/Support/SourceMgr.h"
3134
#include "llvm/Support/raw_ostream.h"
35+
#include <memory>
36+
#include <string>
37+
#include <system_error>
38+
#include <utility>
3239

3340
using namespace toy;
3441
namespace cl = llvm::cl;

mlir/examples/toy/Ch4/mlir/Dialect.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,26 @@
1313

1414
#include "toy/Dialect.h"
1515

16+
#include "mlir/IR/Attributes.h"
1617
#include "mlir/IR/Builders.h"
1718
#include "mlir/IR/BuiltinTypes.h"
19+
#include "mlir/IR/Location.h"
1820
#include "mlir/IR/OpImplementation.h"
21+
#include "mlir/IR/OperationSupport.h"
22+
#include "mlir/IR/ValueRange.h"
23+
#include "mlir/Interfaces/CallInterfaces.h"
1924
#include "mlir/Interfaces/FunctionImplementation.h"
25+
#include "mlir/Support/LLVM.h"
26+
#include "mlir/Support/LogicalResult.h"
2027
#include "mlir/Transforms/InliningUtils.h"
28+
#include "llvm/ADT/ArrayRef.h"
29+
#include "llvm/ADT/STLExtras.h"
30+
#include "llvm/ADT/StringRef.h"
31+
#include "llvm/Support/Casting.h"
32+
#include <algorithm>
33+
#include <cassert>
34+
#include <cstdint>
35+
#include <string>
2136

2237
using namespace mlir;
2338
using namespace mlir::toy;

mlir/examples/toy/Ch4/mlir/MLIRGen.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,31 @@
1212
//===----------------------------------------------------------------------===//
1313

1414
#include "toy/MLIRGen.h"
15+
#include "mlir/IR/Block.h"
16+
#include "mlir/IR/Diagnostics.h"
17+
#include "mlir/IR/Value.h"
18+
#include "mlir/Support/LogicalResult.h"
1519
#include "toy/AST.h"
1620
#include "toy/Dialect.h"
1721

18-
#include "mlir/IR/Attributes.h"
1922
#include "mlir/IR/Builders.h"
2023
#include "mlir/IR/BuiltinOps.h"
2124
#include "mlir/IR/BuiltinTypes.h"
2225
#include "mlir/IR/MLIRContext.h"
2326
#include "mlir/IR/Verifier.h"
27+
#include "toy/Lexer.h"
2428

2529
#include "llvm/ADT/STLExtras.h"
2630
#include "llvm/ADT/ScopedHashTable.h"
27-
#include "llvm/Support/raw_ostream.h"
31+
#include "llvm/ADT/SmallVector.h"
32+
#include "llvm/ADT/StringRef.h"
33+
#include "llvm/ADT/Twine.h"
34+
#include <cassert>
35+
#include <cstdint>
36+
#include <functional>
2837
#include <numeric>
38+
#include <optional>
39+
#include <vector>
2940

3041
using namespace mlir::toy;
3142
using namespace toy;

mlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14+
#include "mlir/IR/BuiltinTypes.h"
15+
#include "mlir/IR/Operation.h"
16+
#include "mlir/IR/Types.h"
1417
#include "mlir/Pass/Pass.h"
18+
#include "mlir/Support/LLVM.h"
19+
#include "mlir/Support/TypeID.h"
1520
#include "toy/Dialect.h"
1621
#include "toy/Passes.h"
1722
#include "toy/ShapeInferenceInterface.h"
23+
#include "llvm/ADT/STLExtras.h"
1824
#include "llvm/ADT/SmallPtrSet.h"
25+
#include "llvm/Support/Casting.h"
1926
#include "llvm/Support/Debug.h"
2027
#include "llvm/Support/raw_ostream.h"
28+
#include <memory>
2129

2230
#define DEBUG_TYPE "shape-inference"
2331

mlir/examples/toy/Ch4/mlir/ToyCombine.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#include "mlir/IR/Matchers.h"
14+
#include "mlir/IR/MLIRContext.h"
1515
#include "mlir/IR/PatternMatch.h"
16+
#include "mlir/IR/Value.h"
17+
#include "mlir/Support/LogicalResult.h"
1618
#include "toy/Dialect.h"
17-
#include <numeric>
1819
using namespace mlir;
1920
using namespace toy;
2021

0 commit comments

Comments
 (0)