================
@@ -515,5 +515,35 @@ def BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", 
"bitfield_info"> {
   ];
 }
 
+//===----------------------------------------------------------------------===//
+// AddressPointAttr
+//===----------------------------------------------------------------------===//
+
+def AddressPointAttr : CIR_Attr<"AddressPoint", "address_point"> {
+  let summary = "Address point attribute";
+
+  let description = [{
+  Attribute specifying the address point within a C++ virtual table (vtable).
+
+  The `index` (vtable index) parameter identifies which vtable to use within a
+  vtable group, while the `offset` (address point index) specifies the offset
+  within that vtable where the address begins.
+
+  Example:
+  ```mlir
+  cir.global linkonce_odr @_ZTV1B = ...
+  ...
+  %3 = cir.vtable.address_point(@_ZTV1B, address_point = <index = 0, offset = 
2>)
+               : !cir.ptr<!cir.ptr<() -> i32>>
+  ```
----------------
xlauko wrote:

```suggestion
    Attribute specifying the address point within a C++ virtual table (vtable).

    The `index` (vtable index) parameter identifies which vtable to use within a
    vtable group, while the `offset` (address point index) specifies the offset
    within that vtable where the address begins.

    Example:
  
    ```mlir
    cir.global linkonce_odr @_ZTV1B = ...
    ...
    %3 = cir.vtable.address_point(@_ZTV1B, address_point = <index = 0, offset = 
2>)
        : !cir.ptr<!cir.ptr<() -> i32>>
    ```
```

https://github.com/llvm/llvm-project/pull/148730
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to