From d2a393063c776b87b3183ae65dccb15634cdab48 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 2 Apr 2018 18:29:44 +0000 Subject: [PATCH] Add -fclang-abi-compat=6 flag for upcoming ABI changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329000 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/LangOptions.h | 7 +++++++ lib/Frontend/CompilerInvocation.cpp | 2 ++ 2 files changed, 9 insertions(+) diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h index 048ccc6bec..905f60ad55 100644 --- a/include/clang/Basic/LangOptions.h +++ b/include/clang/Basic/LangOptions.h @@ -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 diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 84eee0e75c..734349eed7 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -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(); -- 2.40.0