Skip to content

Commit 44cf58f

Browse files
author
git apple-llvm automerger
committed
Merge commit 'f3274059e0a1' from swift/release/6.2 into stable/20240723
2 parents 853e90d + f327405 commit 44cf58f

File tree

747 files changed

+949
-953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

747 files changed

+949
-953
lines changed

clang/include/clang/Basic/DiagnosticFrontendKinds.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,15 +377,15 @@ def err_bounds_safety_attributes_cannot_be_disabled : Error<
377377
def err_bounds_safety_initializer_out_of_range : Error<
378378
"initializing value is out of valid range">;
379379

380-
def warn_bounds_attributes_cxx_experimental_ignored : Warning<
381-
"-fbounds-attributes-cxx-experimental without -fbounds-attributes is "
380+
def warn_bounds_safety_cxx_experimental_ignored : Warning<
381+
"-fexperimental-bounds-safety-cxx without -fbounds-safety is "
382382
"ignored">,
383-
InGroup<BoundsAttributesCXXExperimentalIgnored>;
383+
InGroup<BoundsSafetyCXXExperimentalIgnored>;
384384

385-
def warn_bounds_attributes_objc_experimental_ignored : Warning<
386-
"-fbounds-attributes-objc-experimental without -fbounds-attributes is "
385+
def warn_bounds_safety_objc_experimental_ignored : Warning<
386+
"-fexperimental-bounds-safety-objc without -fbounds-safety is "
387387
"ignored">,
388-
InGroup<BoundsAttributesObjCExperimentalIgnored>;
388+
InGroup<BoundsSafetyObjCExperimentalIgnored>;
389389

390390
def warn_bounds_safety_relaxed_system_headers_ignored : Warning<
391391
"-fno-bounds-safety-relaxed-system-headers without -fbounds-safety is "

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,10 +1487,10 @@ def BoundsSafetyInitList : DiagGroup<"bounds-safety-init-list">;
14871487
def BoundsAttributesExternArrayCount : DiagGroup<"bounds-attributes-extern-array-count">;
14881488
def BoundsAttributesInitSideEffect
14891489
: DiagGroup<"bounds-attributes-init-list-side-effect">;
1490-
def BoundsAttributesCXXExperimentalIgnored
1491-
: DiagGroup<"bounds-attributes-cxx-experimental-ignored">;
1492-
def BoundsAttributesObjCExperimentalIgnored
1493-
: DiagGroup<"bounds-attributes-objc-experimental-ignored">;
1490+
def BoundsSafetyCXXExperimentalIgnored
1491+
: DiagGroup<"experimental-bounds-safety-cxx-ignored">;
1492+
def BoundsSafetyObjCExperimentalIgnored
1493+
: DiagGroup<"experimental-bounds-safety-objc-ignored">;
14941494
def BoundsSafetyRelaxedSystemHeadersIgnored
14951495
: DiagGroup<"bounds-safety-relaxed-system-headers-ignore">;
14961496
def BoundsAttributesImplicitConvSingleToExplicitIndexable :

clang/include/clang/Basic/LangOptions.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ BENIGN_LANGOPT(CheckConstexprFunctionBodies, 1, 1,
536536
LANGOPT(BoundsSafety, 1, 0, "Bounds safety extension for C")
537537
/* TO_UPSTREAM(BoundsSafety) ON*/
538538
LANGOPT(BoundsSafetyAttributes, 1, 0, "Experimental bounds safety attributes")
539-
LANGOPT(BoundsAttributesCXXExperimental, 1, 0, "Experimental bounds attributes for C++")
540-
LANGOPT(BoundsAttributesObjCExperimental, 1, 0, "Experimental bounds attributes for Objective-C")
539+
LANGOPT(BoundsSafetyCXXExperimental, 1, 0, "Experimental bounds attributes for C++")
540+
LANGOPT(BoundsSafetyObjCExperimental, 1, 0, "Experimental bounds attributes for Objective-C")
541541
LANGOPT(BoundsSafetyRelaxedSystemHeaders, 1, 1,
542542
"Relax bounds safety assignment rules in system headers")
543543
LANGOPT(BoundsSafetyBringUpMissingChecks, 7, clang::LangOptions::getDefaultBoundsSafetyNewChecksMask(),

clang/include/clang/Driver/Options.td

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,20 +1971,20 @@ defm experimental_bounds_safety_attributes : BoolFOption<
19711971
PosFlag<SetTrue, [], [ClangOption], "Enable">,
19721972
NegFlag<SetFalse, [], [ClangOption], "Disable">,
19731973
BothFlags<[], [ClangOption, CC1Option], " experimental attributes">>;
1974-
defm bounds_attributes_cxx_experimental : BoolFOption<
1975-
"bounds-attributes-cxx-experimental",
1976-
LangOpts<"BoundsAttributesCXXExperimental">, DefaultFalse,
1977-
PosFlag<SetTrue, [], [ClangOption], "Enable">,
1978-
NegFlag<SetFalse, [], [ClangOption], "Disable">,
1979-
BothFlags<[], [ClangOption, CC1Option],
1980-
" experimental bounds attributes for C++">>;
1981-
defm bounds_attributes_objc_experimental : BoolFOption<
1982-
"bounds-attributes-objc-experimental",
1983-
LangOpts<"BoundsAttributesObjCExperimental">, DefaultFalse,
1984-
PosFlag<SetTrue, [], [ClangOption], "Enable">,
1985-
NegFlag<SetFalse, [], [ClangOption], "Disable">,
1986-
BothFlags<[], [ClangOption, CC1Option],
1987-
" experimental bounds attributes for ObjC">>;
1974+
defm bounds_safety_cxx_experimental : BoolFOption<
1975+
"experimental-bounds-safety-cxx",
1976+
LangOpts<"BoundsSafetyCXXExperimental">, DefaultFalse,
1977+
PosFlag<SetTrue, [], [CC1Option], "Enable">,
1978+
NegFlag<SetFalse, [], [CC1Option], "Disable">,
1979+
BothFlags<[], [CC1Option],
1980+
" experimental support for -fbounds-safety for C++">>;
1981+
defm bounds_safety_objc_experimental : BoolFOption<
1982+
"experimental-bounds-safety-objc",
1983+
LangOpts<"BoundsSafetyObjCExperimental">, DefaultFalse,
1984+
PosFlag<SetTrue, [], [CC1Option], "Enable">,
1985+
NegFlag<SetFalse, [], [CC1Option], "Disable">,
1986+
BothFlags<[], [CC1Option],
1987+
" experimental support for -fbounds-safety for ObjC">>;
19881988
defm bounds_safety_relaxed_system_headers : BoolFOption<
19891989
"bounds-safety-relaxed-system-headers",
19901990
LangOpts<"BoundsSafetyRelaxedSystemHeaders">, DefaultTrue,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7546,18 +7546,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &Job,
75467546
CmdArgs.push_back("-fexperimental-bounds-safety-attributes");
75477547
}
75487548

7549-
if (Args.hasFlag(options::OPT_fbounds_attributes_cxx_experimental,
7550-
options::OPT_fno_bounds_attributes_cxx_experimental,
7551-
false)) {
7552-
CmdArgs.push_back("-fbounds-attributes-cxx-experimental");
7553-
}
7554-
7555-
if (Args.hasFlag(options::OPT_fbounds_attributes_objc_experimental,
7556-
options::OPT_fno_bounds_attributes_objc_experimental,
7557-
false)) {
7558-
CmdArgs.push_back("-fbounds-attributes-objc-experimental");
7559-
}
7560-
75617549
// -fbounds-safety-relaxed-system-headers is on by default
75627550
Args.addOptOutFlag(CmdArgs,
75637551
options::OPT_fbounds_safety_relaxed_system_headers,

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4433,10 +4433,10 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
44334433
SupportsBoundsSafety = true;
44344434
break;
44354435
case Language::ObjC:
4436-
SupportsBoundsSafety = Opts.BoundsAttributesObjCExperimental;
4436+
SupportsBoundsSafety = Opts.BoundsSafetyObjCExperimental;
44374437
break;
44384438
case Language::CXX:
4439-
SupportsBoundsSafety = Opts.BoundsAttributesCXXExperimental;
4439+
SupportsBoundsSafety = Opts.BoundsSafetyCXXExperimental;
44404440
break;
44414441
default:
44424442
break;
@@ -4463,11 +4463,11 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
44634463
Opts.ExperimentalLateParseAttributes = 1;
44644464
}
44654465

4466-
if (Opts.BoundsAttributesCXXExperimental && !Opts.BoundsSafety)
4467-
Diags.Report(diag::warn_bounds_attributes_cxx_experimental_ignored);
4466+
if (Opts.BoundsSafetyCXXExperimental && !Opts.BoundsSafety)
4467+
Diags.Report(diag::warn_bounds_safety_cxx_experimental_ignored);
44684468

4469-
if (Opts.BoundsAttributesObjCExperimental && !Opts.BoundsSafety)
4470-
Diags.Report(diag::warn_bounds_attributes_objc_experimental_ignored);
4469+
if (Opts.BoundsSafetyObjCExperimental && !Opts.BoundsSafety)
4470+
Diags.Report(diag::warn_bounds_safety_objc_experimental_ignored);
44714471

44724472
if (!Opts.BoundsSafetyRelaxedSystemHeaders && !Opts.BoundsSafety)
44734473
Diags.Report(diag::warn_bounds_safety_relaxed_system_headers_ignored);

clang/test/BoundsSafety-legacy-checks/AST/SystemHeaders/builtin-function-main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <builtin-function-sys.h>
33

44
// RUN: %clang_cc1 -ast-dump -fbounds-safety %s -I %S/../../../BoundsSafety/AST/SystemHeaders/include | FileCheck %s --implicit-check-not "GetBoundExpr {{.+}} 'char *__single'" --implicit-check-not "GetBoundExpr {{.+}} 'char *'"
5-
// RUN: %clang_cc1 -ast-dump -fbounds-safety %s -I %S/../../../BoundsSafety/AST/SystemHeaders/include -x objective-c -fbounds-attributes-objc-experimental | FileCheck %s --implicit-check-not "GetBoundExpr {{.+}} 'char *__single'" --implicit-check-not "GetBoundExpr {{.+}} 'char *'"
5+
// RUN: %clang_cc1 -ast-dump -fbounds-safety %s -I %S/../../../BoundsSafety/AST/SystemHeaders/include -x objective-c -fexperimental-bounds-safety-objc | FileCheck %s --implicit-check-not "GetBoundExpr {{.+}} 'char *__single'" --implicit-check-not "GetBoundExpr {{.+}} 'char *'"
66

77
char * __counted_by(len) func(char * __counted_by(len) src_str, int len) {
88
int len2 = 0;

clang/test/BoundsSafety-legacy-checks/AST/bounds-attributed-in-return-disabled.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
// RUN: %clang_cc1 -fbounds-safety -ast-dump %s 2>&1 | FileCheck %s
5-
// RUN: %clang_cc1 -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -ast-dump %s 2>&1 | FileCheck %s
5+
// RUN: %clang_cc1 -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -ast-dump %s 2>&1 | FileCheck %s
66

77
#include <ptrcheck.h>
88

clang/test/BoundsSafety-legacy-checks/AST/count-attrs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety %s | FileCheck %s
2-
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental %s | FileCheck %s
2+
// RUN: %clang_cc1 -triple x86_64-apple-mac -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc %s | FileCheck %s
33
#include <ptrcheck.h>
44

55
int *__counted_by(len) frob(int len);

clang/test/BoundsSafety-legacy-checks/AST/counted_by_or_null_call.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 -ast-dump -fbounds-safety -Wno-bounds-safety-init-list %s | FileCheck %s
2-
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fbounds-attributes-objc-experimental -Wno-bounds-safety-init-list %s | FileCheck %s
2+
// RUN: %clang_cc1 -ast-dump -fbounds-safety -x objective-c -fexperimental-bounds-safety-objc -Wno-bounds-safety-init-list %s | FileCheck %s
33

44
#include <ptrcheck.h>
55

0 commit comments

Comments
 (0)