[PATCH] D85924: [clang][feature] Add cxx_abi_relative_vtable feature

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 8 10:31:34 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG64c0792946b7: [clang][feature] Add cxx_abi_relative_vtable feature (authored by leonardchan).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85924/new/

https://reviews.llvm.org/D85924

Files:
  clang/include/clang/Basic/Features.def
  clang/test/Lexer/has_feature_cxx_abi_relative_vtable.cpp


Index: clang/test/Lexer/has_feature_cxx_abi_relative_vtable.cpp
===================================================================
--- /dev/null
+++ clang/test/Lexer/has_feature_cxx_abi_relative_vtable.cpp
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -E %s -triple x86_64-linux-gnu -x c++ -o - | FileCheck %s --check-prefix=NO-RELATIVE-VTABLE
+// RUN: %clang_cc1 -E %s -triple x86_64-linux-gnu -x c++ -fexperimental-relative-c++-abi-vtables -o - | FileCheck %s --check-prefix=RELATIVE-VTABLE
+// RUN: %clang_cc1 -E %s -triple x86_64-linux-gnu -x c++ -fno-experimental-relative-c++-abi-vtables -o - | FileCheck %s --check-prefix=NO-RELATIVE-VTABLE
+// RUN: %clang_cc1 -E %s -triple x86_64-linux-gnu -x c -fexperimental-relative-c++-abi-vtables -o - | FileCheck %s --check-prefix=NO-RELATIVE-VTABLE
+
+#if __has_feature(cxx_abi_relative_vtable)
+int has_relative_vtable();
+#else
+int has_no_relative_vtable();
+#endif
+
+// RELATIVE-VTABLE: has_relative_vtable
+// NO-RELATIVE-VTABLE: has_no_relative_vtable
Index: clang/include/clang/Basic/Features.def
===================================================================
--- clang/include/clang/Basic/Features.def
+++ clang/include/clang/Basic/Features.def
@@ -256,5 +256,7 @@
 EXTENSION(gnu_asm_goto_with_outputs, LangOpts.GNUAsm)
 EXTENSION(matrix_types, LangOpts.MatrixTypes)
 
+FEATURE(cxx_abi_relative_vtable, LangOpts.CPlusPlus && LangOpts.RelativeCXXABIVTables)
+
 #undef EXTENSION
 #undef FEATURE


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85924.297011.patch
Type: text/x-patch
Size: 1448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201008/800070aa/attachment.bin>


More information about the cfe-commits mailing list