From 880057c1eee27bcfdd6a72e356832c216a5c162b 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. llvm-svn: 329000 --- clang/include/clang/Basic/LangOptions.h | 7 +++++++ clang/lib/Frontend/CompilerInvocation.cpp | 2 ++ 2 files changed, 9 insertions(+) diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h index 048ccc6..905f60a 100644 --- a/clang/include/clang/Basic/LangOptions.h +++ b/clang/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/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 84eee0e..734349e 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/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.7.4