Skip to content

Commit 3cb28e9

Browse files
authored
[CIR] Untie Type and Attribute definitions (#146663)
This will allow to use Attributes and Types together in tablegen without inducing cyclic dependency. This mirrors incubator changes from llvm/clangir#1727
1 parent 242996e commit 3cb28e9

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

clang/include/clang/CIR/Dialect/IR/CIRAttrs.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,38 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H
14-
#define LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H
15-
16-
#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
17-
#include "clang/CIR/Dialect/IR/CIRTypes.h"
13+
#ifndef CLANG_CIR_DIALECT_IR_CIRATTRS_H
14+
#define CLANG_CIR_DIALECT_IR_CIRATTRS_H
1815

1916
#include "mlir/IR/Attributes.h"
2017
#include "mlir/IR/BuiltinAttributeInterfaces.h"
2118

22-
#include "llvm/ADT/SmallVector.h"
19+
#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
20+
21+
#include "clang/CIR/Interfaces/CIRTypeInterfaces.h"
2322

2423
//===----------------------------------------------------------------------===//
2524
// CIR Dialect Attrs
2625
//===----------------------------------------------------------------------===//
2726

2827
namespace clang {
2928
class FunctionDecl;
30-
class VarDecl;
3129
class RecordDecl;
30+
class VarDecl;
3231
} // namespace clang
3332

3433
namespace cir {
3534
class ArrayType;
35+
class BoolType;
36+
class ComplexType;
37+
class IntType;
38+
class MethodType;
39+
class PointerType;
40+
class RecordType;
41+
class VectorType;
3642
} // namespace cir
3743

3844
#define GET_ATTRDEF_CLASSES
3945
#include "clang/CIR/Dialect/IR/CIROpsAttributes.h.inc"
4046

41-
#endif // LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H
47+
#endif // CLANG_CIR_DIALECT_IR_CIRATTRS_H

clang/include/clang/CIR/Dialect/IR/CIRDialect.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "clang/CIR/Dialect/IR/CIRAttrs.h"
3030
#include "clang/CIR/Dialect/IR/CIROpsDialect.h.inc"
3131
#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
32+
#include "clang/CIR/Dialect/IR/CIRTypes.h"
3233
#include "clang/CIR/Interfaces/CIRLoopOpInterface.h"
3334
#include "clang/CIR/Interfaces/CIROpInterfaces.h"
3435
#include "clang/CIR/MissingFeatures.h"

0 commit comments

Comments
 (0)