Skip to content

Commit 217a92f

Browse files
authored
Merge branch 'main' into update-newlines-to-LF
2 parents 31a7d6d + 31a6fed commit 217a92f

File tree

732 files changed

+22241
-7392
lines changed

Some content is hidden

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

732 files changed

+22241
-7392
lines changed

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,10 +2517,8 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
25172517
createInstrIncMemory(const MCSymbol *Target, MCContext *Ctx, bool IsLeaf,
25182518
unsigned CodePointerSize) const override {
25192519
unsigned int I = 0;
2520-
InstructionListType Instrs(IsLeaf ? 12 : 10);
2520+
InstructionListType Instrs(10);
25212521

2522-
if (IsLeaf)
2523-
createStackPointerIncrement(Instrs[I++], 128);
25242522
createPushRegisters(Instrs[I++], AArch64::X0, AArch64::X1);
25252523
getSystemFlag(Instrs[I++], AArch64::X1);
25262524
InstructionListType Addr = materializeAddress(Target, Ctx, AArch64::X0);
@@ -2535,8 +2533,6 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
25352533
loadReg(Instrs[I++], AArch64::X2, AArch64::SP);
25362534
setSystemFlag(Instrs[I++], AArch64::X1);
25372535
createPopRegisters(Instrs[I++], AArch64::X0, AArch64::X1);
2538-
if (IsLeaf)
2539-
createStackPointerDecrement(Instrs[I++], 128);
25402536
return Instrs;
25412537
}
25422538

clang-tools-extra/test/clang-tidy/check_clang_tidy.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,7 @@ def parse_arguments() -> Tuple[argparse.Namespace, List[str]]:
391391
args, extra_args = parser.parse_known_args()
392392
if args.std is None:
393393
_, extension = os.path.splitext(args.assume_filename or args.input_file_name)
394-
args.std = [
395-
"c++11-or-later" if extension in [".cpp", ".hpp", ".mm"] else "c99-or-later"
396-
]
394+
args.std = ["c99-or-later" if extension in [".c", ".m"] else "c++11-or-later"]
397395

398396
return (args, extra_args)
399397

clang/bindings/python/clang/cindex.py

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"tuple[str, Optional[list[Any]], Any]",
111111
"tuple[str, Optional[list[Any]], Any, Callable[..., Any]]",
112112
]
113+
CObjP: TypeAlias = _Pointer[Any]
113114

114115
TSeq = TypeVar("TSeq", covariant=True)
115116

@@ -2981,25 +2982,25 @@ class _CXUnsavedFile(Structure):
29812982

29822983
class CompletionChunk:
29832984
class Kind:
2984-
def __init__(self, name):
2985+
def __init__(self, name: str):
29852986
self.name = name
29862987

2987-
def __str__(self):
2988+
def __str__(self) -> str:
29882989
return self.name
29892990

2990-
def __repr__(self):
2991+
def __repr__(self) -> str:
29912992
return "<ChunkKind: %s>" % self
29922993

2993-
def __init__(self, completionString, key):
2994+
def __init__(self, completionString: CObjP, key: int):
29942995
self.cs = completionString
29952996
self.key = key
29962997
self.__kindNumberCache = -1
29972998

2998-
def __repr__(self):
2999+
def __repr__(self) -> str:
29993000
return "{'" + self.spelling + "', " + str(self.kind) + "}"
30003001

30013002
@CachedProperty
3002-
def spelling(self):
3003+
def spelling(self) -> str:
30033004
if self.__kindNumber in SPELLING_CACHE:
30043005
return SPELLING_CACHE[self.__kindNumber]
30053006
return _CXString.from_result(
@@ -3010,38 +3011,38 @@ def spelling(self):
30103011
# apparently still significantly faster. Please profile carefully if you
30113012
# would like to add CachedProperty back.
30123013
@property
3013-
def __kindNumber(self):
3014+
def __kindNumber(self) -> int:
30143015
if self.__kindNumberCache == -1:
30153016
self.__kindNumberCache = conf.lib.clang_getCompletionChunkKind(
30163017
self.cs, self.key
30173018
)
30183019
return self.__kindNumberCache
30193020

30203021
@CachedProperty
3021-
def kind(self):
3022+
def kind(self) -> Kind:
30223023
return completionChunkKindMap[self.__kindNumber]
30233024

30243025
@CachedProperty
3025-
def string(self):
3026+
def string(self) -> CompletionString | None:
30263027
res = conf.lib.clang_getCompletionChunkCompletionString(self.cs, self.key)
30273028

30283029
if not res:
30293030
return None
30303031
return CompletionString(res)
30313032

3032-
def isKindOptional(self):
3033+
def isKindOptional(self) -> bool:
30333034
return self.__kindNumber == 0
30343035

3035-
def isKindTypedText(self):
3036+
def isKindTypedText(self) -> bool:
30363037
return self.__kindNumber == 1
30373038

3038-
def isKindPlaceHolder(self):
3039+
def isKindPlaceHolder(self) -> bool:
30393040
return self.__kindNumber == 3
30403041

3041-
def isKindInformative(self):
3042+
def isKindInformative(self) -> bool:
30423043
return self.__kindNumber == 4
30433044

3044-
def isKindResultType(self):
3045+
def isKindResultType(self) -> bool:
30453046
return self.__kindNumber == 15
30463047

30473048

@@ -3081,39 +3082,39 @@ def __str__(self):
30813082
def __repr__(self):
30823083
return "<Availability: %s>" % self
30833084

3084-
def __len__(self):
3085+
def __len__(self) -> int:
30853086
return self.num_chunks
30863087

30873088
@CachedProperty
3088-
def num_chunks(self):
3089+
def num_chunks(self) -> int:
30893090
return conf.lib.clang_getNumCompletionChunks(self.obj) # type: ignore [no-any-return]
30903091

3091-
def __getitem__(self, key):
3092+
def __getitem__(self, key: int) -> CompletionChunk:
30923093
if self.num_chunks <= key:
30933094
raise IndexError
30943095
return CompletionChunk(self.obj, key)
30953096

30963097
if TYPE_CHECKING:
30973098
# Defining __getitem__ and __len__ is enough to make an iterable
30983099
# but the typechecker doesn't understand that.
3099-
def __iter__(self):
3100+
def __iter__(self) -> Iterator[CompletionChunk]:
31003101
for i in range(len(self)):
31013102
yield self[i]
31023103

31033104
@property
3104-
def priority(self):
3105+
def priority(self) -> int:
31053106
return conf.lib.clang_getCompletionPriority(self.obj) # type: ignore [no-any-return]
31063107

31073108
@property
3108-
def availability(self):
3109+
def availability(self) -> CompletionChunk.Kind:
31093110
res = conf.lib.clang_getCompletionAvailability(self.obj)
31103111
return availabilityKinds[res]
31113112

31123113
@property
3113-
def briefComment(self):
3114+
def briefComment(self) -> str:
31143115
return _CXString.from_result(conf.lib.clang_getCompletionBriefComment(self.obj))
31153116

3116-
def __repr__(self):
3117+
def __repr__(self) -> str:
31173118
return (
31183119
" | ".join([str(a) for a in self])
31193120
+ " || Priority: "
@@ -3136,44 +3137,47 @@ def __repr__(self):
31363137
class CodeCompletionResult(Structure):
31373138
_fields_ = [("cursorKind", c_int), ("completionString", c_object_p)]
31383139

3139-
def __repr__(self):
3140+
def __repr__(self) -> str:
31403141
return str(CompletionString(self.completionString))
31413142

31423143
@property
3143-
def kind(self):
3144+
def kind(self) -> CursorKind:
31443145
return CursorKind.from_id(self.cursorKind)
31453146

31463147
@property
3147-
def string(self):
3148+
def string(self) -> CompletionString:
31483149
return CompletionString(self.completionString)
31493150

31503151

31513152
class CCRStructure(Structure):
31523153
_fields_ = [("results", POINTER(CodeCompletionResult)), ("numResults", c_int)]
31533154

3154-
def __len__(self):
3155+
results: NoSliceSequence[CodeCompletionResult]
3156+
numResults: int
3157+
3158+
def __len__(self) -> int:
31553159
return self.numResults
31563160

3157-
def __getitem__(self, key):
3161+
def __getitem__(self, key: int) -> CodeCompletionResult:
31583162
if len(self) <= key:
31593163
raise IndexError
31603164

31613165
return self.results[key]
31623166

31633167

31643168
class CodeCompletionResults(ClangObject):
3165-
def __init__(self, ptr):
3169+
def __init__(self, ptr: _Pointer[CCRStructure]):
31663170
assert isinstance(ptr, POINTER(CCRStructure)) and ptr
31673171
self.ptr = self._as_parameter_ = ptr
31683172

3169-
def from_param(self):
3173+
def from_param(self) -> _Pointer[CCRStructure]:
31703174
return self._as_parameter_
31713175

3172-
def __del__(self):
3176+
def __del__(self) -> None:
31733177
conf.lib.clang_disposeCodeCompleteResults(self)
31743178

31753179
@property
3176-
def results(self):
3180+
def results(self) -> CCRStructure:
31773181
return self.ptr.contents
31783182

31793183
@property

clang/docs/LanguageExtensions.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,12 +875,14 @@ of different sizes and signs is forbidden in binary and ternary builtins.
875875
for the comparison.
876876
T __builtin_elementwise_fshl(T x, T y, T z) perform a funnel shift left. Concatenate x and y (x is the most integer types
877877
significant bits of the wide value), the combined value is shifted
878-
left by z, and the most significant bits are extracted to produce
878+
left by z (modulo the bit width of the original arguments),
879+
and the most significant bits are extracted to produce
879880
a result that is the same size as the original arguments.
880881

881882
T __builtin_elementwise_fshr(T x, T y, T z) perform a funnel shift right. Concatenate x and y (x is the most integer types
882883
significant bits of the wide value), the combined value is shifted
883-
right by z, and the least significant bits are extracted to produce
884+
right by z (modulo the bit width of the original arguments),
885+
and the least significant bits are extracted to produce
884886
a result that is the same size as the original arguments.
885887
T __builtin_elementwise_ctlz(T x[, T y]) return the number of leading 0 bits in the first argument. If integer types
886888
the first argument is 0 and an optional second argument is provided,

clang/docs/ReleaseNotes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ C++ Specific Potentially Breaking Changes
8484
static_assert((b.*mp)() == 1); // newly rejected
8585
static_assert((c.*mp)() == 1); // accepted
8686
87+
- ``VarTemplateSpecializationDecl::getTemplateArgsAsWritten()`` method now
88+
returns ``nullptr`` for implicitly instantiated declarations.
89+
8790
ABI Changes in This Version
8891
---------------------------
8992

@@ -219,6 +222,7 @@ Deprecated Compiler Flags
219222

220223
Modified Compiler Flags
221224
-----------------------
225+
- The `-gkey-instructions` compiler flag is now enabled by default when DWARF is emitted for plain C/C++ and optimizations are enabled. (#GH149509)
222226

223227
Removed Compiler Flags
224228
-------------------------
@@ -337,6 +341,8 @@ Bug Fixes to C++ Support
337341
- Fix the parsing of variadic member functions when the ellipis immediately follows a default argument.(#GH153445)
338342
- Fixed a bug that caused ``this`` captured by value in a lambda with a dependent explicit object parameter to not be
339343
instantiated properly. (#GH154054)
344+
- Fixed a crash when implicit conversions from initialize list to arrays of
345+
unknown bound during constant evaluation. (#GH151716)
340346

341347
Bug Fixes to AST Handling
342348
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/AttrDocs.td

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3752,45 +3752,45 @@ functions intended for different purposes have distinct CFI identities.
37523752

37533753
// Header file - define convenience macros
37543754
#define __cfi_salt(s) __attribute__((cfi_salt(s)))
3755-
3755+
37563756
// Typedef for regular function pointers
37573757
typedef int (*fptr_t)(void);
3758-
3759-
// Typedef for salted function pointers
3758+
3759+
// Typedef for salted function pointers
37603760
typedef int (*fptr_salted_t)(void) __cfi_salt("pepper");
3761-
3761+
37623762
struct widget_ops {
37633763
fptr_t init; // Regular CFI
37643764
fptr_salted_t exec; // Salted CFI
37653765
fptr_t cleanup; // Regular CFI
37663766
};
3767-
3767+
37683768
// Function implementations
37693769
static int widget_init(void) { return 0; }
37703770
static int widget_exec(void) __cfi_salt("pepper") { return 1; }
37713771
static int widget_cleanup(void) { return 0; }
3772-
3772+
37733773
static struct widget_ops ops = {
37743774
.init = widget_init, // OK - compatible types
37753775
.exec = widget_exec, // OK - both use "pepper" salt
37763776
.cleanup = widget_cleanup // OK - compatible types
37773777
};
3778-
3778+
37793779
// Using C++11 attribute syntax
37803780
void secure_callback(void) [[clang::cfi_salt("secure")]];
3781-
3781+
37823782
// This would cause a compilation error:
37833783
// fptr_t bad_ptr = widget_exec; // Error: incompatible types
37843784

37853785
**Notes:**
37863786

37873787
* The salt string can contain non-NULL ASCII characters, including spaces and
37883788
quotes
3789-
* This attribute only applies to function types; using it on non-function
3789+
* This attribute only applies to function types; using it on non-function
37903790
types will generate a warning
3791-
* All declarations and definitions of the same function must use identical
3791+
* All declarations and definitions of the same function must use identical
37923792
salt values
3793-
* The attribute affects type compatibility during compilation and CFI hash
3793+
* The attribute affects type compatibility during compilation and CFI hash
37943794
generation during code generation
37953795
}];
37963796
}

clang/include/clang/Basic/Builtins.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,13 +1540,13 @@ def ElementwiseSubSat : Builtin {
15401540

15411541
def ElementwiseFshl : Builtin {
15421542
let Spellings = ["__builtin_elementwise_fshl"];
1543-
let Attributes = [NoThrow, Const, CustomTypeChecking];
1543+
let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr];
15441544
let Prototype = "void(...)";
15451545
}
15461546

15471547
def ElementwiseFshr : Builtin {
15481548
let Spellings = ["__builtin_elementwise_fshr"];
1549-
let Attributes = [NoThrow, Const, CustomTypeChecking];
1549+
let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr];
15501550
let Prototype = "void(...)";
15511551
}
15521552

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,5 +835,15 @@ TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x128_iu8, "V8iIbV8iIbV16iV8iiIbI
835835
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x64_f16, "V8fIbV16hIbV32hV8fiIbIb", "nc", "gfx1250-insts,wavefrontsize32")
836836
TARGET_BUILTIN(__builtin_amdgcn_swmmac_f16_16x16x64_f16, "V8hIbV16hIbV32hV8hiIbIb", "nc", "gfx1250-insts,wavefrontsize32")
837837

838+
// GFX12.5 128B cooperative atomics
839+
TARGET_BUILTIN(__builtin_amdgcn_cooperative_atomic_load_32x4B, "ii*IicC*", "nc", "gfx1250-insts,wavefrontsize32")
840+
TARGET_BUILTIN(__builtin_amdgcn_cooperative_atomic_store_32x4B, "vi*iIicC*", "nc", "gfx1250-insts,wavefrontsize32")
841+
842+
TARGET_BUILTIN(__builtin_amdgcn_cooperative_atomic_load_16x8B, "V2iV2i*IicC*", "nc", "gfx1250-insts,wavefrontsize32")
843+
TARGET_BUILTIN(__builtin_amdgcn_cooperative_atomic_store_16x8B, "vV2i*V2iIicC*", "nc", "gfx1250-insts,wavefrontsize32")
844+
845+
TARGET_BUILTIN(__builtin_amdgcn_cooperative_atomic_load_8x16B, "V4iV4i*IicC*", "nc", "gfx1250-insts,wavefrontsize32")
846+
TARGET_BUILTIN(__builtin_amdgcn_cooperative_atomic_store_8x16B, "vV4i*V4iIicC*", "nc", "gfx1250-insts,wavefrontsize32")
847+
838848
#undef BUILTIN
839849
#undef TARGET_BUILTIN

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13609,4 +13609,6 @@ def warn_acc_var_referenced_lacks_op
1360913609
// AMDGCN builtins diagnostics
1361013610
def err_amdgcn_load_lds_size_invalid_value : Error<"invalid size value">;
1361113611
def note_amdgcn_load_lds_size_valid_value : Note<"size must be %select{1, 2, or 4|1, 2, 4, 12 or 16}0">;
13612+
13613+
def err_amdgcn_coop_atomic_invalid_as : Error<"cooperative atomic requires a global or generic pointer">;
1361213614
} // end of sema component.

clang/include/clang/Basic/arm_sve.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,7 @@ let SVETargetGuard = "sve2,lut", SMETargetGuard = "sme2,lut" in {
18281828
////////////////////////////////////////////////////////////////////////////////
18291829
// SVE2 - Optional
18301830

1831-
let SVETargetGuard = "sve2,sve-aes", SMETargetGuard = "ssve-aes" in {
1831+
let SVETargetGuard = "sve-aes", SMETargetGuard = "ssve-aes" in {
18321832
def SVAESD : SInst<"svaesd[_{d}]", "ddd", "Uc", MergeNone, "aarch64_sve_aesd", [IsOverloadNone, VerifyRuntimeMode]>;
18331833
def SVAESIMC : SInst<"svaesimc[_{d}]", "dd", "Uc", MergeNone, "aarch64_sve_aesimc", [IsOverloadNone, VerifyRuntimeMode]>;
18341834
def SVAESE : SInst<"svaese[_{d}]", "ddd", "Uc", MergeNone, "aarch64_sve_aese", [IsOverloadNone, VerifyRuntimeMode]>;
@@ -1845,12 +1845,12 @@ let SVETargetGuard = "sve-sha3", SMETargetGuard = "sve-sha3,sme2p1" in {
18451845
def SVRAX1 : SInst<"svrax1[_{d}]", "ddd", "lUl", MergeNone, "aarch64_sve_rax1", [IsOverloadNone, VerifyRuntimeMode]>;
18461846
}
18471847

1848-
let SVETargetGuard = "sve2-sm4", SMETargetGuard = InvalidMode in {
1848+
let SVETargetGuard = "sve-sm4", SMETargetGuard = InvalidMode in {
18491849
def SVSM4E : SInst<"svsm4e[_{d}]", "ddd", "Ui", MergeNone, "aarch64_sve_sm4e", [IsOverloadNone]>;
18501850
def SVSM4EKEY : SInst<"svsm4ekey[_{d}]", "ddd", "Ui", MergeNone, "aarch64_sve_sm4ekey", [IsOverloadNone]>;
18511851
}
18521852

1853-
let SVETargetGuard = "sve2,sve-bitperm", SMETargetGuard = "ssve-bitperm" in {
1853+
let SVETargetGuard = "sve-bitperm", SMETargetGuard = "ssve-bitperm" in {
18541854
def SVBDEP : SInst<"svbdep[_{d}]", "ddd", "UcUsUiUl", MergeNone, "aarch64_sve_bdep_x", [VerifyRuntimeMode]>;
18551855
def SVBDEP_N : SInst<"svbdep[_n_{d}]", "dda", "UcUsUiUl", MergeNone, "aarch64_sve_bdep_x", [VerifyRuntimeMode]>;
18561856
def SVBEXT : SInst<"svbext[_{d}]", "ddd", "UcUsUiUl", MergeNone, "aarch64_sve_bext_x", [VerifyRuntimeMode]>;
@@ -1979,7 +1979,7 @@ let SVETargetGuard = "sve2p1", SMETargetGuard = "sme2" in {
19791979
def SVPFALSE_COUNT_ALIAS : SInst<"svpfalse_c", "}v", "", MergeNone, "", [IsOverloadNone, VerifyRuntimeMode]>;
19801980
}
19811981

1982-
let SVETargetGuard = "sve2,sve-b16b16", SMETargetGuard = "sme2,sve-b16b16" in {
1982+
let SVETargetGuard = "sve-b16b16", SMETargetGuard = "sme2,sve-b16b16" in {
19831983
defm SVMUL_BF : SInstZPZZ<"svmul", "b", "aarch64_sve_fmul", "aarch64_sve_fmul_u", [VerifyRuntimeMode]>;
19841984
defm SVADD_BF : SInstZPZZ<"svadd", "b", "aarch64_sve_fadd", "aarch64_sve_fadd_u", [VerifyRuntimeMode]>;
19851985
defm SVSUB_BF : SInstZPZZ<"svsub", "b", "aarch64_sve_fsub", "aarch64_sve_fsub_u", [VerifyRuntimeMode]>;

0 commit comments

Comments
 (0)