Skip to content

Commit 57868b9

Browse files
author
iclsrc
committed
Merge from 'main' to 'sycl-web' (57 commits)
2 parents 31afb43 + ef51514 commit 57868b9

File tree

236 files changed

+12464
-4995
lines changed

Some content is hidden

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

236 files changed

+12464
-4995
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
'generic-abi-unstable',
129129
'generic-hardening-mode-debug',
130130
'generic-hardening-mode-extensive',
131+
'generic-hardening-mode-extensive-observe-semantic',
131132
'generic-hardening-mode-fast',
132133
'generic-hardening-mode-fast-with-abi-breaks',
133134
'generic-merged',

clang-tools-extra/clang-doc/Representation.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -502,13 +502,13 @@ ClangDocContext::ClangDocContext(tooling::ExecutionContext *ECtx,
502502
}
503503

504504
void ScopeChildren::sort() {
505-
llvm::sort(Namespaces.begin(), Namespaces.end());
506-
llvm::sort(Records.begin(), Records.end());
507-
llvm::sort(Functions.begin(), Functions.end());
508-
llvm::sort(Enums.begin(), Enums.end());
509-
llvm::sort(Typedefs.begin(), Typedefs.end());
510-
llvm::sort(Concepts.begin(), Concepts.end());
511-
llvm::sort(Variables.begin(), Variables.end());
505+
llvm::sort(Namespaces);
506+
llvm::sort(Records);
507+
llvm::sort(Functions);
508+
llvm::sort(Enums);
509+
llvm::sort(Typedefs);
510+
llvm::sort(Concepts);
511+
llvm::sort(Variables);
512512
}
513513
} // namespace doc
514514
} // namespace clang

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ Bug Fixes to C++ Support
149149
- Diagnose binding a reference to ``*nullptr`` during constant evaluation. (#GH48665)
150150
- Suppress ``-Wdeprecated-declarations`` in implicitly generated functions. (#GH147293)
151151
- Fix a crash when deleting a pointer to an incomplete array (#GH150359).
152+
- Fix an assertion failure when expression in assumption attribute
153+
(``[[assume(expr)]]``) creates temporary objects.
152154

153155
Bug Fixes to AST Handling
154156
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9437,8 +9437,28 @@ def err_atomic_builtin_pointer_size : Error<
94379437
"address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte "
94389438
"type (%0 invalid)">;
94399439
def err_atomic_exclusive_builtin_pointer_size : Error<
9440-
"address argument to load or store exclusive builtin must be a pointer to"
9441-
" 1,2,4 or 8 byte type (%0 invalid)">;
9440+
"address argument to load or store exclusive builtin must be a pointer to "
9441+
// Because the range of legal sizes for load/store exclusive varies with the
9442+
// Arm architecture version, this error message wants to be able to specify
9443+
// various different subsets of the sizes 1, 2, 4, 8. Rather than make a
9444+
// separate diagnostic for each subset, I've arranged here that _this_ error
9445+
// can display any combination of the sizes. For each size there are two
9446+
// %select parameters: the first chooses whether you need a "," or " or " to
9447+
// separate the number from a previous one (or neither), and the second
9448+
// parameter indicates whether to display the number itself.
9449+
//
9450+
// (The very first of these parameters isn't really necessary, since you
9451+
// never want to start with "," or " or " before the first number in the
9452+
// list, but it keeps it simple to make it look exactly like the other cases,
9453+
// and also allows a loop constructing this diagnostic to handle every case
9454+
// exactly the same.)
9455+
"%select{|,| or }1%select{|1}2"
9456+
"%select{|,| or }3%select{|2}4"
9457+
"%select{|,| or }5%select{|4}6"
9458+
"%select{|,| or }7%select{|8}8"
9459+
" byte type (%0 invalid)">;
9460+
def err_atomic_exclusive_builtin_pointer_size_none : Error<
9461+
"load and store exclusive builtins are not available on this architecture">;
94429462
def err_atomic_builtin_ext_int_size : Error<
94439463
"atomic memory operand must have a power-of-two size">;
94449464
def err_atomic_builtin_bit_int_prohibit : Error<

clang/include/clang/Basic/TargetInfo.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,17 @@ class TargetInfo : public TransferrableTargetInfo,
10711071
/// as Custom Datapath.
10721072
uint32_t getARMCDECoprocMask() const { return ARMCDECoprocMask; }
10731073

1074+
/// For ARM targets returns a mask defining which data sizes are suitable for
1075+
/// __builtin_arm_ldrex and __builtin_arm_strex.
1076+
enum {
1077+
ARM_LDREX_B = (1 << 0), /// byte (8-bit)
1078+
ARM_LDREX_H = (1 << 1), /// half (16-bit)
1079+
ARM_LDREX_W = (1 << 2), /// word (32-bit)
1080+
ARM_LDREX_D = (1 << 3), /// double (64-bit)
1081+
};
1082+
1083+
virtual unsigned getARMLDREXMask() const { return 0; }
1084+
10741085
/// Returns whether the passed in string is a valid clobber in an
10751086
/// inline asm statement.
10761087
///

clang/include/clang/CIR/Dialect/IR/CIRAttrs.td

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CIR_TypedAttr<string name, string attrMnemonic, list<Trait> traits = []>
4242
let assemblyFormat = [{}];
4343
}
4444

45-
class CIRUnitAttr<string name, string attrMnemonic, list<Trait> traits = []>
45+
class CIR_UnitAttr<string name, string attrMnemonic, list<Trait> traits = []>
4646
: CIR_Attr<name, attrMnemonic, traits> {
4747
let returnType = "bool";
4848
let defaultValue = "false";
@@ -127,7 +127,7 @@ def CIR_BoolAttr : CIR_Attr<"Bool", "bool", [TypedAttrInterface]> {
127127
// ZeroAttr
128128
//===----------------------------------------------------------------------===//
129129

130-
def ZeroAttr : CIR_TypedAttr<"Zero", "zero"> {
130+
def CIR_ZeroAttr : CIR_TypedAttr<"Zero", "zero"> {
131131
let summary = "Attribute to represent zero initialization";
132132
let description = [{
133133
The ZeroAttr is used to indicate zero initialization on structs.
@@ -138,7 +138,7 @@ def ZeroAttr : CIR_TypedAttr<"Zero", "zero"> {
138138
// UndefAttr
139139
//===----------------------------------------------------------------------===//
140140

141-
def UndefAttr : CIR_TypedAttr<"Undef", "undef"> {
141+
def CIR_UndefAttr : CIR_TypedAttr<"Undef", "undef"> {
142142
let summary = "Represent an undef constant";
143143
let description = [{
144144
The UndefAttr represents an undef constant, corresponding to LLVM's notion
@@ -264,7 +264,9 @@ def CIR_FPAttr : CIR_Attr<"FP", "fp", [TypedAttrInterface]> {
264264
// ConstArrayAttr
265265
//===----------------------------------------------------------------------===//
266266

267-
def ConstArrayAttr : CIR_Attr<"ConstArray", "const_array", [TypedAttrInterface]> {
267+
def CIR_ConstArrayAttr : CIR_Attr<"ConstArray", "const_array", [
268+
TypedAttrInterface
269+
]> {
268270
let summary = "A constant array from ArrayAttr or StringRefAttr";
269271
let description = [{
270272
An CIR array attribute is an array of literals of the specified attr types.
@@ -310,8 +312,9 @@ def ConstArrayAttr : CIR_Attr<"ConstArray", "const_array", [TypedAttrInterface]>
310312
// ConstVectorAttr
311313
//===----------------------------------------------------------------------===//
312314

313-
def ConstVectorAttr : CIR_Attr<"ConstVector", "const_vector",
314-
[TypedAttrInterface]> {
315+
def CIR_ConstVectorAttr : CIR_Attr<"ConstVector", "const_vector", [
316+
TypedAttrInterface
317+
]> {
315318
let summary = "A constant vector from ArrayAttr";
316319
let description = [{
317320
A CIR vector attribute is an array of literals of the specified attribute
@@ -342,7 +345,7 @@ def ConstVectorAttr : CIR_Attr<"ConstVector", "const_vector",
342345
// ConstPtrAttr
343346
//===----------------------------------------------------------------------===//
344347

345-
def ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> {
348+
def CIR_ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> {
346349
let summary = "Holds a constant pointer value";
347350
let parameters = (ins
348351
AttributeSelfTypeParameter<"", "::cir::PointerType">:$type,
@@ -371,8 +374,9 @@ def ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> {
371374
// ConstComplexAttr
372375
//===----------------------------------------------------------------------===//
373376

374-
def ConstComplexAttr : CIR_Attr<"ConstComplex", "const_complex",
375-
[TypedAttrInterface]> {
377+
def CIR_ConstComplexAttr : CIR_Attr<"ConstComplex", "const_complex", [
378+
TypedAttrInterface
379+
]> {
376380
let summary = "An attribute that contains a constant complex value";
377381
let description = [{
378382
The `#cir.const_complex` attribute contains a constant value of complex
@@ -454,7 +458,7 @@ def CIR_VisibilityAttr : CIR_EnumAttr<CIR_VisibilityKind, "visibility"> {
454458
// BitfieldInfoAttr
455459
//===----------------------------------------------------------------------===//
456460

457-
def BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> {
461+
def CIR_BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> {
458462
let summary = "Represents info for a bit-field member";
459463
let description = [{
460464
Holds the following information about bitfields: name, storage type, size
@@ -512,5 +516,4 @@ def BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> {
512516
];
513517
}
514518

515-
516519
#endif // CLANG_CIR_DIALECT_IR_CIRATTRS_TD

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,7 @@ def CIR_SetBitfieldOp : CIR_Op<"set_bitfield"> {
17471747
let arguments = (ins
17481748
Arg<CIR_PointerType, "the address to store the value", [MemWrite]>:$addr,
17491749
CIR_AnyType:$src,
1750-
BitfieldInfoAttr:$bitfield_info,
1750+
CIR_BitfieldInfoAttr:$bitfield_info,
17511751
DefaultValuedOptionalAttr<I64Attr, "0">:$alignment,
17521752
UnitAttr:$is_volatile
17531753
);
@@ -1834,7 +1834,7 @@ def CIR_GetBitfieldOp : CIR_Op<"get_bitfield"> {
18341834

18351835
let arguments = (ins
18361836
Arg<CIR_PointerType, "the address to load from", [MemRead]>:$addr,
1837-
BitfieldInfoAttr:$bitfield_info,
1837+
CIR_BitfieldInfoAttr:$bitfield_info,
18381838
DefaultValuedOptionalAttr<I64Attr, "0">:$alignment,
18391839
UnitAttr:$is_volatile
18401840
);

clang/include/clang/Frontend/FrontendAction.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ class FrontendAction {
8484
/// \return True on success; on failure ExecutionAction() and
8585
/// EndSourceFileAction() will not be called.
8686
virtual bool BeginSourceFileAction(CompilerInstance &CI) {
87+
if (CurrentInput.isPreprocessed())
88+
CI.getPreprocessor().SetMacroExpansionOnlyInDirectives();
8789
return true;
8890
}
8991

@@ -98,7 +100,11 @@ class FrontendAction {
98100
///
99101
/// This is guaranteed to only be called following a successful call to
100102
/// BeginSourceFileAction (and BeginSourceFile).
101-
virtual void EndSourceFileAction() {}
103+
virtual void EndSourceFileAction() {
104+
if (CurrentInput.isPreprocessed())
105+
// Reset the preprocessor macro expansion to the default.
106+
getCompilerInstance().getPreprocessor().SetEnableMacroExpansion();
107+
}
102108

103109
/// Callback at the end of processing a single input, to determine
104110
/// if the output files should be erased or not.

clang/include/clang/Lex/Preprocessor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,6 +1848,10 @@ class Preprocessor {
18481848
MacroExpansionInDirectivesOverride = true;
18491849
}
18501850

1851+
void SetEnableMacroExpansion() {
1852+
DisableMacroExpansion = MacroExpansionInDirectivesOverride = false;
1853+
}
1854+
18511855
/// Peeks ahead N tokens and returns that token without consuming any
18521856
/// tokens.
18531857
///

clang/include/clang/Sema/SemaARM.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class SemaARM : public SemaBase {
4444

4545
bool CheckImmediateArg(CallExpr *TheCall, unsigned CheckTy, unsigned ArgIdx,
4646
unsigned EltBitWidth, unsigned VecBitWidth);
47-
bool CheckARMBuiltinExclusiveCall(unsigned BuiltinID, CallExpr *TheCall,
48-
unsigned MaxWidth);
47+
bool CheckARMBuiltinExclusiveCall(const TargetInfo &TI, unsigned BuiltinID,
48+
CallExpr *TheCall);
4949
bool CheckNeonBuiltinFunctionCall(const TargetInfo &TI, unsigned BuiltinID,
5050
CallExpr *TheCall);
5151
bool PerformNeonImmChecks(

0 commit comments

Comments
 (0)