Skip to content

Commit 1e2f742

Browse files
committed
merge main into amd-staging
2 parents ee36e25 + f4853d7 commit 1e2f742

File tree

165 files changed

+53392
-2422
lines changed

Some content is hidden

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

165 files changed

+53392
-2422
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,9 @@ Bug Fixes to C++ Support
695695
whose type depends on itself. (#GH51347), (#GH55872)
696696
- Improved parser recovery of invalid requirement expressions. In turn, this
697697
fixes crashes from follow-on processing of the invalid requirement. (#GH138820)
698+
- Fixed the handling of pack indexing types in the constraints of a member function redeclaration. (#GH138255)
699+
- Clang now correctly parses arbitrary order of ``[[]]``, ``__attribute__`` and ``alignas`` attributes for declarations (#GH133107)
700+
- Fixed a crash when forming an invalid function type in a dependent context. (#GH138657) (#GH115725) (#GH68852)
698701

699702
Bug Fixes to AST Handling
700703
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -748,6 +751,9 @@ X86 Support
748751

749752
Arm and AArch64 Support
750753
^^^^^^^^^^^^^^^^^^^^^^^
754+
755+
- Support has been added for the following processors (command-line identifiers in parentheses):
756+
- Arm Cortex-A320 (``cortex-a320``)
751757
- For ARM targets, cc1as now considers the FPU's features for the selected CPU or Architecture.
752758
- The ``+nosimd`` attribute is now fully supported for ARM. Previously, this had no effect when being used with
753759
ARM targets, however this will now disable NEON instructions being generated. The ``simd`` option is
@@ -921,8 +927,12 @@ OpenMP Support
921927
- Added support 'no_openmp_constructs' assumption clause.
922928
- Added support for 'self_maps' in map and requirement clause.
923929
- Added support for 'omp stripe' directive.
930+
- Fixed a crashing bug with ``omp unroll partial`` if the argument to
931+
``partial`` was an invalid expression. (#GH139267)
924932
- Fixed a crashing bug with ``omp tile sizes`` if the argument to ``sizes`` was
925933
an invalid expression. (#GH139073)
934+
- Fixed a crashing bug with ``omp distribute dist_schedule`` if the argument to
935+
``dist_schedule`` was not strictly positive. (#GH139266)
926936

927937
Improvements
928938
^^^^^^^^^^^^

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/Analysis/Analyses/ThreadSafety.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,14 @@ enum AccessKind {
9494

9595
/// This enum distinguishes between different situations where we warn due to
9696
/// inconsistent locking.
97-
/// \enum SK_LockedSomeLoopIterations -- a mutex is locked for some but not all
98-
/// loop iterations.
99-
/// \enum SK_LockedSomePredecessors -- a mutex is locked in some but not all
100-
/// predecessors of a CFGBlock.
101-
/// \enum SK_LockedAtEndOfFunction -- a mutex is still locked at the end of a
102-
/// function.
10397
enum LockErrorKind {
98+
/// A capability is locked for some but not all loop iterations.
10499
LEK_LockedSomeLoopIterations,
100+
/// A capability is locked in some but not all predecessors of a CFGBlock.
105101
LEK_LockedSomePredecessors,
102+
/// A capability is still locked at the end of a function.
106103
LEK_LockedAtEndOfFunction,
104+
/// Expecting a capability to be held at the end of function.
107105
LEK_NotLockedAtEndOfFunction
108106
};
109107

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
@@ -2177,6 +2177,11 @@ defm assume_nothrow_exception_dtor: BoolFOption<"assume-nothrow-exception-dtor",
21772177
LangOpts<"AssumeNothrowExceptionDtor">, DefaultFalse,
21782178
PosFlag<SetTrue, [], [ClangOption, CC1Option], "Assume that exception objects' destructors are non-throwing">,
21792179
NegFlag<SetFalse>>;
2180+
defm winx64_eh_unwindv2 : BoolFOption<"winx64-eh-unwindv2",
2181+
CodeGenOpts<"WinX64EHUnwindV2">, DefaultFalse,
2182+
PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
2183+
NegFlag<SetFalse, [], [ClangOption], "Disable">,
2184+
BothFlags<[], [ClangOption], " unwind v2 (epilog) information for x64 Windows">>;
21802185
def fexcess_precision_EQ : Joined<["-"], "fexcess-precision=">, Group<f_Group>,
21812186
Visibility<[ClangOption, CLOption]>,
21822187
HelpText<"Allows control over excess precision on targets where native "
@@ -3279,6 +3284,13 @@ def fmodules_disable_diagnostic_validation : Flag<["-"], "fmodules-disable-diagn
32793284
Group<i_Group>, Visibility<[ClangOption, CC1Option]>,
32803285
HelpText<"Disable validation of the diagnostic options when loading the module">,
32813286
MarshallingInfoNegativeFlag<HeaderSearchOpts<"ModulesValidateDiagnosticOptions">>;
3287+
defm modules_force_validate_user_headers : BoolOption<"f", "modules-force-validate-user-headers",
3288+
HeaderSearchOpts<"ModulesForceValidateUserHeaders">, DefaultTrue,
3289+
PosFlag<SetTrue, [], [], "Force">,
3290+
NegFlag<SetFalse, [], [CC1Option], "Do not force">,
3291+
BothFlags<[], [ClangOption],
3292+
" validation of user headers when repeatedly loading a module file within single build session">>,
3293+
Group<i_Group>;
32823294
defm modules_validate_system_headers : BoolOption<"f", "modules-validate-system-headers",
32833295
HeaderSearchOpts<"ModulesValidateSystemHeaders">, DefaultFalse,
32843296
PosFlag<SetTrue, [], [ClangOption, CC1Option],
@@ -9112,6 +9124,8 @@ def _SLASH_M_Group : OptionGroup<"</M group>">, Group<cl_compile_Group>;
91129124
def _SLASH_volatile_Group : OptionGroup<"</volatile group>">,
91139125
Group<cl_compile_Group>;
91149126

9127+
def _SLASH_d2epilogunwind : CLFlag<"d2epilogunwind">,
9128+
HelpText<"Enable unwind v2 (epilog) information for x64 Windows">;
91159129
def _SLASH_EH : CLJoined<"EH">, HelpText<"Set exception handling model">;
91169130
def _SLASH_EP : CLFlag<"EP">,
91179131
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/Parse/Parser.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3081,13 +3081,16 @@ class Parser : public CodeCompletionHandler {
30813081
bool CouldBeBitField = false);
30823082
Decl *ParseHLSLBuffer(SourceLocation &DeclEnd);
30833083

3084-
void MaybeParseMicrosoftAttributes(ParsedAttributes &Attrs) {
3084+
bool MaybeParseMicrosoftAttributes(ParsedAttributes &Attrs) {
3085+
bool AttrsParsed = false;
30853086
if ((getLangOpts().MicrosoftExt || getLangOpts().HLSL) &&
30863087
Tok.is(tok::l_square)) {
30873088
ParsedAttributes AttrsWithRange(AttrFactory);
30883089
ParseMicrosoftAttributes(AttrsWithRange);
3090+
AttrsParsed = !AttrsWithRange.empty();
30893091
Attrs.takeAllFrom(AttrsWithRange);
30903092
}
3093+
return AttrsParsed;
30913094
}
30923095
void ParseMicrosoftUuidAttributeArgs(ParsedAttributes &Attrs);
30933096
void ParseMicrosoftAttributes(ParsedAttributes &Attrs);

0 commit comments

Comments
 (0)