[clang] [CIR] Add CIR vtable attribute (PR #154415)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 20 11:02:05 PDT 2025


================
@@ -496,6 +496,46 @@ def CIR_GlobalViewAttr : CIR_Attr<"GlobalView", "global_view", [
   }];
 }
 
+//===----------------------------------------------------------------------===//
+// VTableAttr
+//===----------------------------------------------------------------------===//
+
+def VTableAttr : CIR_Attr<"VTable", "vtable", [TypedAttrInterface]> {
+  let summary = "Represents a C++ vtable";
+  let description = [{
+    Wraps a #cir.const_record containing vtable data.
+
+    Example:
+    ```
+    cir.global linkonce_odr @_ZTV1B = #cir.vtable<<
----------------
andykaylor wrote:

There seem to be extra brackets in this example, which may be making it harder to understand.

https://github.com/llvm/llvm-project/pull/154415


More information about the cfe-commits mailing list