[clang] Revert "[TargetVersion] Only enable on RISC-V and AArch64" (PR #117110)

Piyou Chen via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 20 20:47:51 PST 2024


https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/117110

Reverts llvm/llvm-project#115991

Due to build fail https://lab.llvm.org/buildbot/#/builders/66/builds/6511

>From e7efa82cb1362e8a2eae63fa66954327de50b88a Mon Sep 17 00:00:00 2001
From: Piyou Chen <gccbg04538 at gmail.com>
Date: Thu, 21 Nov 2024 12:47:23 +0800
Subject: [PATCH] Revert "[TargetVersion] Only enable on RISC-V and AArch64
 (#115991)"

This reverts commit 922282eacfc054ddadbec04825d6573179e66200.
---
 clang/docs/ReleaseNotes.rst                       | 2 --
 clang/include/clang/Basic/Attr.td                 | 2 +-
 clang/test/Sema/attr-target-version-unsupported.c | 4 ----
 3 files changed, 1 insertion(+), 7 deletions(-)
 delete mode 100644 clang/test/Sema/attr-target-version-unsupported.c

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index a2ff05438c949a..999c88455b64a5 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -459,8 +459,6 @@ Attribute Changes in Clang
 - Clang now supports ``[[clang::lifetime_capture_by(X)]]``. Similar to lifetimebound, this can be
   used to specify when a reference to a function parameter is captured by another capturing entity ``X``.
 
-- The ``target_version`` attribute is now only supported for AArch64 and RISC-V architectures.
-
 Improvements to Clang's diagnostics
 -----------------------------------
 
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index f1780fa1067352..634253d0032560 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -3297,7 +3297,7 @@ def Target : InheritableAttr {
   }];
 }
 
-def TargetVersion : DeclOrTypeAttr, TargetSpecificAttr<TargetArch<!listconcat(TargetAArch64.Arches, TargetRISCV.Arches)>> {
+def TargetVersion : InheritableAttr {
   let Spellings = [GCC<"target_version">];
   let Args = [StringArgument<"NamesStr">];
   let Subjects = SubjectList<[Function], ErrorDiag>;
diff --git a/clang/test/Sema/attr-target-version-unsupported.c b/clang/test/Sema/attr-target-version-unsupported.c
deleted file mode 100644
index 7cf8172f5272e6..00000000000000
--- a/clang/test/Sema/attr-target-version-unsupported.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s
-
-//expected-warning at +1 {{unknown attribute 'target_version' ignored}}
-int __attribute__((target_version("aes"))) foo(void) { return 3; }



More information about the cfe-commits mailing list