aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrich Lauko <xlauko@mail.muni.cz>2025-07-02 17:01:59 +0200
committerGitHub <noreply@github.com>2025-07-02 17:01:59 +0200
commit3cb28e9dee41d64d25fdd2851c2e03506178a3f1 (patch)
treee3d7a5e1e9d4c076949ad09abc0e5828f03c2df0
parent242996efee4aaa30dd0ddb4359675b8bc103294a (diff)
downloadllvm-3cb28e9dee41d64d25fdd2851c2e03506178a3f1.zip
llvm-3cb28e9dee41d64d25fdd2851c2e03506178a3f1.tar.gz
llvm-3cb28e9dee41d64d25fdd2851c2e03506178a3f1.tar.bz2
[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 https://github.com/llvm/clangir/pull/1727
-rw-r--r--clang/include/clang/CIR/Dialect/IR/CIRAttrs.h22
-rw-r--r--clang/include/clang/CIR/Dialect/IR/CIRDialect.h1
2 files changed, 15 insertions, 8 deletions
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h
index 64556bc..925a9a8 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h
+++ b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h
@@ -10,16 +10,15 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H
-#define LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H
-
-#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
-#include "clang/CIR/Dialect/IR/CIRTypes.h"
+#ifndef CLANG_CIR_DIALECT_IR_CIRATTRS_H
+#define CLANG_CIR_DIALECT_IR_CIRATTRS_H
#include "mlir/IR/Attributes.h"
#include "mlir/IR/BuiltinAttributeInterfaces.h"
-#include "llvm/ADT/SmallVector.h"
+#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
+
+#include "clang/CIR/Interfaces/CIRTypeInterfaces.h"
//===----------------------------------------------------------------------===//
// CIR Dialect Attrs
@@ -27,15 +26,22 @@
namespace clang {
class FunctionDecl;
-class VarDecl;
class RecordDecl;
+class VarDecl;
} // namespace clang
namespace cir {
class ArrayType;
+class BoolType;
+class ComplexType;
+class IntType;
+class MethodType;
+class PointerType;
+class RecordType;
+class VectorType;
} // namespace cir
#define GET_ATTRDEF_CLASSES
#include "clang/CIR/Dialect/IR/CIROpsAttributes.h.inc"
-#endif // LLVM_CLANG_CIR_DIALECT_IR_CIRATTRS_H
+#endif // CLANG_CIR_DIALECT_IR_CIRATTRS_H
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRDialect.h b/clang/include/clang/CIR/Dialect/IR/CIRDialect.h
index 5de1722..fdd56ac 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRDialect.h
+++ b/clang/include/clang/CIR/Dialect/IR/CIRDialect.h
@@ -29,6 +29,7 @@
#include "clang/CIR/Dialect/IR/CIRAttrs.h"
#include "clang/CIR/Dialect/IR/CIROpsDialect.h.inc"
#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
+#include "clang/CIR/Dialect/IR/CIRTypes.h"
#include "clang/CIR/Interfaces/CIRLoopOpInterface.h"
#include "clang/CIR/Interfaces/CIROpInterfaces.h"
#include "clang/CIR/MissingFeatures.h"