Skip to content

Conversation

xlauko
Copy link
Contributor

@xlauko xlauko commented Jul 2, 2025

This will allow to use Attributes and Types together in tablegen without inducing cyclic dependency.

This mirrors incubator changes from llvm/clangir#1727

@xlauko
Copy link
Contributor Author

xlauko commented Jul 2, 2025

@xlauko xlauko mentioned this pull request Jul 2, 2025
@xlauko xlauko marked this pull request as ready for review July 2, 2025 10:18
@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels Jul 2, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 2, 2025

@llvm/pr-subscribers-clangir

Author: Henrich Lauko (xlauko)

Changes

This will allow to use Attributes and Types together in tablegen without inducing cyclic dependency.

This mirrors incubator changes from llvm/clangir#1727


Full diff: https://github.com/llvm/llvm-project/pull/146663.diff

2 Files Affected:

  • (modified) clang/include/clang/CIR/Dialect/IR/CIRAttrs.h (+14-8)
  • (modified) clang/include/clang/CIR/Dialect/IR/CIRDialect.h (+1)
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h
index 64556bcb92baa..925a9a87e267f 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 5de1722cf5bc2..fdd56ac1f218f 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"

@llvmbot
Copy link
Member

llvmbot commented Jul 2, 2025

@llvm/pr-subscribers-clang

Author: Henrich Lauko (xlauko)

Changes

This will allow to use Attributes and Types together in tablegen without inducing cyclic dependency.

This mirrors incubator changes from llvm/clangir#1727


Full diff: https://github.com/llvm/llvm-project/pull/146663.diff

2 Files Affected:

  • (modified) clang/include/clang/CIR/Dialect/IR/CIRAttrs.h (+14-8)
  • (modified) clang/include/clang/CIR/Dialect/IR/CIRDialect.h (+1)
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.h
index 64556bcb92baa..925a9a87e267f 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 5de1722cf5bc2..fdd56ac1f218f 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"

@xlauko
Copy link
Contributor Author

xlauko commented Jul 2, 2025

Merge activity

  • Jul 2, 2:25 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 2, 2:53 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 2, 2:56 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 2, 2:59 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 2, 3:02 PM UTC: @xlauko merged this pull request with Graphite.

@xlauko xlauko force-pushed the users/xlauko/cir-fp-attr-refactor branch 5 times, most recently from 842c9ca to 5d8c805 Compare July 2, 2025 14:49
Base automatically changed from users/xlauko/cir-fp-attr-refactor to main July 2, 2025 14:52
@xlauko xlauko force-pushed the users/xlauko/cir-untie-attr-and-types branch 2 times, most recently from aa3016d to 465c465 Compare July 2, 2025 14:55
This will allow to use Attributes and Types together in tablegen without inducing cyclic dependency.

This mirrors incubator changes from llvm/clangir#1727
@xlauko xlauko force-pushed the users/xlauko/cir-untie-attr-and-types branch from 465c465 to 71407d5 Compare July 2, 2025 14:59
@xlauko xlauko merged commit 3cb28e9 into main Jul 2, 2025
5 of 7 checks passed
@xlauko xlauko deleted the users/xlauko/cir-untie-attr-and-types branch July 2, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants