Skip to content

Commit 556545b

Browse files
committed
Merge branch 'main' into pr/riscv-tablegen-sdnodes
2 parents 0500526 + a783edf commit 556545b

File tree

685 files changed

+74686
-6872
lines changed

Some content is hidden

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

685 files changed

+74686
-6872
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ Improvements to Clang's diagnostics
506506
behavior of the C99 feature as it was introduced into C++20. Fixes #GH47037
507507
- ``-Wreserved-identifier`` now fires on reserved parameter names in a function
508508
declaration which is not a definition.
509+
- Clang now prints the namespace for an attribute, if any,
510+
when emitting an unknown attribute diagnostic.
509511

510512
- Several compatibility diagnostics that were incorrectly being grouped under
511513
``-Wpre-c++20-compat`` are now part of ``-Wc++20-compat``. (#GH138775)
@@ -564,7 +566,7 @@ Bug Fixes in This Version
564566
- Fixed a bug where an attribute before a ``pragma clang attribute`` or
565567
``pragma clang __debug`` would cause an assertion. Instead, this now diagnoses
566568
the invalid attribute location appropriately. (#GH137861)
567-
- Fixed a crash when a malformed ``_Pragma`` directive appears as part of an
569+
- Fixed a crash when a malformed ``_Pragma`` directive appears as part of an
568570
``#include`` directive. (#GH138094)
569571
- Fixed a crash during constant evaluation involving invalid lambda captures
570572
(#GH138832)
@@ -673,11 +675,13 @@ Bug Fixes to C++ Support
673675
- Fixed an assertion when trying to constant-fold various builtins when the argument
674676
referred to a reference to an incomplete type. (#GH129397)
675677
- Fixed a crash when a cast involved a parenthesized aggregate initialization in dependent context. (#GH72880)
676-
- Fixed a crash when forming an invalid function type in a dependent context. (#GH138657) (#GH115725) (#GH68852)
677678
- No longer crashes when instantiating invalid variable template specialization
678679
whose type depends on itself. (#GH51347), (#GH55872)
679680
- Improved parser recovery of invalid requirement expressions. In turn, this
680681
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)
683+
- Clang now correctly parses arbitrary order of ``[[]]``, ``__attribute__`` and ``alignas`` attributes for declarations (#GH133107)
684+
- Fixed a crash when forming an invalid function type in a dependent context. (#GH138657) (#GH115725) (#GH68852)
681685

682686
Bug Fixes to AST Handling
683687
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -727,6 +731,9 @@ X86 Support
727731

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

904917
Improvements
905918
^^^^^^^^^^^^

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class AttributeCommonInfo {
196196
/// with surrounding underscores removed as appropriate (e.g.
197197
/// __gnu__::__attr__ will be normalized to gnu::attr).
198198
std::string getNormalizedFullName() const;
199+
SourceRange getNormalizedRange() const;
199200

200201
bool isDeclspecAttribute() const { return SyntaxUsed == AS_Declspec; }
201202
bool isMicrosoftAttribute() const { return SyntaxUsed == AS_Microsoft; }

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/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: 19 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],
@@ -8452,6 +8464,11 @@ def objc_isystem : Separate<["-"], "objc-isystem">,
84528464
def objcxx_isystem : Separate<["-"], "objcxx-isystem">,
84538465
MetaVarName<"<directory>">,
84548466
HelpText<"Add directory to the ObjC++ SYSTEM include search path">;
8467+
def internal_iframework : Separate<["-"], "internal-iframework">,
8468+
MetaVarName<"<directory>">,
8469+
HelpText<"Add directory to the internal system framework search path; these "
8470+
"are assumed to not be user-provided and are used to model system "
8471+
"and standard frameworks' paths.">;
84558472
def internal_isystem : Separate<["-"], "internal-isystem">,
84568473
MetaVarName<"<directory>">,
84578474
HelpText<"Add directory to the internal system include search path; these "
@@ -8935,6 +8952,8 @@ def _SLASH_M_Group : OptionGroup<"</M group>">, Group<cl_compile_Group>;
89358952
def _SLASH_volatile_Group : OptionGroup<"</volatile group>">,
89368953
Group<cl_compile_Group>;
89378954

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

0 commit comments

Comments
 (0)