Skip to content

Commit cfb38e4

Browse files
authored
Merge branch 'main' into powero2
2 parents 53177f3 + 0a85b31 commit cfb38e4

File tree

119 files changed

+5376
-1222
lines changed

Some content is hidden

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

119 files changed

+5376
-1222
lines changed

clang-tools-extra/docs/clang-tidy/checks/bugprone/return-const-ref-from-parameter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ on the control flow of the function, an overload where all problematic
4242

4343
This issue can also be resolved by adding ``[[clang::lifetimebound]]``. Clang
4444
enable ``-Wdangling`` warning by default which can detect mis-uses of the
45-
annotated function. See `lifetimebound attribute <https://clang.llvm.org/docs/AttributeReference.html#id11>`_
45+
annotated function. See `lifetimebound attribute <https://clang.llvm.org/docs/AttributeReference.html#lifetimebound>`_
4646
for details.
4747

4848
.. code-block:: c++

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ Bug Fixes to C++ Support
830830
- Clang modules now allow a module and its user to differ on TrivialAutoVarInit*
831831
- Fixed an access checking bug when initializing non-aggregates in default arguments (#GH62444), (#GH83608)
832832
- Fixed a pack substitution bug in deducing class template partial specializations. (#GH53609)
833+
- Fixed a crash when constant evaluating some explicit object member assignment operators. (#GH142835)
833834

834835
Bug Fixes to AST Handling
835836
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1049,7 +1050,7 @@ Sanitizers
10491050
----------
10501051

10511052
- ``-fsanitize=vptr`` is no longer a part of ``-fsanitize=undefined``.
1052-
- Sanitizer ignorelists now support the syntax ``src:*=sanitize``,
1053+
- Sanitizer ignorelists now support the syntax ``src:*=sanitize``,
10531054
``type:*=sanitize``, ``fun:*=sanitize``, ``global:*=sanitize``,
10541055
and ``mainfile:*=sanitize``.
10551056

clang/docs/UsersManual.rst

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2300,12 +2300,14 @@ are listed below.
23002300
.. option:: -f[no-]unique-source-file-names
23012301

23022302
When enabled, allows the compiler to assume that each object file
2303-
passed to the linker has been compiled using a unique source file
2304-
path. This is useful for reducing link times when doing ThinLTO
2305-
in combination with whole-program devirtualization or CFI.
2303+
passed to the linker has a unique identifier. The identifier for
2304+
an object file is either the source file path or the value of the
2305+
argument `-funique-source-file-identifier` if specified. This is
2306+
useful for reducing link times when doing ThinLTO in combination with
2307+
whole-program devirtualization or CFI.
23062308

2307-
The full source path passed to the compiler must be unique. This
2308-
means that, for example, the following is a usage error:
2309+
The full source path or identifier passed to the compiler must be
2310+
unique. This means that, for example, the following is a usage error:
23092311

23102312
.. code-block:: console
23112313
@@ -2327,6 +2329,11 @@ are listed below.
23272329
A misuse of this flag may result in a duplicate symbol error at
23282330
link time.
23292331

2332+
.. option:: -funique-source-file-identifier=IDENTIFIER
2333+
2334+
Used with `-funique-source-file-names` to specify a source file
2335+
identifier.
2336+
23302337
.. option:: -fforce-emit-vtables
23312338

23322339
In order to improve devirtualization, forces emitting of vtables even in

clang/include/clang/Basic/AttrDocs.td

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4396,8 +4396,6 @@ annotated parameter.
43964396
addToSet(str, s); // Not detected.
43974397
}
43984398
}
4399-
4400-
.. _`lifetimebound`: https://clang.llvm.org/docs/AttributeReference.html#lifetimebound
44014399
}];
44024400
}
44034401

@@ -9042,14 +9040,14 @@ def CoroLifetimeBoundDoc : Documentation {
90429040
let Category = DocCatDecl;
90439041
let Content = [{
90449042
The ``[[clang::coro_lifetimebound]]`` is a class attribute which can be applied
9045-
to a coroutine return type (`CRT`_) (i.e.
9043+
to a coroutine return type (`coro_return_type, coro_wrapper`_) (i.e.
90469044
it should also be annotated with ``[[clang::coro_return_type]]``).
90479045

90489046
All parameters of a function are considered to be lifetime bound if the function returns a
90499047
coroutine return type (CRT) annotated with ``[[clang::coro_lifetimebound]]``.
90509048
This lifetime bound analysis can be disabled for a coroutine wrapper or a coroutine by annotating the function
90519049
with ``[[clang::coro_disable_lifetimebound]]`` function attribute .
9052-
See `documentation`_ of ``[[clang::lifetimebound]]`` for details about lifetime bound analysis.
9050+
See documentation of `lifetimebound`_ for details about lifetime bound analysis.
90539051

90549052

90559053
Reference parameters of a coroutine are susceptible to capturing references to temporaries or local variables.
@@ -9109,9 +9107,6 @@ but do not pass them to the underlying coroutine or pass them by value.
91099107
void use() {
91109108
auto task = coro_wrapper(1); // use of temporary is fine as the argument is not lifetime bound.
91119109
}
9112-
9113-
.. _`documentation`: https://clang.llvm.org/docs/AttributeReference.html#lifetimebound
9114-
.. _`CRT`: https://clang.llvm.org/docs/AttributeReference.html#coro-return-type
91159110
}];
91169111
}
91179112

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,6 @@ CODEGENOPT(SanitizeCfiICallNormalizeIntegers, 1, 0) ///< Normalize integer types
278278
///< CFI icall function signatures
279279
CODEGENOPT(SanitizeCfiCanonicalJumpTables, 1, 0) ///< Make jump table symbols canonical
280280
///< instead of creating a local jump table.
281-
CODEGENOPT(UniqueSourceFileNames, 1, 0) ///< Allow the compiler to assume that TUs
282-
///< have unique source file names at link time
283281
CODEGENOPT(SanitizeKcfiArity, 1, 0) ///< Embed arity in KCFI patchable function prefix
284282
CODEGENOPT(SanitizeCoverageType, 2, 0) ///< Type of sanitizer coverage
285283
///< instrumentation.

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@ class CodeGenOptions : public CodeGenOptionsBase {
338338
/// -fsymbol-partition (see https://lld.llvm.org/Partitions.html).
339339
std::string SymbolPartition;
340340

341+
/// If non-empty, allow the compiler to assume that the given source file
342+
/// identifier is unique at link time.
343+
std::string UniqueSourceFileIdentifier;
344+
341345
enum RemarkKind {
342346
RK_Missing, // Remark argument not present on the command line.
343347
RK_Enabled, // Remark enabled via '-Rgroup'.

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ def err_drv_cannot_open_randomize_layout_seed_file : Error<
206206
"cannot read randomize layout seed file '%0'">;
207207
def err_drv_invalid_version_number : Error<
208208
"invalid version number in '%0'">;
209+
def err_drv_missing_version_number : Error<"missing version number in '%0'">;
209210
def err_drv_kcfi_arity_unsupported_target : Error<
210211
"target '%0' is unsupported by -fsanitize-kcfi-arity">;
211212
def err_drv_no_linker_llvm_support : Error<
@@ -478,6 +479,9 @@ def warn_ignoring_ftabstop_value : Warning<
478479
def warn_drv_overriding_option : Warning<
479480
"overriding '%0' option with '%1'">,
480481
InGroup<DiagGroup<"overriding-option">>;
482+
def warn_drv_overriding_deployment_version
483+
: Warning<"overriding deployment version from '%0' to '%1'">,
484+
InGroup<DiagGroup<"overriding-deployment-version">>;
481485
def warn_drv_treating_input_as_cxx : Warning<
482486
"treating '%0' input as '%1' when in C++ mode, this behavior is deprecated">,
483487
InGroup<Deprecated>;

clang/include/clang/CIR/Dialect/IR/CIRTypes.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,18 @@ def CIR_RecordType : CIR_Type<"Record", "record",
474474
let genVerifyDecl = 1;
475475

476476
let builders = [
477+
// Create an identified and complete record type.
478+
TypeBuilder<(ins
479+
"llvm::ArrayRef<mlir::Type>":$members,
480+
"mlir::StringAttr":$name,
481+
"bool":$packed,
482+
"bool":$padded,
483+
"RecordKind":$kind
484+
), [{
485+
return $_get($_ctxt, members, name, /*complete=*/true, packed, padded,
486+
kind);
487+
}]>,
488+
477489
// Create an identified and incomplete record type.
478490
TypeBuilder<(ins
479491
"mlir::StringAttr":$name,

clang/include/clang/CIR/MissingFeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ struct MissingFeatures {
136136
static bool cxxSupport() { return false; }
137137
static bool recordZeroInit() { return false; }
138138
static bool zeroSizeRecordMembers() { return false; }
139+
static bool recordLayoutVirtualBases() { return false; }
139140

140141
// Various handling of deferred processing in CIRGenModule.
141142
static bool cgmRelease() { return false; }

clang/include/clang/Driver/Options.td

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4204,13 +4204,15 @@ def ftrigraphs : Flag<["-"], "ftrigraphs">, Group<f_Group>,
42044204
def fno_trigraphs : Flag<["-"], "fno-trigraphs">, Group<f_Group>,
42054205
HelpText<"Do not process trigraph sequences">,
42064206
Visibility<[ClangOption, CC1Option]>;
4207-
defm unique_source_file_names: BoolOption<"f", "unique-source-file-names",
4208-
CodeGenOpts<"UniqueSourceFileNames">, DefaultFalse,
4209-
PosFlag<SetTrue, [], [CC1Option], "Allow">,
4210-
NegFlag<SetFalse, [], [], "Do not allow">,
4211-
BothFlags<[], [ClangOption], " the compiler to assume that each translation unit has a unique "
4212-
"source file name at link time">>,
4213-
Group<f_clang_Group>;
4207+
def funique_source_file_names: Flag<["-"], "funique-source-file-names">, Group<f_Group>,
4208+
HelpText<"Allow the compiler to assume that each translation unit has a unique "
4209+
"source file identifier (see -funique-source-file-identifier) at link time">;
4210+
def fno_unique_source_file_names: Flag<["-"], "fno-unique-source-file-names">;
4211+
def unique_source_file_identifier_EQ: Joined<["-"], "funique-source-file-identifier=">, Group<f_Group>,
4212+
Visibility<[ClangOption, CC1Option]>,
4213+
HelpText<"Specify the source file identifier for -funique-source-file-names; "
4214+
"uses the source file path if not specified">,
4215+
MarshallingInfoString<CodeGenOpts<"UniqueSourceFileIdentifier">>;
42144216
def funsigned_bitfields : Flag<["-"], "funsigned-bitfields">, Group<f_Group>;
42154217
def funsigned_char : Flag<["-"], "funsigned-char">, Group<f_Group>;
42164218
def fno_unsigned_char : Flag<["-"], "fno-unsigned-char">;

0 commit comments

Comments
 (0)