Skip to content

[clang] Remove the experimental prefix from -fexperimental-relative-c++-abi-vtables #142845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PiJoules
Copy link
Contributor

@PiJoules PiJoules commented Jun 4, 2025

This actually creates an alias to the original flag omitting the experimental part. This has been in prod use for a while and isn't necessary.

@PiJoules PiJoules requested a review from petrhosek June 4, 2025 20:27
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Jun 4, 2025
@PiJoules PiJoules requested a review from AaronBallman June 4, 2025 20:27
@llvmbot
Copy link
Member

llvmbot commented Jun 4, 2025

@llvm/pr-subscribers-clang

Author: None (PiJoules)

Changes

This actually creates an alias to the original flag omitting the experimental part. This has been in prod use for a while and isn't necessary.


Full diff: https://github.com/llvm/llvm-project/pull/142845.diff

2 Files Affected:

  • (modified) clang/include/clang/Driver/Options.td (+13-8)
  • (modified) clang/test/Driver/relative-vtables-flag.cpp (+2)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 5ca31c253ed8f..73c5424d4f0ae 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -2996,14 +2996,19 @@ defm fine_grained_bitfield_accesses : BoolOption<"f", "fine-grained-bitfield-acc
   BothFlags<[], [ClangOption, CC1Option]>>,
   Group<f_clang_Group>;
 
-def fexperimental_relative_cxx_abi_vtables :
-  Flag<["-"], "fexperimental-relative-c++-abi-vtables">,
-  Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
-  HelpText<"Use the experimental C++ class ABI for classes with virtual tables">;
-def fno_experimental_relative_cxx_abi_vtables :
-  Flag<["-"], "fno-experimental-relative-c++-abi-vtables">,
-  Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
-  HelpText<"Do not use the experimental C++ class ABI for classes with virtual tables">;
+defm experimental_relative_cxx_abi_vtables
+    : BoolFOption<
+          "experimental-relative-c++-abi-vtables",
+          LangOpts<"RelativeCXXABIVTables">, DefaultFalse,
+          PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use ">,
+          NegFlag<SetFalse, [], [ClangOption, CC1Option], "Do not use ">,
+          BothFlags<[], [ClangOption, CC1Option],
+                    " the experimental C++ class ABI for classes with virtual "
+                    "tables">>;
+def : Flag<["-"], "frelative-c++-abi-vtables">,
+      Alias<fexperimental_relative_cxx_abi_vtables>;
+def : Flag<["-"], "fno-relative-c++-abi-vtables">,
+      Alias<fno_experimental_relative_cxx_abi_vtables>;
 
 defm experimental_omit_vtable_rtti : BoolFOption<"experimental-omit-vtable-rtti",
   LangOpts<"OmitVTableRTTI">, DefaultFalse,
diff --git a/clang/test/Driver/relative-vtables-flag.cpp b/clang/test/Driver/relative-vtables-flag.cpp
index 1253809e1d428..2a38679135459 100644
--- a/clang/test/Driver/relative-vtables-flag.cpp
+++ b/clang/test/Driver/relative-vtables-flag.cpp
@@ -2,6 +2,8 @@
 // RUN: %clangxx --target=aarch64-unknown-fuchsia -fno-experimental-relative-c++-abi-vtables -c %s -### 2>&1 | FileCheck %s --check-prefix=NO-RV
 // RUN: %clangxx --target=aarch64-unknown-fuchsia -c %s -### 2>&1 | FileCheck %s --check-prefix=NO-RV
 // RUN: %clangxx --target=aarch64-unknown-linux-gnu -c %s -### 2>&1 | FileCheck %s --check-prefix=NO-RV
+// RUN: %clangxx --target=aarch64-unknown-fuchsia -frelative-c++-abi-vtables -c %s -### 2>&1 | FileCheck %s --check-prefix=RV
+// RUN: %clangxx --target=aarch64-unknown-fuchsia -fno-relative-c++-abi-vtables -c %s -### 2>&1 | FileCheck %s --check-prefix=NO-RV
 
 // RV: "-fexperimental-relative-c++-abi-vtables"
 // NO-RV-NOT: "-fexperimental-relative-c++-abi-vtables"

@llvmbot
Copy link
Member

llvmbot commented Jun 4, 2025

@llvm/pr-subscribers-clang-driver

Author: None (PiJoules)

Changes

This actually creates an alias to the original flag omitting the experimental part. This has been in prod use for a while and isn't necessary.


Full diff: https://github.com/llvm/llvm-project/pull/142845.diff

2 Files Affected:

  • (modified) clang/include/clang/Driver/Options.td (+13-8)
  • (modified) clang/test/Driver/relative-vtables-flag.cpp (+2)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 5ca31c253ed8f..73c5424d4f0ae 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -2996,14 +2996,19 @@ defm fine_grained_bitfield_accesses : BoolOption<"f", "fine-grained-bitfield-acc
   BothFlags<[], [ClangOption, CC1Option]>>,
   Group<f_clang_Group>;
 
-def fexperimental_relative_cxx_abi_vtables :
-  Flag<["-"], "fexperimental-relative-c++-abi-vtables">,
-  Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
-  HelpText<"Use the experimental C++ class ABI for classes with virtual tables">;
-def fno_experimental_relative_cxx_abi_vtables :
-  Flag<["-"], "fno-experimental-relative-c++-abi-vtables">,
-  Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
-  HelpText<"Do not use the experimental C++ class ABI for classes with virtual tables">;
+defm experimental_relative_cxx_abi_vtables
+    : BoolFOption<
+          "experimental-relative-c++-abi-vtables",
+          LangOpts<"RelativeCXXABIVTables">, DefaultFalse,
+          PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use ">,
+          NegFlag<SetFalse, [], [ClangOption, CC1Option], "Do not use ">,
+          BothFlags<[], [ClangOption, CC1Option],
+                    " the experimental C++ class ABI for classes with virtual "
+                    "tables">>;
+def : Flag<["-"], "frelative-c++-abi-vtables">,
+      Alias<fexperimental_relative_cxx_abi_vtables>;
+def : Flag<["-"], "fno-relative-c++-abi-vtables">,
+      Alias<fno_experimental_relative_cxx_abi_vtables>;
 
 defm experimental_omit_vtable_rtti : BoolFOption<"experimental-omit-vtable-rtti",
   LangOpts<"OmitVTableRTTI">, DefaultFalse,
diff --git a/clang/test/Driver/relative-vtables-flag.cpp b/clang/test/Driver/relative-vtables-flag.cpp
index 1253809e1d428..2a38679135459 100644
--- a/clang/test/Driver/relative-vtables-flag.cpp
+++ b/clang/test/Driver/relative-vtables-flag.cpp
@@ -2,6 +2,8 @@
 // RUN: %clangxx --target=aarch64-unknown-fuchsia -fno-experimental-relative-c++-abi-vtables -c %s -### 2>&1 | FileCheck %s --check-prefix=NO-RV
 // RUN: %clangxx --target=aarch64-unknown-fuchsia -c %s -### 2>&1 | FileCheck %s --check-prefix=NO-RV
 // RUN: %clangxx --target=aarch64-unknown-linux-gnu -c %s -### 2>&1 | FileCheck %s --check-prefix=NO-RV
+// RUN: %clangxx --target=aarch64-unknown-fuchsia -frelative-c++-abi-vtables -c %s -### 2>&1 | FileCheck %s --check-prefix=RV
+// RUN: %clangxx --target=aarch64-unknown-fuchsia -fno-relative-c++-abi-vtables -c %s -### 2>&1 | FileCheck %s --check-prefix=NO-RV
 
 // RV: "-fexperimental-relative-c++-abi-vtables"
 // NO-RV-NOT: "-fexperimental-relative-c++-abi-vtables"

…++-abi-vtables

This actually creates an alias to the original flag omitting the
experimental part. This has been in prod use for a while and isn't
necessary.
@PiJoules PiJoules force-pushed the non-experimental-rel-vtables-flag branch from 676b29c to 7cf215d Compare June 4, 2025 20:29
Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes should come with a release note to let the users know this is no longer experimental.

That said, I think we're still missing something for this to no longer be experimental: documentation. I can't find any mention of this flag in LanguageExtensions.rst and I think users would appreciate an explanation of why this feature should be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants