================
@@ -3263,6 +3263,34 @@ def CIR_GetGlobalOp : CIR_Op<"get_global", [
}];
}
+//===----------------------------------------------------------------------===//
+// RecordAnnotationOp
+//===----------------------------------------------------------------------===//
+
+def CIR_RecordAnnotationOp : CIR_Op<"record_annotation"> {
+ let summary = "Declares the source-level annotations on a record type";
+ let description = [{
+ The `cir.record_annotation` operation records the
+ `__attribute__((annotate(...)))` attributes attached to a
+ `clang::RecordDecl` (struct/class/union). It is emitted once per annotated
+ record, since `cir::RecordType` is uniqued by name/body and does not carry
+ an op-level attribute slot the way `cir.global`/`cir.func` do.
----------------
RedNicStone wrote:
I would be probably be better to handle this as an attribute. Using the name
has a few drawbacks of course (anonymous types namely).
Because I'm using this feature in my own compiler, I was intending to keep the
change a bit more minimal. Adding `#cir.annotate` has more surface area and
would require some changes to storage uniquing (for anonymous types) and
parsing.
I'm happy to change it over to attributes of course.
https://github.com/llvm/llvm-project/pull/207551
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits