leonardchan created this revision.
leonardchan added reviewers: mcgrathr, phosek.
leonardchan added a project: libc++abi.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
leonardchan requested review of this revision.
This will be set if relative vtables are enabled.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85924

Files:
  clang/lib/Frontend/InitPreprocessor.cpp
  clang/test/Preprocessor/predefined-macros.c


Index: clang/test/Preprocessor/predefined-macros.c
===================================================================
--- clang/test/Preprocessor/predefined-macros.c
+++ clang/test/Preprocessor/predefined-macros.c
@@ -199,3 +199,7 @@
 // CHECK-HIP-DEV: #define __HIPCC__ 1
 // CHECK-HIP-DEV: #define __HIP_DEVICE_COMPILE__ 1
 // CHECK-HIP-DEV: #define __HIP__ 1
+
+// RUN: %clang_cc1 %s -E -dM -o - -fexperimental-relative-c++-abi-vtables \
+// RUN:   | FileCheck -match-full-lines %s 
--check-prefix=CHECK-RELATIVE-VTABLES
+// CHECK-RELATIVE-VTABLES: #define __RELATIVE_CXX_ABI_VTABLES 1
Index: clang/lib/Frontend/InitPreprocessor.cpp
===================================================================
--- clang/lib/Frontend/InitPreprocessor.cpp
+++ clang/lib/Frontend/InitPreprocessor.cpp
@@ -1124,6 +1124,9 @@
     Builder.defineMacro("__GLIBCXX_BITSIZE_INT_N_0", "128");
   }
 
+  if (LangOpts.RelativeCXXABIVTables)
+    Builder.defineMacro("__RELATIVE_CXX_ABI_VTABLES");
+
   // Get other target #defines.
   TI.getTargetDefines(LangOpts, Builder);
 }


Index: clang/test/Preprocessor/predefined-macros.c
===================================================================
--- clang/test/Preprocessor/predefined-macros.c
+++ clang/test/Preprocessor/predefined-macros.c
@@ -199,3 +199,7 @@
 // CHECK-HIP-DEV: #define __HIPCC__ 1
 // CHECK-HIP-DEV: #define __HIP_DEVICE_COMPILE__ 1
 // CHECK-HIP-DEV: #define __HIP__ 1
+
+// RUN: %clang_cc1 %s -E -dM -o - -fexperimental-relative-c++-abi-vtables \
+// RUN:   | FileCheck -match-full-lines %s --check-prefix=CHECK-RELATIVE-VTABLES
+// CHECK-RELATIVE-VTABLES: #define __RELATIVE_CXX_ABI_VTABLES 1
Index: clang/lib/Frontend/InitPreprocessor.cpp
===================================================================
--- clang/lib/Frontend/InitPreprocessor.cpp
+++ clang/lib/Frontend/InitPreprocessor.cpp
@@ -1124,6 +1124,9 @@
     Builder.defineMacro("__GLIBCXX_BITSIZE_INT_N_0", "128");
   }
 
+  if (LangOpts.RelativeCXXABIVTables)
+    Builder.defineMacro("__RELATIVE_CXX_ABI_VTABLES");
+
   // Get other target #defines.
   TI.getTargetDefines(LangOpts, Builder);
 }
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to