]> granicus.if.org Git - clang/commitdiff
Add -fclang-abi-compat=6 flag for upcoming ABI changes.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 2 Apr 2018 18:29:44 +0000 (18:29 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 2 Apr 2018 18:29:44 +0000 (18:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329000 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/LangOptions.h
lib/Frontend/CompilerInvocation.cpp

index 048ccc6bec874129ffb83644e0c942ce47947efb..905f60ad552aea0f8468f04e321e2af091b0f303 100644 (file)
@@ -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
index 84eee0e75cdfd6c9db9adf1ae959dbe909f8c001..734349eed7ac04fa22646695c3dfe4bc027406a8 100644 (file)
@@ -2665,6 +2665,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
         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();