Skip to content

Commit c55d66a

Browse files
authored
Merge branch 'main' into users/joncoh-apple/split_neon_loads
2 parents ad86eaa + a102342 commit c55d66a

File tree

722 files changed

+67506
-13717
lines changed

Some content is hidden

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

722 files changed

+67506
-13717
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static auto SerializeReferenceLambda = [](const auto &Ref, Object &Object) {
4545

4646
static json::Object
4747
serializeLocation(const Location &Loc,
48-
const std::optional<StringRef> &RepositoryUrl) {
48+
const std::optional<StringRef> RepositoryUrl) {
4949
Object LocationObj = Object();
5050
LocationObj["LineNumber"] = Loc.StartLineNumber;
5151
LocationObj["Filename"] = Loc.Filename;
@@ -169,7 +169,7 @@ static json::Value serializeComment(const CommentInfo &I) {
169169

170170
static void
171171
serializeCommonAttributes(const Info &I, json::Object &Obj,
172-
const std::optional<StringRef> &RepositoryUrl) {
172+
const std::optional<StringRef> RepositoryUrl) {
173173
Obj["Name"] = I.Name;
174174
Obj["USR"] = toHex(toStringRef(I.USR));
175175

@@ -211,9 +211,9 @@ static void serializeReference(const Reference &Ref, Object &ReferenceObj) {
211211
// differently. Only enums, records, and typedefs are handled here.
212212
static void
213213
serializeCommonChildren(const ScopeChildren &Children, json::Object &Obj,
214-
const std::optional<StringRef> &RepositoryUrl) {
215-
static auto SerializeInfo = [&RepositoryUrl](const auto &Info,
216-
Object &Object) {
214+
const std::optional<StringRef> RepositoryUrl) {
215+
static auto SerializeInfo = [RepositoryUrl](const auto &Info,
216+
Object &Object) {
217217
serializeInfo(Info, Object, RepositoryUrl);
218218
};
219219

@@ -304,7 +304,7 @@ static void serializeInfo(const FieldTypeInfo &I, Object &Obj) {
304304
}
305305

306306
static void serializeInfo(const FunctionInfo &F, json::Object &Obj,
307-
const std::optional<StringRef> &RepositoryURL) {
307+
const std::optional<StringRef> RepositoryURL) {
308308
serializeCommonAttributes(F, Obj, RepositoryURL);
309309
Obj["IsStatic"] = F.IsStatic;
310310

@@ -459,7 +459,7 @@ static void serializeInfo(const RecordInfo &I, json::Object &Obj,
459459
}
460460

461461
static void serializeInfo(const VarInfo &I, json::Object &Obj,
462-
const std::optional<StringRef> &RepositoryUrl) {
462+
const std::optional<StringRef> RepositoryUrl) {
463463
serializeCommonAttributes(I, Obj, RepositoryUrl);
464464
Obj["IsStatic"] = I.IsStatic;
465465
auto TypeObj = Object();
@@ -468,15 +468,15 @@ static void serializeInfo(const VarInfo &I, json::Object &Obj,
468468
}
469469

470470
static void serializeInfo(const NamespaceInfo &I, json::Object &Obj,
471-
const std::optional<StringRef> &RepositoryUrl) {
471+
const std::optional<StringRef> RepositoryUrl) {
472472
serializeCommonAttributes(I, Obj, RepositoryUrl);
473473

474474
if (!I.Children.Namespaces.empty())
475475
serializeArray(I.Children.Namespaces, Obj, "Namespaces",
476476
SerializeReferenceLambda);
477477

478-
static auto SerializeInfo = [&RepositoryUrl](const auto &Info,
479-
Object &Object) {
478+
static auto SerializeInfo = [RepositoryUrl](const auto &Info,
479+
Object &Object) {
480480
serializeInfo(Info, Object, RepositoryUrl);
481481
};
482482

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6015,6 +6015,16 @@ the configuration (without a prefix: ``Auto``).
60156015
#include "B/A.h" #include "B/a.h"
60166016
#include "B/a.h" #include "a/b.h"
60176017

6018+
* ``bool IgnoreExtension`` When sorting includes in each block, only take file extensions into
6019+
account if two includes compare equal otherwise.
6020+
6021+
.. code-block:: c++
6022+
6023+
true: false:
6024+
# include "A.h" vs. # include "A-util.h"
6025+
# include "A.inc" # include "A.h"
6026+
# include "A-util.h" # include "A.inc"
6027+
60186028

60196029
.. _SortJavaStaticImport:
60206030

clang/docs/ReleaseNotes.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ Improvements to Clang's diagnostics
674674
#GH142457, #GH139913, #GH138850, #GH137867, #GH137860, #GH107840, #GH93308,
675675
#GH69470, #GH59391, #GH58172, #GH46215, #GH45915, #GH45891, #GH44490,
676676
#GH36703, #GH32903, #GH23312, #GH69874.
677-
677+
678678
- Clang no longer emits a spurious -Wdangling-gsl warning in C++23 when
679679
iterating over an element of a temporary container in a range-based
680680
for loop.(#GH109793, #GH145164)
@@ -710,6 +710,12 @@ Improvements to Clang's diagnostics
710710
pointer, provided it can be proven that the pointer only points to
711711
``[[noreturn]]`` functions.
712712

713+
- Added a separate diagnostic group ``-Wfunction-effect-redeclarations``, for the more pedantic
714+
diagnostics for function effects (``[[clang::nonblocking]]`` and ``[[clang::nonallocating]]``).
715+
Moved the warning for a missing (though implied) attribute on a redeclaration into this group.
716+
Added a new warning in this group for the case where the attribute is missing/implicit on
717+
an override of a virtual method.
718+
713719
Improvements to Clang's time-trace
714720
----------------------------------
715721

@@ -970,6 +976,7 @@ Bug Fixes to C++ Support
970976
- Fixed a crash involving list-initialization of an empty class with a
971977
non-empty initializer list. (#GH147949)
972978
- Fixed constant evaluation of equality comparisons of constexpr-unknown references. (#GH147663)
979+
- Diagnose binding a reference to ``*nullptr`` during constant evaluation. (#GH48665)
973980

974981
Bug Fixes to AST Handling
975982
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang-c/Index.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6953,6 +6953,21 @@ clang_getCursorUnaryOperatorKind(CXCursor cursor);
69536953
* @}
69546954
*/
69556955

6956+
CINDEX_DEPRECATED
6957+
typedef void *CXRemapping;
6958+
6959+
CINDEX_DEPRECATED CINDEX_LINKAGE CXRemapping clang_getRemappings(const char *);
6960+
6961+
CINDEX_DEPRECATED CINDEX_LINKAGE CXRemapping
6962+
clang_getRemappingsFromFileList(const char **, unsigned);
6963+
6964+
CINDEX_DEPRECATED CINDEX_LINKAGE unsigned clang_remap_getNumFiles(CXRemapping);
6965+
6966+
CINDEX_DEPRECATED CINDEX_LINKAGE void
6967+
clang_remap_getFilenames(CXRemapping, unsigned, CXString *, CXString *);
6968+
6969+
CINDEX_DEPRECATED CINDEX_LINKAGE void clang_remap_dispose(CXRemapping);
6970+
69566971
LLVM_CLANG_C_EXTERN_C_END
69576972

69586973
#endif

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ BUILTIN(__builtin_amdgcn_raw_buffer_load_b96, "V3UiQbiiIi", "n")
164164
BUILTIN(__builtin_amdgcn_raw_buffer_load_b128, "V4UiQbiiIi", "n")
165165

166166
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_load_lds, "vQbv*3IUiiiIiIi", "t", "vmem-to-lds-load-insts")
167+
TARGET_BUILTIN(__builtin_amdgcn_struct_ptr_buffer_load_lds, "vQbv*3IUiiiiIiIi", "t", "vmem-to-lds-load-insts")
167168

168169
//===----------------------------------------------------------------------===//
169170
// Ballot builtins.
@@ -670,6 +671,10 @@ TARGET_BUILTIN(__builtin_amdgcn_s_wait_tensorcnt, "vIUs", "n", "gfx1250-insts")
670671

671672
TARGET_BUILTIN(__builtin_amdgcn_tanh_bf16, "yy", "nc", "bf16-trans-insts")
672673
TARGET_BUILTIN(__builtin_amdgcn_rcp_bf16, "yy", "nc", "bf16-trans-insts")
674+
TARGET_BUILTIN(__builtin_amdgcn_rsq_bf16, "yy", "nc", "bf16-trans-insts")
675+
TARGET_BUILTIN(__builtin_amdgcn_log_bf16, "yy", "nc", "bf16-trans-insts")
676+
TARGET_BUILTIN(__builtin_amdgcn_exp2_bf16, "yy", "nc", "bf16-trans-insts")
677+
TARGET_BUILTIN(__builtin_amdgcn_sin_bf16, "yy", "nc", "bf16-trans-insts")
673678

674679
TARGET_BUILTIN(__builtin_amdgcn_cvt_f16_fp8, "hiIi", "nc", "gfx1250-insts")
675680
TARGET_BUILTIN(__builtin_amdgcn_cvt_f16_bf8, "hiIi", "nc", "gfx1250-insts")

clang/include/clang/Basic/BuiltinsRISCV.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,8 @@ def pause : RISCVBuiltin<"void()">;
157157
// XCV extensions.
158158
//===----------------------------------------------------------------------===//
159159
include "clang/Basic/BuiltinsRISCVXCV.td"
160+
161+
//===----------------------------------------------------------------------===//
162+
// XAndes extensions.
163+
//===----------------------------------------------------------------------===//
164+
include "clang/Basic/BuiltinsRISCVXAndes.td"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//==- BuiltinsRISCVXAndes.td - RISC-V Andes Builtin database -----*- C++ -*-==//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file defines the Andes-specific builtin function database. Users of
10+
// this file must define the BUILTIN macro to make use of this information.
11+
//
12+
//===----------------------------------------------------------------------===//
13+
14+
class RISCVXAndesBuiltin<string prototype, string features = ""> : TargetBuiltin {
15+
let Spellings = ["__builtin_riscv_nds_" # NAME];
16+
let Prototype = prototype;
17+
let Features = features;
18+
}
19+
20+
let Attributes = [NoThrow, Const] in {
21+
//===----------------------------------------------------------------------===//
22+
// XAndesBFHCvt extension.
23+
//===----------------------------------------------------------------------===//
24+
25+
def fcvt_s_bf16 : RISCVXAndesBuiltin<"float(__bf16)", "xandesbfhcvt">;
26+
def fcvt_bf16_s : RISCVXAndesBuiltin<"__bf16(float)", "xandesbfhcvt">;
27+
} // Attributes = [NoThrow, Const]

clang/include/clang/Basic/BuiltinsSPIRVVK.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ include "clang/Basic/BuiltinsSPIRVBase.td"
1111

1212
def reflect : SPIRVBuiltin<"void(...)", [NoThrow, Const]>;
1313
def faceforward : SPIRVBuiltin<"void(...)", [NoThrow, Const, CustomTypeChecking]>;
14+
def refract : SPIRVBuiltin<"void(...)", [NoThrow, Const, CustomTypeChecking]>;

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ CODEGENOPT(XCOFFReadOnlyPointers, 1, 0, Benign) ///< Set for -mxcoff-roptr.
5656
CODEGENOPT(AllTocData, 1, 0, Benign) ///< AIX -mtocdata
5757
ENUM_CODEGENOPT(FramePointer, FramePointerKind, 2, FramePointerKind::None, Benign) /// frame-pointer: all,non-leaf,reserved,none
5858

59+
ENUM_CODEGENOPT(ExceptionHandling, ExceptionHandlingKind, 3, ExceptionHandlingKind::None, NotCompatible)
60+
5961
CODEGENOPT(ClearASTBeforeBackend , 1, 0, Benign) ///< Free the AST before running backend code generation. Only works with -disable-free.
6062
CODEGENOPT(DisableFree , 1, 0, Benign) ///< Don't free memory.
6163
CODEGENOPT(DiscardValueNames , 1, 0, Benign) ///< Discard Value Names from the IR (LLVMContext flag)

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ class CodeGenOptions : public CodeGenOptionsBase {
176176
llvm_unreachable("invalid FramePointerKind");
177177
}
178178

179+
/// Possible exception handling behavior.
180+
enum class ExceptionHandlingKind { None, SjLj, WinEH, DwarfCFI, Wasm };
181+
179182
enum class SwiftAsyncFramePointerKind {
180183
Auto, // Choose Swift async extended frame info based on deployment target.
181184
Always, // Unconditionally emit Swift async extended frame info.
@@ -552,6 +555,22 @@ class CodeGenOptions : public CodeGenOptionsBase {
552555
return NoBuiltinFuncs;
553556
}
554557

558+
bool hasSjLjExceptions() const {
559+
return getExceptionHandling() == ExceptionHandlingKind::SjLj;
560+
}
561+
562+
bool hasSEHExceptions() const {
563+
return getExceptionHandling() == ExceptionHandlingKind::WinEH;
564+
}
565+
566+
bool hasDWARFExceptions() const {
567+
return getExceptionHandling() == ExceptionHandlingKind::DwarfCFI;
568+
}
569+
570+
bool hasWasmExceptions() const {
571+
return getExceptionHandling() == ExceptionHandlingKind::Wasm;
572+
}
573+
555574
/// Check if Clang profile instrumenation is on.
556575
bool hasProfileClangInstr() const {
557576
return getProfileInstr() ==

0 commit comments

Comments
 (0)