Skip to content

Commit 4f8c2eb

Browse files
authored
Merge branch 'main' into xqcicomp
2 parents 8b4ef4d + fe56c8f commit 4f8c2eb

File tree

507 files changed

+62434
-12163
lines changed

Some content is hidden

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

507 files changed

+62434
-12163
lines changed

bolt/test/runtime/X86/fdata-escape-chars.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ define internal void @static_symb_backslash_b() #0 {
8282
; INSTR_CHECK: Binary Function "main"
8383
; INSTR_CHECK: Exec Count : 1
8484
; INSTR_CHECK: {{([[:xdigit:]]+)}}: callq "symb whitespace" # Count: 1
85-
; INSTR_CHECK: {{([[:xdigit:]]+)}}: callq "symb backslash\" # Count: 2
85+
; INSTR_CHECK: {{([[:xdigit:]]+)}}: callq "symb backslash\\" # Count: 2
8686
; INSTR_CHECK: Binary Function "static symb backslash\/1(*2)"
8787
; INSTR_CHECK: Exec Count : 1
8888
; INSTR_CHECK: {{([[:xdigit:]]+)}}: callq "symb whitespace" # Count: 1

clang/docs/PointerAuthentication.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,14 @@ __ptrauth Qualifier
284284
^^^^^^^^^^^^^^^^^^^
285285

286286
``__ptrauth(key, address, discriminator)`` is an extended type
287-
qualifier which causes so-qualified objects to hold pointers signed using the
288-
specified schema rather than the default schema for such types.
287+
qualifier which causes so-qualified objects to hold pointers or pointer sized
288+
integers signed using the specified schema rather than the default schema for
289+
such types.
289290

290291
In the current implementation in Clang, the qualified type must be a C pointer
291-
type, either to a function or to an object. It currently cannot be an
292-
Objective-C pointer type, a C++ reference type, or a block pointer type; these
293-
restrictions may be lifted in the future.
292+
type, either to a function or to an object, or a pointer sized integer. It
293+
currently cannot be an Objective-C pointer type, a C++ reference type, or a
294+
block pointer type; these restrictions may be lifted in the future.
294295

295296
The qualifier's operands are as follows:
296297

clang/docs/ReleaseNotes.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,15 @@ Improvements to Clang's diagnostics
509509
- Clang now prints the namespace for an attribute, if any,
510510
when emitting an unknown attribute diagnostic.
511511

512+
- ``-Wvolatile`` now warns about volatile-qualified class return types
513+
as well as volatile-qualified scalar return types. Fixes #GH133380
514+
512515
- Several compatibility diagnostics that were incorrectly being grouped under
513516
``-Wpre-c++20-compat`` are now part of ``-Wc++20-compat``. (#GH138775)
514517

518+
- Improved the ``-Wtautological-overlap-compare`` diagnostics to warn about overlapping and non-overlapping ranges involving character literals and floating-point literals.
519+
The warning message for non-overlapping cases has also been improved (#GH13473).
520+
515521
Improvements to Clang's time-trace
516522
----------------------------------
517523

@@ -679,6 +685,9 @@ Bug Fixes to C++ Support
679685
whose type depends on itself. (#GH51347), (#GH55872)
680686
- Improved parser recovery of invalid requirement expressions. In turn, this
681687
fixes crashes from follow-on processing of the invalid requirement. (#GH138820)
688+
- Fixed the handling of pack indexing types in the constraints of a member function redeclaration. (#GH138255)
689+
- Clang now correctly parses arbitrary order of ``[[]]``, ``__attribute__`` and ``alignas`` attributes for declarations (#GH133107)
690+
- Fixed a crash when forming an invalid function type in a dependent context. (#GH138657) (#GH115725) (#GH68852)
682691

683692
Bug Fixes to AST Handling
684693
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -728,6 +737,9 @@ X86 Support
728737

729738
Arm and AArch64 Support
730739
^^^^^^^^^^^^^^^^^^^^^^^
740+
741+
- Support has been added for the following processors (command-line identifiers in parentheses):
742+
- Arm Cortex-A320 (``cortex-a320``)
731743
- For ARM targets, cc1as now considers the FPU's features for the selected CPU or Architecture.
732744
- The ``+nosimd`` attribute is now fully supported for ARM. Previously, this had no effect when being used with
733745
ARM targets, however this will now disable NEON instructions being generated. The ``simd`` option is
@@ -901,14 +913,19 @@ OpenMP Support
901913
- Added support 'no_openmp_constructs' assumption clause.
902914
- Added support for 'self_maps' in map and requirement clause.
903915
- Added support for 'omp stripe' directive.
916+
- Fixed a crashing bug with ``omp unroll partial`` if the argument to
917+
``partial`` was an invalid expression. (#GH139267)
904918
- Fixed a crashing bug with ``omp tile sizes`` if the argument to ``sizes`` was
905919
an invalid expression. (#GH139073)
920+
- Fixed a crashing bug with ``omp distribute dist_schedule`` if the argument to
921+
``dist_schedule`` was not strictly positive. (#GH139266)
906922

907923
Improvements
908924
^^^^^^^^^^^^
909925

910926
Additional Information
911-
======================
927+
928+
===================
912929

913930
A wide variety of additional information is available on the `Clang web
914931
page <https://clang.llvm.org/>`_. The web page contains versions of the

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: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2560,7 +2560,9 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
25602560
bool isFunctionProtoType() const { return getAs<FunctionProtoType>(); }
25612561
bool isPointerType() const;
25622562
bool isPointerOrReferenceType() const;
2563-
bool isSignableType() const;
2563+
bool isSignableType(const ASTContext &Ctx) const;
2564+
bool isSignablePointerType() const;
2565+
bool isSignableIntegerType(const ASTContext &Ctx) const;
25642566
bool isAnyPointerType() const; // Any C pointer or ObjC object pointer
25652567
bool isCountAttributedType() const;
25662568
bool isBlockPointerType() const;
@@ -5976,7 +5978,6 @@ class PackIndexingType final
59765978
private llvm::TrailingObjects<PackIndexingType, QualType> {
59775979
friend TrailingObjects;
59785980

5979-
const ASTContext &Context;
59805981
QualType Pattern;
59815982
Expr *IndexExpr;
59825983

@@ -5987,9 +5988,8 @@ class PackIndexingType final
59875988

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

59945994
public:
59955995
Expr *getIndexExpr() const { return IndexExpr; }
@@ -6024,14 +6024,10 @@ class PackIndexingType final
60246024
return T->getTypeClass() == PackIndexing;
60256025
}
60266026

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

60366032
private:
60376033
const QualType *getExpansionsPtr() const {
@@ -8222,7 +8218,13 @@ inline bool Type::isAnyPointerType() const {
82228218
return isPointerType() || isObjCObjectPointerType();
82238219
}
82248220

8225-
inline bool Type::isSignableType() const { return isPointerType(); }
8221+
inline bool Type::isSignableType(const ASTContext &Ctx) const {
8222+
return isSignablePointerType() || isSignableIntegerType(Ctx);
8223+
}
8224+
8225+
inline bool Type::isSignablePointerType() const {
8226+
return isPointerType() || isObjCClassType() || isObjCQualifiedClassType();
8227+
}
82268228

82278229
inline bool Type::isBlockPointerType() const {
82288230
return isa<BlockPointerType>(CanonicalType);

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/Basic/CodeGenOptions.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,9 @@ class CodeGenOptions : public CodeGenOptionsBase {
499499
/// The name of a file to use with \c .secure_log_unique directives.
500500
std::string AsSecureLogFile;
501501

502+
/// A list of functions that are replacable by the loader.
503+
std::vector<std::string> LoaderReplaceableFunctionNames;
504+
502505
public:
503506
// Define accessors/mutators for code generation options of enumeration type.
504507
#define CODEGENOPT(Name, Bits, Default)
@@ -571,6 +574,12 @@ class CodeGenOptions : public CodeGenOptionsBase {
571574
/// Reset all of the options that are not considered when building a
572575
/// module.
573576
void resetNonModularOptions(StringRef ModuleFormat);
577+
578+
// Is the given function name one of the functions that can be replaced by the
579+
// loader?
580+
bool isLoaderReplaceableFunctionName(StringRef FuncName) const {
581+
return llvm::is_contained(LoaderReplaceableFunctionNames, FuncName);
582+
}
574583
};
575584

576585
} // end namespace clang

0 commit comments

Comments
 (0)