Skip to content

Commit d0df126

Browse files
authored
Merge branch 'main' into alignas-order
2 parents 121b800 + 790ce0e commit d0df126

File tree

256 files changed

+7136
-1994
lines changed

Some content is hidden

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

256 files changed

+7136
-1994
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 10 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
- Clang now correctly parses arbitrary order of ``[[]]``, ``__attribute__`` and ``alignas`` attributes for declarations (#GH133107)
683684

684685
Bug Fixes to AST Handling
@@ -729,6 +730,9 @@ X86 Support
729730

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

906916
Improvements
907917
^^^^^^^^^^^^

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/OpenMPClause.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9475,15 +9475,17 @@ class ConstOMPClauseVisitor :
94759475
class OMPClausePrinter final : public OMPClauseVisitor<OMPClausePrinter> {
94769476
raw_ostream &OS;
94779477
const PrintingPolicy &Policy;
9478+
unsigned Version;
94789479

94799480
/// Process clauses with list of variables.
94809481
template <typename T> void VisitOMPClauseList(T *Node, char StartSym);
94819482
/// Process motion clauses.
94829483
template <typename T> void VisitOMPMotionClause(T *Node);
94839484

94849485
public:
9485-
OMPClausePrinter(raw_ostream &OS, const PrintingPolicy &Policy)
9486-
: OS(OS), Policy(Policy) {}
9486+
OMPClausePrinter(raw_ostream &OS, const PrintingPolicy &Policy,
9487+
unsigned OpenMPVersion)
9488+
: OS(OS), Policy(Policy), Version(OpenMPVersion) {}
94879489

94889490
#define GEN_CLANG_CLAUSE_CLASS
94899491
#define CLAUSE_CLASS(Enum, Str, Class) void Visit##Class(Class *S);

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/CIR/MissingFeatures.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ struct MissingFeatures {
104104
static bool opCallExtParameterInfo() { return false; }
105105
static bool opCallCIRGenFuncInfoParamInfo() { return false; }
106106
static bool opCallCIRGenFuncInfoExtParamInfo() { return false; }
107+
static bool opCallLandingPad() { return false; }
108+
static bool opCallContinueBlock() { return false; }
107109

108110
// ScopeOp handling
109111
static bool opScopeCleanupRegion() { return false; }

clang/include/clang/Driver/Options.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,6 +3269,13 @@ def fmodules_disable_diagnostic_validation : Flag<["-"], "fmodules-disable-diagn
32693269
Group<i_Group>, Visibility<[ClangOption, CC1Option]>,
32703270
HelpText<"Disable validation of the diagnostic options when loading the module">,
32713271
MarshallingInfoNegativeFlag<HeaderSearchOpts<"ModulesValidateDiagnosticOptions">>;
3272+
defm modules_force_validate_user_headers : BoolOption<"f", "modules-force-validate-user-headers",
3273+
HeaderSearchOpts<"ModulesForceValidateUserHeaders">, DefaultTrue,
3274+
PosFlag<SetTrue, [], [], "Force">,
3275+
NegFlag<SetFalse, [], [CC1Option], "Do not force">,
3276+
BothFlags<[], [ClangOption],
3277+
" validation of user headers when repeatedly loading a module file within single build session">>,
3278+
Group<i_Group>;
32723279
defm modules_validate_system_headers : BoolOption<"f", "modules-validate-system-headers",
32733280
HeaderSearchOpts<"ModulesValidateSystemHeaders">, DefaultFalse,
32743281
PosFlag<SetTrue, [], [ClangOption, CC1Option],

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: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,14 @@ 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+
};
86+
std::optional<ParsedConstantParams> parseRootConstantParams();
87+
8288
struct ParsedClauseParams {
8389
std::optional<llvm::hlsl::rootsig::Register> Reg;
8490
std::optional<uint32_t> NumDescriptors;

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)