Skip to content

Commit 0d1e39c

Browse files
committed
rebase
Created using spr 1.3.4
2 parents dbc45a8 + 56968f1 commit 0d1e39c

File tree

443 files changed

+36795
-13310
lines changed

Some content is hidden

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

443 files changed

+36795
-13310
lines changed

clang/cmake/caches/Fuchsia.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH
7171
Python3_LIBRARIES
7272
Python3_INCLUDE_DIRS
7373
Python3_RPATH
74+
SWIG_DIR
75+
SWIG_EXECUTABLE
7476
CMAKE_FIND_PACKAGE_PREFER_CONFIG
7577
CMAKE_SYSROOT
7678
CMAKE_MODULE_LINKER_FLAGS

clang/docs/LanguageExtensions.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3464,6 +3464,34 @@ Query for this feature with ``__has_builtin(__builtin_trap)``.
34643464
34653465
``__builtin_arm_trap`` is lowered to the ``llvm.aarch64.break`` builtin, and then to ``brk #payload``.
34663466
3467+
``__builtin_allow_runtime_check``
3468+
---------------------------------
3469+
3470+
``__builtin_allow_runtime_check`` return true if the check at the current program location should be executed.
3471+
3472+
**Syntax**:
3473+
3474+
.. code-block:: c++
3475+
3476+
bool __builtin_allow_runtime_check(const char* kind)
3477+
3478+
**Example of use**:
3479+
3480+
.. code-block:: c++
3481+
3482+
if (__builtin_allow_runtime_check("mycheck") && !ExpensiveCheck()) {
3483+
abort();
3484+
}
3485+
3486+
**Description**
3487+
3488+
``__builtin_allow_runtime_check`` is lowered to ` ``llvm.allow.runtime.check`` <https://llvm.org/docs/LangRef.html#llvm-allow-runtime-check-intrinsic>`_ builtin.
3489+
3490+
The ``__builtin_allow_runtime_check()`` builtin is typically used with control flow
3491+
conditions such as in ``if`` to guard expensive runtime checks. The specific rules for selecting permitted checks can differ and are controlled by the compiler options.
3492+
3493+
Query for this feature with ``__has_builtin(__builtin_allow_runtime_check)``.
3494+
34673495
``__builtin_nondeterministic_value``
34683496
------------------------------------
34693497

clang/docs/ReleaseNotes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ Non-comprehensive list of changes in this release
193193
with support for any unsigned integer type. Like the previous builtins, these
194194
new builtins are constexpr and may be used in constant expressions.
195195

196+
- ``__typeof_unqual__`` is available in all C modes as an extension, which behaves
197+
like ``typeof_unqual`` from C23, similar to ``__typeof__`` and ``typeof``.
198+
196199
New Compiler Flags
197200
------------------
198201

@@ -328,6 +331,9 @@ Improvements to Clang's diagnostics
328331
- New ``-Wformat-signedness`` diagnostic that warn if the format string requires an
329332
unsigned argument and the argument is signed and vice versa.
330333

334+
- Clang now emits ``unused argument`` warning when the -fmodule-output flag is used
335+
with an input that is not of type c++-module.
336+
331337
Improvements to Clang's time-trace
332338
----------------------------------
333339

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,12 @@ def Unreachable : Builtin {
11641164
let Prototype = "void()";
11651165
}
11661166

1167+
def AllowRuntimeCheck : Builtin {
1168+
let Spellings = ["__builtin_allow_runtime_check"];
1169+
let Attributes = [NoThrow, Pure, Const];
1170+
let Prototype = "bool(char const*)";
1171+
}
1172+
11671173
def ShuffleVector : Builtin {
11681174
let Spellings = ["__builtin_shufflevector"];
11691175
let Attributes = [NoThrow, Const, CustomTypeChecking];

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,12 @@ def err_drv_extract_api_wrong_kind : Error<
548548
"header file '%0' input '%1' does not match the type of prior input "
549549
"in api extraction; use '-x %2' to override">;
550550

551+
def err_drv_missing_symbol_graph_dir: Error<
552+
"Must provide a symbol graph output directory using --symbol-graph-dir=<directory>">;
553+
554+
def err_drv_unexpected_symbol_graph_output : Error<
555+
"Unexpected output symbol graph '%1'; please provide --symbol-graph-dir=<directory> instead">;
556+
551557
def warn_slash_u_filename : Warning<"'/U%0' treated as the '/U' option">,
552558
InGroup<DiagGroup<"slash-u-filename">>;
553559
def note_use_dashdash : Note<

clang/include/clang/Basic/DiagnosticFrontendKinds.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,4 +366,8 @@ def warn_profile_data_misexpect : Warning<
366366
def err_extract_api_ignores_file_not_found :
367367
Error<"file '%0' specified by '--extract-api-ignores=' not found">, DefaultFatal;
368368

369+
def warn_missing_symbol_graph_dir : Warning<
370+
"Missing symbol graph output directory, defaulting to working directory">,
371+
InGroup<ExtractAPIMisuse>;
372+
369373
}

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,3 +1517,5 @@ def UnsafeBufferUsage : DiagGroup<"unsafe-buffer-usage", [UnsafeBufferUsageInCon
15171517
// Warnings and notes InstallAPI verification.
15181518
def InstallAPIViolation : DiagGroup<"installapi-violation">;
15191519

1520+
// Warnings about misuse of ExtractAPI options.
1521+
def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">;

clang/include/clang/Basic/DiagnosticIDs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace clang {
3232
enum {
3333
DIAG_SIZE_COMMON = 300,
3434
DIAG_SIZE_DRIVER = 400,
35-
DIAG_SIZE_FRONTEND = 150,
35+
DIAG_SIZE_FRONTEND = 200,
3636
DIAG_SIZE_SERIALIZATION = 120,
3737
DIAG_SIZE_LEX = 400,
3838
DIAG_SIZE_PARSE = 700,

clang/include/clang/Basic/TokenKinds.def

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -665,28 +665,30 @@ KEYWORD(__kindof , KEYOBJC)
665665

666666
// Alternate spelling for various tokens. There are GCC extensions in all
667667
// languages, but should not be disabled in strict conformance mode.
668-
ALIAS("__alignof__" , __alignof , KEYALL)
669-
ALIAS("__asm" , asm , KEYALL)
670-
ALIAS("__asm__" , asm , KEYALL)
671-
ALIAS("__attribute__", __attribute, KEYALL)
672-
ALIAS("__complex" , _Complex , KEYALL)
673-
ALIAS("__complex__" , _Complex , KEYALL)
674-
ALIAS("__const" , const , KEYALL)
675-
ALIAS("__const__" , const , KEYALL)
676-
ALIAS("__decltype" , decltype , KEYCXX)
677-
ALIAS("__imag__" , __imag , KEYALL)
678-
ALIAS("__inline" , inline , KEYALL)
679-
ALIAS("__inline__" , inline , KEYALL)
680-
ALIAS("__nullptr" , nullptr , KEYCXX)
681-
ALIAS("__real__" , __real , KEYALL)
682-
ALIAS("__restrict" , restrict , KEYALL)
683-
ALIAS("__restrict__" , restrict , KEYALL)
684-
ALIAS("__signed" , signed , KEYALL)
685-
ALIAS("__signed__" , signed , KEYALL)
686-
ALIAS("__typeof" , typeof , KEYALL)
687-
ALIAS("__typeof__" , typeof , KEYALL)
688-
ALIAS("__volatile" , volatile , KEYALL)
689-
ALIAS("__volatile__" , volatile , KEYALL)
668+
ALIAS("__alignof__" , __alignof , KEYALL)
669+
ALIAS("__asm" , asm , KEYALL)
670+
ALIAS("__asm__" , asm , KEYALL)
671+
ALIAS("__attribute__" , __attribute , KEYALL)
672+
ALIAS("__complex" , _Complex , KEYALL)
673+
ALIAS("__complex__" , _Complex , KEYALL)
674+
ALIAS("__const" , const , KEYALL)
675+
ALIAS("__const__" , const , KEYALL)
676+
ALIAS("__decltype" , decltype , KEYCXX)
677+
ALIAS("__imag__" , __imag , KEYALL)
678+
ALIAS("__inline" , inline , KEYALL)
679+
ALIAS("__inline__" , inline , KEYALL)
680+
ALIAS("__nullptr" , nullptr , KEYCXX)
681+
ALIAS("__real__" , __real , KEYALL)
682+
ALIAS("__restrict" , restrict , KEYALL)
683+
ALIAS("__restrict__" , restrict , KEYALL)
684+
ALIAS("__signed" , signed , KEYALL)
685+
ALIAS("__signed__" , signed , KEYALL)
686+
ALIAS("__typeof" , typeof , KEYALL)
687+
ALIAS("__typeof__" , typeof , KEYALL)
688+
ALIAS("__typeof_unqual" , typeof_unqual, KEYALL)
689+
ALIAS("__typeof_unqual__", typeof_unqual, KEYALL)
690+
ALIAS("__volatile" , volatile , KEYALL)
691+
ALIAS("__volatile__" , volatile , KEYALL)
690692

691693
// Type nullability.
692694
KEYWORD(_Nonnull , KEYALL)

clang/include/clang/Basic/arm_neon.td

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,24 +1758,21 @@ let TargetGuard = "fullfp16" in {
17581758
// Mul lane
17591759
def VMUL_LANEH : IOpInst<"vmul_lane", "..qI", "hQh", OP_MUL_LN>;
17601760
def VMUL_NH : IOpInst<"vmul_n", "..1", "hQh", OP_MUL_N>;
1761+
}
17611762

1762-
// Data processing intrinsics - section 5
1763-
1764-
// Logical operations
1765-
let isHiddenLInst = 1 in
1766-
def VBSLH : SInst<"vbsl", ".U..", "hQh">;
1767-
1768-
// Transposition operations
1769-
def VZIPH : WInst<"vzip", "2..", "hQh">;
1770-
def VUZPH : WInst<"vuzp", "2..", "hQh">;
1771-
def VTRNH : WInst<"vtrn", "2..", "hQh">;
1772-
1773-
// Vector Extract
1774-
def VEXTH : WInst<"vext", "...I", "hQh">;
1763+
// Data processing intrinsics - section 5. Do not require fullfp16.
17751764

1776-
// Reverse vector elements
1777-
def VREV64H : WOpInst<"vrev64", "..", "hQh", OP_REV64>;
1778-
}
1765+
// Logical operations
1766+
let isHiddenLInst = 1 in
1767+
def VBSLH : SInst<"vbsl", ".U..", "hQh">;
1768+
// Transposition operations
1769+
def VZIPH : WInst<"vzip", "2..", "hQh">;
1770+
def VUZPH : WInst<"vuzp", "2..", "hQh">;
1771+
def VTRNH : WInst<"vtrn", "2..", "hQh">;
1772+
// Vector Extract
1773+
def VEXTH : WInst<"vext", "...I", "hQh">;
1774+
// Reverse vector elements
1775+
def VREV64H : WOpInst<"vrev64", "..", "hQh", OP_REV64>;
17791776

17801777
// ARMv8.2-A FP16 vector intrinsics for A64 only.
17811778
let ArchGuard = "defined(__aarch64__)", TargetGuard = "fullfp16" in {
@@ -1857,7 +1854,9 @@ let ArchGuard = "defined(__aarch64__)", TargetGuard = "fullfp16" in {
18571854
def VMINVH : SInst<"vminv", "1.", "hQh">;
18581855
def FMAXNMVH : SInst<"vmaxnmv", "1.", "hQh">;
18591856
def FMINNMVH : SInst<"vminnmv", "1.", "hQh">;
1857+
}
18601858

1859+
let ArchGuard = "defined(__aarch64__)" in {
18611860
// Permutation
18621861
def VTRN1H : SOpInst<"vtrn1", "...", "hQh", OP_TRN1>;
18631862
def VZIP1H : SOpInst<"vzip1", "...", "hQh", OP_ZIP1>;

clang/include/clang/Driver/Options.td

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,14 +1507,29 @@ def extract_api : Flag<["-"], "extract-api">,
15071507
def product_name_EQ: Joined<["--"], "product-name=">,
15081508
Visibility<[ClangOption, CC1Option]>,
15091509
MarshallingInfoString<FrontendOpts<"ProductName">>;
1510-
def emit_symbol_graph_EQ: JoinedOrSeparate<["--"], "emit-symbol-graph=">,
1510+
def emit_symbol_graph: Flag<["-"], "emit-symbol-graph">,
15111511
Visibility<[ClangOption, CC1Option]>,
1512-
HelpText<"Generate Extract API information as a side effect of compilation.">,
1513-
MarshallingInfoString<FrontendOpts<"SymbolGraphOutputDir">>;
1512+
HelpText<"Generate Extract API information as a side effect of compilation.">,
1513+
MarshallingInfoFlag<FrontendOpts<"EmitSymbolGraph">>;
1514+
def emit_extension_symbol_graphs: Flag<["--"], "emit-extension-symbol-graphs">,
1515+
Visibility<[ClangOption, CC1Option]>,
1516+
HelpText<"Generate additional symbol graphs for extended modules.">,
1517+
MarshallingInfoFlag<FrontendOpts<"EmitExtensionSymbolGraphs">>;
15141518
def extract_api_ignores_EQ: CommaJoined<["--"], "extract-api-ignores=">,
15151519
Visibility<[ClangOption, CC1Option]>,
15161520
HelpText<"Comma separated list of files containing a new line separated list of API symbols to ignore when extracting API information.">,
15171521
MarshallingInfoStringVector<FrontendOpts<"ExtractAPIIgnoresFileList">>;
1522+
def symbol_graph_dir_EQ: Joined<["--"], "symbol-graph-dir=">,
1523+
Visibility<[ClangOption, CC1Option]>,
1524+
HelpText<"Directory in which to emit symbol graphs.">,
1525+
MarshallingInfoString<FrontendOpts<"SymbolGraphOutputDir">>;
1526+
def emit_pretty_sgf: Flag<["--"], "pretty-sgf">,
1527+
Visibility<[ClangOption, CC1Option]>,
1528+
HelpText<"Emit pretty printed symbol graphs">,
1529+
MarshallingInfoFlag<FrontendOpts<"EmitPrettySymbolGraphs">>;
1530+
def emit_sgf_symbol_labels_for_testing: Flag<["--"], "emit-sgf-symbol-labels-for-testing">,
1531+
Visibility<[CC1Option]>,
1532+
MarshallingInfoFlag<FrontendOpts<"EmitSymbolGraphSymbolLabelsForTesting">>;
15181533
def e : Separate<["-"], "e">, Flags<[LinkerInput]>, Group<Link_Group>;
15191534
def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group<f_Group>,
15201535
Visibility<[ClangOption, CC1Option]>,

0 commit comments

Comments
 (0)