Skip to content

Commit ce06761

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-early-exit-handle-early
2 parents 56d576a + 9be4d64 commit ce06761

File tree

109 files changed

+3916
-628
lines changed

Some content is hidden

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

109 files changed

+3916
-628
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ Bug Fixes to C++ Support
679679
whose type depends on itself. (#GH51347), (#GH55872)
680680
- Improved parser recovery of invalid requirement expressions. In turn, this
681681
fixes crashes from follow-on processing of the invalid requirement. (#GH138820)
682+
- Fixed the handling of pack indexing types in the constraints of a member function redeclaration. (#GH138255)
682683

683684
Bug Fixes to AST Handling
684685
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -728,6 +729,9 @@ X86 Support
728729

729730
Arm and AArch64 Support
730731
^^^^^^^^^^^^^^^^^^^^^^^
732+
733+
- Support has been added for the following processors (command-line identifiers in parentheses):
734+
- Arm Cortex-A320 (``cortex-a320``)
731735
- For ARM targets, cc1as now considers the FPU's features for the selected CPU or Architecture.
732736
- The ``+nosimd`` attribute is now fully supported for ARM. Previously, this had no effect when being used with
733737
ARM targets, however this will now disable NEON instructions being generated. The ``simd`` option is
@@ -901,8 +905,12 @@ OpenMP Support
901905
- Added support 'no_openmp_constructs' assumption clause.
902906
- Added support for 'self_maps' in map and requirement clause.
903907
- Added support for 'omp stripe' directive.
908+
- Fixed a crashing bug with ``omp unroll partial`` if the argument to
909+
``partial`` was an invalid expression. (#GH139267)
904910
- Fixed a crashing bug with ``omp tile sizes`` if the argument to ``sizes`` was
905911
an invalid expression. (#GH139073)
912+
- Fixed a crashing bug with ``omp distribute dist_schedule`` if the argument to
913+
``dist_schedule`` was not strictly positive. (#GH139266)
906914

907915
Improvements
908916
^^^^^^^^^^^^

clang/include/clang/AST/ASTContext.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ class ASTContext : public RefCountedBase<ASTContext> {
221221
mutable llvm::ContextualFoldingSet<DependentDecltypeType, ASTContext &>
222222
DependentDecltypeTypes;
223223

224-
mutable llvm::FoldingSet<PackIndexingType> DependentPackIndexingTypes;
224+
mutable llvm::ContextualFoldingSet<PackIndexingType, ASTContext &>
225+
DependentPackIndexingTypes;
225226

226227
mutable llvm::FoldingSet<TemplateTypeParmType> TemplateTypeParmTypes;
227228
mutable llvm::FoldingSet<ObjCTypeParamType> ObjCTypeParamTypes;

clang/include/clang/AST/ExprCXX.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4547,6 +4547,7 @@ class PackIndexingExpr final
45474547
static PackIndexingExpr *CreateDeserialized(ASTContext &Context,
45484548
unsigned NumTransformedExprs);
45494549

4550+
// The index expression and all elements of the pack have been substituted.
45504551
bool isFullySubstituted() const { return FullySubstituted; }
45514552

45524553
/// Determine if the expression was expanded to empty.

clang/include/clang/AST/Type.h

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5976,7 +5976,6 @@ class PackIndexingType final
59765976
private llvm::TrailingObjects<PackIndexingType, QualType> {
59775977
friend TrailingObjects;
59785978

5979-
const ASTContext &Context;
59805979
QualType Pattern;
59815980
Expr *IndexExpr;
59825981

@@ -5987,9 +5986,8 @@ class PackIndexingType final
59875986

59885987
protected:
59895988
friend class ASTContext; // ASTContext creates these.
5990-
PackIndexingType(const ASTContext &Context, QualType Canonical,
5991-
QualType Pattern, Expr *IndexExpr, bool FullySubstituted,
5992-
ArrayRef<QualType> Expansions = {});
5989+
PackIndexingType(QualType Canonical, QualType Pattern, Expr *IndexExpr,
5990+
bool FullySubstituted, ArrayRef<QualType> Expansions = {});
59935991

59945992
public:
59955993
Expr *getIndexExpr() const { return IndexExpr; }
@@ -6024,14 +6022,10 @@ class PackIndexingType final
60246022
return T->getTypeClass() == PackIndexing;
60256023
}
60266024

6027-
void Profile(llvm::FoldingSetNodeID &ID) {
6028-
if (hasSelectedType())
6029-
getSelectedType().Profile(ID);
6030-
else
6031-
Profile(ID, Context, getPattern(), getIndexExpr(), isFullySubstituted());
6032-
}
6025+
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context);
60336026
static void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context,
6034-
QualType Pattern, Expr *E, bool FullySubstituted);
6027+
QualType Pattern, Expr *E, bool FullySubstituted,
6028+
ArrayRef<QualType> Expansions);
60356029

60366030
private:
60376031
const QualType *getExpansionsPtr() const {

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ CODEGENOPT(StaticClosure, 1, 0)
483483
/// Assume that UAVs/SRVs may alias
484484
CODEGENOPT(ResMayAlias, 1, 0)
485485

486+
/// Enables unwind v2 (epilog) information for x64 Windows.
487+
CODEGENOPT(WinX64EHUnwindV2, 1, 0)
488+
486489
/// FIXME: Make DebugOptions its own top-level .def file.
487490
#include "DebugOptions.def"
488491

clang/include/clang/Driver/Options.td

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,6 +2167,11 @@ defm assume_nothrow_exception_dtor: BoolFOption<"assume-nothrow-exception-dtor",
21672167
LangOpts<"AssumeNothrowExceptionDtor">, DefaultFalse,
21682168
PosFlag<SetTrue, [], [ClangOption, CC1Option], "Assume that exception objects' destructors are non-throwing">,
21692169
NegFlag<SetFalse>>;
2170+
defm winx64_eh_unwindv2 : BoolFOption<"winx64-eh-unwindv2",
2171+
CodeGenOpts<"WinX64EHUnwindV2">, DefaultFalse,
2172+
PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
2173+
NegFlag<SetFalse, [], [ClangOption], "Disable">,
2174+
BothFlags<[], [ClangOption], " unwind v2 (epilog) information for x64 Windows">>;
21702175
def fexcess_precision_EQ : Joined<["-"], "fexcess-precision=">, Group<f_Group>,
21712176
Visibility<[ClangOption, CLOption]>,
21722177
HelpText<"Allows control over excess precision on targets where native "
@@ -3269,6 +3274,13 @@ def fmodules_disable_diagnostic_validation : Flag<["-"], "fmodules-disable-diagn
32693274
Group<i_Group>, Visibility<[ClangOption, CC1Option]>,
32703275
HelpText<"Disable validation of the diagnostic options when loading the module">,
32713276
MarshallingInfoNegativeFlag<HeaderSearchOpts<"ModulesValidateDiagnosticOptions">>;
3277+
defm modules_force_validate_user_headers : BoolOption<"f", "modules-force-validate-user-headers",
3278+
HeaderSearchOpts<"ModulesForceValidateUserHeaders">, DefaultTrue,
3279+
PosFlag<SetTrue, [], [], "Force">,
3280+
NegFlag<SetFalse, [], [CC1Option], "Do not force">,
3281+
BothFlags<[], [ClangOption],
3282+
" validation of user headers when repeatedly loading a module file within single build session">>,
3283+
Group<i_Group>;
32723284
defm modules_validate_system_headers : BoolOption<"f", "modules-validate-system-headers",
32733285
HeaderSearchOpts<"ModulesValidateSystemHeaders">, DefaultFalse,
32743286
PosFlag<SetTrue, [], [ClangOption, CC1Option],
@@ -8940,6 +8952,8 @@ def _SLASH_M_Group : OptionGroup<"</M group>">, Group<cl_compile_Group>;
89408952
def _SLASH_volatile_Group : OptionGroup<"</volatile group>">,
89418953
Group<cl_compile_Group>;
89428954

8955+
def _SLASH_d2epilogunwind : CLFlag<"d2epilogunwind">,
8956+
HelpText<"Enable unwind v2 (epilog) information for x64 Windows">;
89438957
def _SLASH_EH : CLJoined<"EH">, HelpText<"Set exception handling model">;
89448958
def _SLASH_EP : CLFlag<"EP">,
89458959
HelpText<"Disable linemarker output and preprocess to stdout">;

clang/include/clang/Lex/HeaderSearchOptions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ class HeaderSearchOptions {
217217
LLVM_PREFERRED_TYPE(bool)
218218
unsigned ModulesValidateSystemHeaders : 1;
219219

220+
/// Whether to force the validation of user input files when a module is
221+
/// loaded (even despite the build session saying that is not necessary).
222+
LLVM_PREFERRED_TYPE(bool)
223+
unsigned ModulesForceValidateUserHeaders : 1;
224+
220225
// Whether the content of input files should be hashed and used to
221226
// validate consistency.
222227
LLVM_PREFERRED_TYPE(bool)
@@ -286,6 +291,7 @@ class HeaderSearchOptions {
286291
UseStandardCXXIncludes(true), UseLibcxx(false), Verbose(false),
287292
ModulesValidateOncePerBuildSession(false),
288293
ModulesValidateSystemHeaders(false),
294+
ModulesForceValidateUserHeaders(true),
289295
ValidateASTInputFilesContent(false),
290296
ForceCheckCXX20ModulesInputFiles(false), UseDebugInfo(false),
291297
ModulesValidateDiagnosticOptions(true),

clang/include/clang/Parse/ParseHLSLRootSignature.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,16 @@ class RootSignatureParser {
7777
parseDescriptorTableClause();
7878

7979
/// Parameter arguments (eg. `bReg`, `space`, ...) can be specified in any
80-
/// order and only exactly once. `ParsedClauseParams` denotes the current
81-
/// state of parsed params
80+
/// order and only exactly once. The following methods define a
81+
/// `Parsed.*Params` struct to denote the current state of parsed params
82+
struct ParsedConstantParams {
83+
std::optional<llvm::hlsl::rootsig::Register> Reg;
84+
std::optional<uint32_t> Num32BitConstants;
85+
std::optional<uint32_t> Space;
86+
std::optional<llvm::hlsl::rootsig::ShaderVisibility> Visibility;
87+
};
88+
std::optional<ParsedConstantParams> parseRootConstantParams();
89+
8290
struct ParsedClauseParams {
8391
std::optional<llvm::hlsl::rootsig::Register> Reg;
8492
std::optional<uint32_t> NumDescriptors;

clang/include/clang/Sema/Sema.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10240,8 +10240,13 @@ class Sema final : public SemaBase {
1024010240
/// Determine whether the conversion from FromType to ToType is a valid
1024110241
/// conversion that strips "noexcept" or "noreturn" off the nested function
1024210242
/// type.
10243-
bool IsFunctionConversion(QualType FromType, QualType ToType,
10244-
QualType &ResultTy);
10243+
bool IsFunctionConversion(QualType FromType, QualType ToType) const;
10244+
10245+
/// Same as `IsFunctionConversion`, but if this would return true, it sets
10246+
/// `ResultTy` to `ToType`.
10247+
bool TryFunctionConversion(QualType FromType, QualType ToType,
10248+
QualType &ResultTy) const;
10249+
1024510250
bool DiagnoseMultipleUserDefinedConversion(Expr *From, QualType ToType);
1024610251
void DiagnoseUseOfDeletedFunction(SourceLocation Loc, SourceRange Range,
1024710252
DeclarationName Name,

clang/include/clang/Serialization/ASTReader.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,9 +1091,12 @@ class ASTReader
10911091
/// from the current compiler instance.
10921092
bool AllowConfigurationMismatch;
10931093

1094-
/// Whether validate system input files.
1094+
/// Whether to validate system input files.
10951095
bool ValidateSystemInputs;
10961096

1097+
/// Whether to force the validation of user input files.
1098+
bool ForceValidateUserInputs;
1099+
10971100
/// Whether validate headers and module maps using hash based on contents.
10981101
bool ValidateASTInputFilesContent;
10991102

@@ -1767,6 +1770,7 @@ class ASTReader
17671770
bool AllowASTWithCompilerErrors = false,
17681771
bool AllowConfigurationMismatch = false,
17691772
bool ValidateSystemInputs = false,
1773+
bool ForceValidateUserInputs = true,
17701774
bool ValidateASTInputFilesContent = false,
17711775
bool UseGlobalIndex = true,
17721776
std::unique_ptr<llvm::Timer> ReadTimer = {});

0 commit comments

Comments
 (0)