r329000 - Add -fclang-abi-compat=6 flag for upcoming ABI changes.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 2 11:29:44 PDT 2018


Author: rsmith
Date: Mon Apr  2 11:29:44 2018
New Revision: 329000

URL: http://llvm.org/viewvc/llvm-project?rev=329000&view=rev
Log:
Add -fclang-abi-compat=6 flag for upcoming ABI changes.

Modified:
    cfe/trunk/include/clang/Basic/LangOptions.h
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/include/clang/Basic/LangOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/LangOptions.h?rev=329000&r1=328999&r2=329000&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/LangOptions.h (original)
+++ cfe/trunk/include/clang/Basic/LangOptions.h Mon Apr  2 11:29:44 2018
@@ -114,6 +114,13 @@ public:
     /// determining whether a class type can be passed or returned directly.
     Ver4,
 
+    /// Attempt to be ABI-compatible with code generated by Clang 6.0.x
+    /// (SVN r321711). This causes determination of whether a type is
+    /// standard-layout to ignore collisions between empty base classes
+    /// and between base classes and member subobjects, which affects
+    /// whether we reuse base class tail padding in some ABIs.
+    Ver6,
+
     /// Conform to the underlying platform's C and C++ ABIs as closely
     /// as we can.
     Latest

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=329000&r1=328999&r2=329000&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Apr  2 11:29:44 2018
@@ -2665,6 +2665,8 @@ static void ParseLangArgs(LangOptions &O
         Opts.setClangABICompat(LangOptions::ClangABI::Ver3_8);
       else if (Major <= 4)
         Opts.setClangABICompat(LangOptions::ClangABI::Ver4);
+      else if (Major <= 6)
+        Opts.setClangABICompat(LangOptions::ClangABI::Ver6);
     } else if (Ver != "latest") {
       Diags.Report(diag::err_drv_invalid_value)
           << A->getAsString(Args) << A->getValue();




More information about the cfe-commits mailing list