Skip to content

Commit b98b2e6

Browse files
committed
Clang 19 -> Clang 20
1 parent 8dd85ac commit b98b2e6

File tree

6 files changed

+25
-16
lines changed

6 files changed

+25
-16
lines changed

clang/include/clang/Basic/LangOptions.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,15 @@ class LangOptionsBase {
233233

234234
/// Attempt to be ABI-compatible with code generated by Clang 18.0.x.
235235
/// This causes clang to revert some fixes to the mangling of lambdas
236-
/// in the initializers of members of local classes and will not reuse
237-
/// tail padding on structs with potentially-overlapping members or
238-
/// oversized bit-fields under Itanium and some derived ABIs.
236+
/// in the initializers of members of local classes.
239237
Ver18,
240238

239+
/// Attempt to be ABI-compatible with code generated by Clang 19.0.x.
240+
/// This causes clang to not reuse tail padding on structs with
241+
/// potentially-overlapping members or oversized bit-fields under Itanium
242+
/// and some derived ABIs.
243+
Ver19,
244+
241245
/// Conform to the underlying platform's C and C++ ABIs as closely
242246
/// as we can.
243247
Latest

clang/lib/AST/RecordLayoutBuilder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,10 +2481,10 @@ static bool mustSkipTailPadding(const ASTContext &Context, TargetCXXABI ABI,
24812481
case TargetCXXABI::GenericMIPS:
24822482
if (!RD->isPOD())
24832483
return false;
2484-
// Prior to Clang 19, over-large bitfields and potentially overlapping
2484+
// Prior to Clang 20, over-large bitfields and potentially overlapping
24852485
// members were not checked
24862486
return (Context.getLangOpts().getClangABICompat() <=
2487-
LangOptions::ClangABI::Ver18) ||
2487+
LangOptions::ClangABI::Ver19) ||
24882488
isItaniumPOD(Context, RD);
24892489

24902490
// The same as generic Itanium but does not honor the exception about classes
@@ -2500,7 +2500,7 @@ static bool mustSkipTailPadding(const ASTContext &Context, TargetCXXABI ABI,
25002500
if (!IsCXX11PODType())
25012501
return false;
25022502
return (Context.getLangOpts().getClangABICompat() <=
2503-
LangOptions::ClangABI::Ver18) ||
2503+
LangOptions::ClangABI::Ver19) ||
25042504
isItaniumPOD(Context, RD);
25052505

25062506
// Also use C++11 POD but without honoring the exception about classes with

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3796,6 +3796,9 @@ void CompilerInvocationBase::GenerateLangArgs(const LangOptions &Opts,
37963796
case LangOptions::ClangABI::Ver18:
37973797
GenerateArg(Consumer, OPT_fclang_abi_compat_EQ, "18.0");
37983798
break;
3799+
case LangOptions::ClangABI::Ver19:
3800+
GenerateArg(Consumer, OPT_fclang_abi_compat_EQ, "19.0");
3801+
break;
37993802
case LangOptions::ClangABI::Latest:
38003803
break;
38013804
}
@@ -4305,6 +4308,8 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
43054308
Opts.setClangABICompat(LangOptions::ClangABI::Ver17);
43064309
else if (Major <= 18)
43074310
Opts.setClangABICompat(LangOptions::ClangABI::Ver18);
4311+
else if (Major <= 19)
4312+
Opts.setClangABICompat(LangOptions::ClangABI::Ver19);
43084313
} else if (Ver != "latest") {
43094314
Diags.Report(diag::err_drv_invalid_value)
43104315
<< A->getAsString(Args) << A->getValue();

clang/test/CodeGenCXX/bitfield-layout.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// RUN: %clang_cc1 %s -triple=aarch64_be -emit-llvm -o - -O3 | FileCheck --check-prefix=CHECK --check-prefix=NEW %s --allow-unused-prefixes
44
// RUN: %clang_cc1 %s -triple=thumbv7_be-none-eabi -emit-llvm -o - -O3 | FileCheck --check-prefix=CHECK --check-prefix=NEW %s --allow-unused-prefixes
55
// RUN: %clang_cc1 %s -triple=x86_64-unknown-unknown -emit-llvm -o - -O3 -std=c++11 | FileCheck -check-prefix=CHECK -check-prefix=CHECK-LP64 --check-prefix=NEW --check-prefix=NEW-LP64 %s --allow-unused-prefixes
6-
// RUN: %clang_cc1 %s -fclang-abi-compat=18.0 -triple=x86_64-apple-darwin10 -emit-llvm -o - -O3 | FileCheck -check-prefix=CHECK -check-prefix=CHECK-LP64 --check-prefix=OLD --check-prefix=OLD-LP64 %s --allow-unused-prefixes
7-
// RUN: %clang_cc1 %s -fclang-abi-compat=18.0 -triple=i386-apple-darwin10 -emit-llvm -o - -O3 | FileCheck --check-prefix=CHECK --check-prefix=OLD %s --allow-unused-prefixes
8-
// RUN: %clang_cc1 %s -fclang-abi-compat=18.0 -triple=aarch64_be -emit-llvm -o - -O3 | FileCheck --check-prefix=CHECK --check-prefix=OLD %s --allow-unused-prefixes
9-
// RUN: %clang_cc1 %s -fclang-abi-compat=18.0 -triple=thumbv7_be-none-eabi -emit-llvm -o - -O3 | FileCheck --check-prefix=CHECK --check-prefix=OLD %s --allow-unused-prefixes
10-
// RUN: %clang_cc1 %s -fclang-abi-compat=18.0 -triple=x86_64-unknown-unknown -emit-llvm -o - -O3 -std=c++11 | FileCheck -check-prefix=CHECK -check-prefix=CHECK-LP64 --check-prefix=OLD --check-prefix=OLD-LP64 %s --allow-unused-prefixes
6+
// RUN: %clang_cc1 %s -fclang-abi-compat=19.0 -triple=x86_64-apple-darwin10 -emit-llvm -o - -O3 | FileCheck -check-prefix=CHECK -check-prefix=CHECK-LP64 --check-prefix=OLD --check-prefix=OLD-LP64 %s --allow-unused-prefixes
7+
// RUN: %clang_cc1 %s -fclang-abi-compat=19.0 -triple=i386-apple-darwin10 -emit-llvm -o - -O3 | FileCheck --check-prefix=CHECK --check-prefix=OLD %s --allow-unused-prefixes
8+
// RUN: %clang_cc1 %s -fclang-abi-compat=19.0 -triple=aarch64_be -emit-llvm -o - -O3 | FileCheck --check-prefix=CHECK --check-prefix=OLD %s --allow-unused-prefixes
9+
// RUN: %clang_cc1 %s -fclang-abi-compat=19.0 -triple=thumbv7_be-none-eabi -emit-llvm -o - -O3 | FileCheck --check-prefix=CHECK --check-prefix=OLD %s --allow-unused-prefixes
10+
// RUN: %clang_cc1 %s -fclang-abi-compat=19.0 -triple=x86_64-unknown-unknown -emit-llvm -o - -O3 -std=c++11 | FileCheck -check-prefix=CHECK -check-prefix=CHECK-LP64 --check-prefix=OLD --check-prefix=OLD-LP64 %s --allow-unused-prefixes
1111

1212
// OLD-LP64: %union.Test1 = type { i32, [4 x i8] }
1313
// NEW-LP64: %union.Test1 = type <{ i32, [4 x i8] }>

clang/test/CodeGenCXX/no-unique-address.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %clang_cc1 -std=c++2a %s -emit-llvm -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK --check-prefix=NEW --allow-unused-prefixes
2-
// RUN: %clang_cc1 -std=c++2a %s -emit-llvm -o - -triple x86_64-linux-gnu -O2 -disable-llvm-passes | FileCheck %s --check-prefix=CHECK-OPT --check-prefix=NEW-OPT --allow-unused-prefixes
3-
// RUN: %clang_cc1 -fclang-abi-compat=18.0 -std=c++2a %s -emit-llvm -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK --check-prefix=OLD --allow-unused-prefixes
4-
// RUN: %clang_cc1 -fclang-abi-compat=18.0 -std=c++2a %s -emit-llvm -o - -triple x86_64-linux-gnu -O2 -disable-llvm-passes | FileCheck %s --check-prefix=CHECK-OPT --check-prefix=OLD-OPT --allow-unused-prefixes
1+
// RUN: %clang_cc1 -std=c++20 %s -emit-llvm -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,NEW --allow-unused-prefixes
2+
// RUN: %clang_cc1 -std=c++20 %s -emit-llvm -o - -triple x86_64-linux-gnu -O2 -disable-llvm-passes | FileCheck %s --check-prefixes=CHECK-OPT,NEW-OPT --allow-unused-prefixes
3+
// RUN: %clang_cc1 -fclang-abi-compat=19.0 -std=c++20 %s -emit-llvm -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,OLD --allow-unused-prefixes
4+
// RUN: %clang_cc1 -fclang-abi-compat=19.0 -std=c++20 %s -emit-llvm -o - -triple x86_64-linux-gnu -O2 -disable-llvm-passes | FileCheck %s --check-prefixes=CHECK-OPT,OLD-OPT --allow-unused-prefixes
55

66
struct A { ~A(); int n; char c[3]; };
77
struct B { [[no_unique_address]] A a; char k; };

clang/test/Layout/no-unique-address.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -std=c++2a -fsyntax-only -triple x86_64-linux-gnu -fdump-record-layouts %s | FileCheck %s --check-prefix=NEW --check-prefix=CHECK
2-
// RUN: %clang_cc1 -fclang-abi-compat=18.0 -DOLD_ABI=1 -std=c++2a -fsyntax-only -triple x86_64-linux-gnu -fdump-record-layouts %s | FileCheck %s --check-prefix=OLD --check-prefix=CHECK
2+
// RUN: %clang_cc1 -fclang-abi-compat=19.0 -DOLD_ABI=1 -std=c++2a -fsyntax-only -triple x86_64-linux-gnu -fdump-record-layouts %s | FileCheck %s --check-prefix=OLD --check-prefix=CHECK
33

44
namespace Empty {
55
struct A {};

0 commit comments

Comments
 (0)