[llvm-branch-commits] [clang] [CIR] Drop dead ceremony around the CIR enum attributes (PR #220890)
Henrich Lauko via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Sep 3 06:46:14 PDT 2026
https://github.com/xlauko updated https://github.com/llvm/llvm-project/pull/220890
>From d47900de940b7f7cab1e3e5cae1ae69b57c2c30e Mon Sep 17 00:00:00 2001
From: Henrich Lauko <hlauko at nvidia.com>
Date: Thu, 3 Sep 2026 12:44:31 +0000
Subject: [PATCH] [CIR] Drop dead ceremony around the CIR enum attributes
Five things that no longer earn their place in the CIR enum attribute
machinery.
CIR_CleanupKindAttr carried three. Its cppClassName restated the default
AttrDef already derives. Its skipDefaultBuilders plus hand-written
AttrBuilder existed only to default $value to CleanupKind::All, which no
caller relies on, so the generated builders stayed suppressed for nothing.
And its summary and description restated the name, overriding the enum's own
"cleanup kind" that EnumAttr would otherwise inherit. The isNormal, isEH and
isNormalAndEH helpers stay.
CIR_TLSModelAttr's summary restated its name the same way, so only that goes.
CIR_DefaultValuedEnumParameter has never had a user.
NFC.
---
.../include/clang/CIR/Dialect/IR/CIREnumAttr.td | 5 -----
clang/include/clang/CIR/Dialect/IR/CIROps.td | 16 ----------------
2 files changed, 21 deletions(-)
diff --git a/clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td b/clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td
index 8723ad5051ba0..ef486c6689a6a 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td
@@ -47,11 +47,6 @@ class CIR_EnumAttr<EnumInfo info, string name = "", list<Trait> traits = []>
let assemblyFormat = "`<` $value `>`";
}
-class CIR_DefaultValuedEnumParameter<EnumAttrInfo info, string value = "">
- : EnumParameter<info> {
- let defaultValue = value;
-}
-
def CIR_LangAddressSpace : CIR_I32EnumAttr<
"LangAddressSpace", "language address space kind", [
I32EnumAttrCase<"Default", 0, "default">,
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index 20026c90dfb0a..1e741d05f562d 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -1353,21 +1353,6 @@ def CIR_CleanupKind : CIR_I32EnumAttr<"CleanupKind", "cleanup kind", [
]>;
def CIR_CleanupKindAttr : CIR_EnumAttr<CIR_CleanupKind, "cleanup"> {
- let summary = "Cleanup kind attribute";
- let description = [{
- Cleanup kind attributes.
- }];
-
- let cppClassName = "CleanupKindAttr";
-
- let skipDefaultBuilders = 1;
- let builders = [
- AttrBuilder<(ins CArg<"CleanupKind",
- "cir::CleanupKind::All">:$value), [{
- return $_get($_ctxt, value);
- }]>
- ];
-
let extraClassDeclaration = [{
bool isNormal() const {
return getValue() == CleanupKind::Normal ||
@@ -3336,7 +3321,6 @@ def CIR_TLSModel : CIR_I32EnumAttr<"TLSModel", "TLS model", [
]>;
def CIR_TLSModelAttr: CIR_EnumAttr<CIR_TLSModel, "tls_model"> {
- let summary = "TLS Model attribute";
let description = [{
The TLS mode for the global, which comes from either the
`tls_model` attribute, or `-ftls-model` flag.
More information about the llvm-branch-commits
mailing list