Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
1bd6392
[flang][acc] Add `OutlineIdentityOperandOpInterface` to hlfir/fir dec…
SusanTan Jul 9, 2026
8e07124
[InstCombine] Use constant 64-bit indices for CreateExtractElement (N…
andjo403 Jul 9, 2026
4aba9d2
[mlir][tosa] Fold tiled input into binary elementwise operations (#20…
lhutton1 Jul 9, 2026
5114f5e
[Clang][Sema] Ensure explicitly defaulted functions respect FP pragma…
kevinwkt Jul 9, 2026
64a9e0c
[AArch64][GlobalISel] Update scalar types in selection tests. NFC (#2…
davemgreen Jul 9, 2026
1603802
[SSAF] Replace std::set with SetVector for deterministic order of con…
ziqingluo-90 Jul 9, 2026
72cb276
[SLP][NFC]Silence warning for unused variable, NFC
alexey-bataev Jul 9, 2026
bba373c
[flang][Lower] Track whether a call to a function is to an intrinsic …
ivanradanov Jul 9, 2026
6b7b8d3
[SampleProfile] Replace std::set with SmallVector in SortedCallTarget…
kazutakahirata Jul 9, 2026
5815dfe
[X86] promote f16 `frexp` (#208530)
folkertdev Jul 9, 2026
ed60974
[SCEV] Add more tests for reasoning about min/max expressions (NFC) (…
fhahn Jul 9, 2026
3e4f56b
[VPlan] Introduce VPlan-based hasTailFolded helper. (NFC) (#208329)
fhahn Jul 9, 2026
5a1b669
[clang] Fix crash in DiagnoseMissingSemiAfterTagDefinition for annot_…
Kristianerik Jul 9, 2026
fedcede
[RISCV] Fix incorrect fixed vector lowering for VECTOR_DEINTERLEAVE (…
mshockwave Jul 9, 2026
1b5d760
[Clang] Fix crash involving `__attribute__((cleanup))` attributes and…
Sirraide Jul 9, 2026
766161c
[scudo] Small refactor of getTSDXXX functions. (#208127)
cferris1000 Jul 9, 2026
720066a
BPF: Fix misfolding subregisters (#208244)
arsenm Jul 9, 2026
8bbb5a8
[Github][TestingTools] Build on multiple platforms
boomanaiden154 Jul 9, 2026
c050a2c
Revert "[lldb][Windows][CI] split steps (#206946)" (#208519)
charles-zablit Jul 9, 2026
a160909
[SystemZ][z/OS] Honor alignment of global data (#208095)
redstar Jul 9, 2026
0f9f5a2
[z/OS][Clang] Add compare and swap builtin functions (#202362)
maryammo Jul 9, 2026
509a0b8
[RISCV] Support Zdinx registers in -fzero-call-used-regs (#206323)
LucasChollet Jul 9, 2026
68c0f57
[Bazel] Fixes 0f9f5a2 (#208562)
forking-google-bazel-bot[bot] Jul 9, 2026
351b968
[AMDGPU] Fix crash on strict fptrunc to bf16 (#208037)
aobolensk Jul 9, 2026
5363d61
[SampleProfile] Introduce stabilizeTable (NFC) (#208501)
kazutakahirata Jul 9, 2026
45f9445
Fix typo (#208560)
adrian-prantl Jul 9, 2026
4ccb701
[mlir][RemoveDeadValues] Use `SymbolUserMap` to avoid quadratic symbo…
victor-eds Jul 9, 2026
ed907de
[alpha.webkit.UncheckedLambdaCapturesChecker] Split unchecked lambda …
rniwa Jul 9, 2026
fdde3c0
[Sema] Properly space namespace comments (#208561)
boomanaiden154 Jul 9, 2026
5b21ec3
[Support] Optimize signal handling file removal code (#173586)
rnk Jul 9, 2026
aa6db49
[lldb] Tighten interface for TypeCategoryImpl::AnyMatches (#208321)
bulbazord Jul 9, 2026
7ef8194
[Reassociate] Compute value ranks iteratively (NFC) (#204952)
nvidia-moomoo Jul 9, 2026
a1fcdd1
[clang][ssaf] Add SARIF transformation-report format (#208327)
jkorous-apple Jul 9, 2026
3bdf536
[lldb] Use `llvm::APInt` for `VariantMember` Discriminants (#188487)
Walnut356 Jul 9, 2026
0538275
[lldb] Don't add the same module to a target twice (#208472)
charles-zablit Jul 9, 2026
b0627c0
[HLSL] Reject unbounded resource array and noinline function resource…
kmpeng Jul 9, 2026
9dabe38
[mlir][xegpu] Fix crash on 0D vector in vector-to-xegpu transfer lowe…
Chennesxu Jul 9, 2026
9cfa768
[Offload][CI][AMDGPU] Update build scripts for updated triple (#208568)
Kewen12 Jul 9, 2026
80d57d1
[Attributor] Add remarks when UB is optimized to unreachable (#207864)
jroelofs Jul 9, 2026
3145761
[flang][cuda] Fix atomicCAS to return the old value (#208558)
wangzpgi Jul 9, 2026
3a3d2cb
[mlir][xegpu] Fix expandDim distribution for shape_cast layout infere…
Jianhui-Li Jul 9, 2026
e2bd9ce
Revert "[Offload][CI][AMDGPU] Update build scripts for updated triple…
Kewen12 Jul 9, 2026
2c04b33
[Docs] Migrate LLVM docs to furo (#184440)
nigham Jul 9, 2026
1eb67aa
[libc] Disable baremetal modular printf (#208576)
Prabhuk Jul 9, 2026
09ad7f1
[gn build] Port commits (#208584)
aeubanks Jul 9, 2026
f40ad8f
[Clang][AMDGPU] Add __builtin_amdgcn_s_buffer_load_<T> (#203352)
macurtis-amd Jul 9, 2026
27d83e2
[AIX] diagnose invalid feature strings on the target attribute (#208059)
w2yehia Jul 9, 2026
880f3d0
[mlir][xegpu] Support subgroup layout assignment for scatter stores (…
Jianhui-Li Jul 9, 2026
b2b67ba
[GISel] Don't return false when an intrinsic is not supported (#208567)
shiltian Jul 9, 2026
f5169f2
[libc++] Enable missing allocator constructors in C++11 (#204845)
halbi2 Jul 9, 2026
76066e5
[orc_rt] adding a very simple CLI flags parser in (#172987)
jaredwy Jul 10, 2026
15f7d14
[lldb] Add an MCP client and asynchronous request binding (#208371)
JDevlieghere Jul 10, 2026
964cd4d
[AMDGPU] [NFC] Init pointers, widen mask complements (#208469)
yelidris-public Jul 10, 2026
2370ce3
[orc-rt] Expand 'extern "C"' guard coverage in Logging.h. NFC. (#208596)
lhames Jul 10, 2026
9141f71
[clang] fix typo-correction for template name lookup (#208586)
mizvekov Jul 10, 2026
8b38729
[webkit.NoUncountedMemberChecker] Improve the warning text (#204557)
rniwa Jul 10, 2026
e898ca9
[orc-rt] Apply orc_rt_log_* naming convention to Logging.h. NFC. (#20…
lhames Jul 10, 2026
ac78ce3
[flang][AliasAnalysis] Add opt-in getSource memoization cache (#208319)
vzakhari Jul 10, 2026
f348b0d
[Bazel] Fixes ac78ce3 (#208600)
forking-google-bazel-bot[bot] Jul 10, 2026
21edbea
[SandboxVec][Scheduler][NFC] Add direction arg to Scheduler construct…
vporpo Jul 10, 2026
f1daa4c
[CodeGen][BranchFolding] Add options to control common hoisting and b…
HongjuneKim Jul 10, 2026
10b965f
[Clang] ASTUnit should use the CompilerInstance's CodeGenOptions (#19…
Sirraide Jul 10, 2026
089c9c1
[clang] Add -mavx512bmm flag (#208520)
Disservin Jul 10, 2026
43e98b2
[flang] Do not implicitly use module when processing the module (#208…
clementval Jul 10, 2026
54627d8
[RISCV][P-ext] Improve the codegen for pzip (#208479)
XChy Jul 10, 2026
d3cfebb
[X86][Inline] Don't inline callee with cx16 if caller is without cx16…
usamoi Jul 10, 2026
d0339ae
[clang][bytecode][NFC] Simplify redecl loop (#208477)
tbaederr Jul 10, 2026
bdc6580
Revert "[Docs] Migrate LLVM docs to furo" (#208619)
rnk Jul 10, 2026
1d73e32
[AArch64][GlobalISel] Update scalar types in postlegalizer tests. NFC…
davemgreen Jul 10, 2026
3c138b5
Reland "[ORC] Track __emutls_t definitions in IRMaterializationUnit" …
conrade-ctc Jul 10, 2026
3ce1af9
[AArch64][GlobalISel] Add bf16 vecreduce test coverage. NFC (#208628)
davemgreen Jul 10, 2026
9bfd0ff
[mlir][emitc] Fix hasSideEffects of emitc.cast (#208607)
CoTinker Jul 10, 2026
5246dff
[orc-rt] Add a coding conventions doc (#208623)
lhames Jul 10, 2026
94b8fb9
[Flang][OpenMP] Added diagnostic for ORDERED THREADS SIMD inside plai…
ravurvi20 Jul 10, 2026
b6a6670
[ImplicitNullChecks] Preserve debug location on FAULTING_OP (#205560)
adalal-2441 Jul 10, 2026
dac462d
[BOLT] Fix use-old-text-zero-padding on FreeBSD (#206581)
aokblast Jul 10, 2026
eac699d
[BOLT] Fix use-old-text-zero-padding on FreeBSD (#206581) (#208634)
davemgreen Jul 10, 2026
8d59096
[LLD][AArch64] Make adrp+ldr relaxation per-symbol all-or-nothing (#2…
nikic Jul 10, 2026
9c4e4b1
AMDGPU: Migrate unittests to subarch triples (#206486)
arsenm Jul 10, 2026
b5a27b4
AMDGPU: Rewrite target-cpu test for new subarches (#206485)
arsenm Jul 10, 2026
1cc5d2c
[lldb] Fix DW_OP_convert type handling (#208435)
firmiana402 Jul 10, 2026
3595454
MC: Start some error messages with a lowercase (#208570)
arsenm Jul 10, 2026
5b27878
COFF: Start error message with lowercase letter (#208636)
arsenm Jul 10, 2026
2d5aa73
[clang-tidy] Add IgnoreMacros option to readability-trivial-switch (#…
zeyi2 Jul 10, 2026
03aca1a
[AMDGPU] Introduce tests for PR207922 (NFC) (#208640)
antoniofrighetto Jul 10, 2026
977f4d6
[AMDGPU] Employ MemorySSA when rewriting out arguments (NFCI) (#207922)
antoniofrighetto Jul 10, 2026
4516eb3
[HLSL] Implement RWTexture2D (#208267)
tcorringham Jul 10, 2026
09fbfb5
[VPlan] Remove FoldTail argument for createConsecutiveVecPtr (NFC). (…
fhahn Jul 10, 2026
380c581
[Offload] Fix warn-unused function (#208642)
jplehr Jul 10, 2026
445d6c3
[CIR][AArc64] Add lowering for fp16 intrinsics (sqrt + max + min) (#2…
banach-space Jul 10, 2026
6ec6a77
[NFC][SPIR-V] Remove unused GR parameter from vector elt legalizers (…
aobolensk Jul 10, 2026
3c59a21
[lldb][test] Add a new test for integer types (#208441)
Teemperor Jul 10, 2026
c93aefb
[libc++] Remove diagnostic about _LIBCPP_ABI_NO_ITERATOR_BASES (#208460)
ldionne Jul 10, 2026
0faf45c
[libc++] Rename the macro for the LLVM 18 ABI tag used in ranges (#20…
ldionne Jul 10, 2026
c1d66b5
[clang] Update C++ DR status page (#208641)
Endilll Jul 10, 2026
24ce77e
[Clang][OpenMP] Fix `if` clause not affecting `teams` construct on ho…
Thyre Jul 10, 2026
9a4ad0a
[libc] Assorted improvements to [gs]etitimer (#206974)
labath Jul 10, 2026
83950f4
[lldb-dap] Log the adapter's stdio during cleanup (#208432)
da-viper Jul 10, 2026
06e7dfc
[lldb-dap] Migrate all DAP module tests. (#207869)
da-viper Jul 10, 2026
5eb8007
Revert "Reapply "runtimes: Pass CMAKE_SYSTEM_NAME based on target tri…
zmodem Jul 10, 2026
810a463
[flang][openacc] make openacc-use-reduction-combine cl switch default…
jeanPerier Jul 10, 2026
ef1b46f
[Clang] Fix a crash when checking the constraints of a self-referenti…
cor3ntin Jul 10, 2026
642b853
[DWARFLinkerParallel] Add missing version string in producer (#158195)
shatyuka Jul 10, 2026
83c5973
[clang][analyzer] Fixed 'if_nameindex' in MallocChecker (#207726)
balazske Jul 10, 2026
9a92a2b
[lldb] Implement LLDB_REGNUM_GENERIC_TP conversion for Aarch64 (#208643)
felipepiovezan Jul 10, 2026
9b9b193
[X86][Disassembler] Reject instructions longer than 15 bytes (#208277)
charles-zablit Jul 10, 2026
e2e81d9
[X86] combine-pmaddwd.ll - test with x86-64 levels not raw SSE levels…
RKSimon Jul 10, 2026
4f3000e
[mlir][SPIR-V] Add spirv.GL.NMax/NMin to SPIRVtoLLVM conversion (#205…
aobolensk Jul 10, 2026
587db92
[CostModel][X86] intrinsic-cost-kinds.ll - add pdep/pext test coverag…
RKSimon Jul 10, 2026
50143b8
[mlir][SPIR-V] Add SPIRVToLLVM conversions for CL copysign and fmod o…
aobolensk Jul 10, 2026
99fb741
[libc] Use internal::clock_gettime in socketopt_test (#208667)
labath Jul 10, 2026
931a00e
offload: Match amdgpu triple name in lit config (#208551)
arsenm Jul 10, 2026
dfdc1c3
[LV] Handle swapped blend inputs in predicated partial reductions (#2…
jacob-crawley Jul 10, 2026
95cfe69
[mlir][tosa] Fix reduce-transpose sub-byte handling (#208446)
iliyan-georgiev-arm Jul 10, 2026
cd662a7
[clang][scan-build-py] Fix configure scripts when using Python 3.14 (…
MichielDerhaeg Jul 10, 2026
4a5bdad
[mlir] Fix RDV poison cleanup (#206270)
mygitljf Jul 10, 2026
ec3bda3
[AArch64][InstCombine] Fold zext of all-active SVE cmpne-zero (#207720)
MDevereau Jul 10, 2026
9dad160
[VPlan] Relax type of DerivedIV start value (NFC) (#206464)
artagnon Jul 10, 2026
e4798e7
[clang][bytecode] Don't diagnose definition without body (#208679)
tbaederr Jul 10, 2026
15df0ca
[Hexagon] Use word splats for repeated HVX build-vector words (#204808)
L-roro Jul 10, 2026
41a35a7
[clang][bytecode] Fix comparing member pointers for redeclared `Field…
tbaederr Jul 10, 2026
7fcfcf1
[OpenMP] Use secure_getenv when read OMPT library path (#208652)
jplehr Jul 10, 2026
68e1d0c
[orc-rt] Add backend-independent category and level APIs to Logging.h…
lhames Jul 10, 2026
0ea6d9d
[AMDGPU] Extend wave reduction intrinsics to Pre-gfx8 (#208071)
easyonaadit Jul 10, 2026
fcf7f6e
[orc-rt] Rename the "disable logging" level from "none" to "off" (#20…
lhames Jul 10, 2026
ad7eb0c
Merge remote-tracking branch 'upstream/main'
SupernaviX Jul 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 3 additions & 24 deletions .ci/green-dragon/lldb-windows.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pipeline {
}
}

stage('Build and Test (No LLDB Server)') {
stage('Build and Test') {
steps {
timeout(60) {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
Expand Down Expand Up @@ -81,28 +81,6 @@ cmake -G Ninja ^
-DLLVM_LIT_ARGS="-v --time-tests --xunit-xml-output=C:\\workspace\\llvm-build\\test\\results-no-lldb-server.xml" ^
-DPython3_EXECUTABLE="C:\\Program Files\\Python313\\python.exe" || exit /b 1
ninja check-lldb -C ..\\llvm-build || exit /b 1
'''
bat '''
docker run --rm ^
-e BUILD_TYPE=%BUILD_TYPE% ^
-v "%CD%:C:\\workspace" ^
-w "C:\\workspace\\llvm-project" ^
swiftlang/swift-ci:lldb-windowsservercore-1809 ^
cmd /C C:\\workspace\\build.bat
'''
}
}
}
}

stage('Test (LLDB Server)') {
steps {
timeout(30) {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
writeFile file: 'test-lldb-server.bat', text: '''@echo off
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat" || exit /b 1

set "PATH=%PATH%;C:\\Program Files\\Git\\usr\\bin"

cmake -G Ninja ^
-S llvm ^
Expand All @@ -117,12 +95,13 @@ ninja check-lldb -C ..\\llvm-build || exit /b 1
-v "%CD%:C:\\workspace" ^
-w "C:\\workspace\\llvm-project" ^
swiftlang/swift-ci:lldb-windowsservercore-1809 ^
cmd /C C:\\workspace\\test-lldb-server.bat
cmd /C C:\\workspace\\build.bat
'''
}
}
}
}
}

post {
always {
Expand Down
11 changes: 9 additions & 2 deletions bolt/test/AArch64/got-load-symbolization.s
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ _start:
# CHECK-NEXT: adrp x2, __BOLT_got_zero
# CHECK-NEXT: nop
# CHECK-NEXT: ldr x2, [x2, :lo12:__BOLT_got_zero{{.*}}]
adrp x2, :got:near
adrp x2, :got:near2
nop
ldr x2, [x2, :got_lo12:near]
ldr x2, [x2, :got_lo12:near2]

## Load data object with local visibility. Relaxable into adrp+add.
# CHECK-NEXT: adrp x3, "local_far_data/1"
Expand All @@ -58,6 +58,7 @@ _start:
.size _start, .-_start

.weak near
.weak near2
.weak far
.weak far_data

Expand All @@ -77,6 +78,12 @@ near:
ret
.size near, .-near

.globl near2
.type near2, @function
near2:
ret
.size near2, .-near2

#--- far.s

.text
Expand Down
17 changes: 13 additions & 4 deletions bolt/test/AArch64/lite-mode.s
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
# CHECK-COMPACT-NOT: <_start.org.0>

## Verify that the number of FDEs matches the number of functions in the output
## binary. There are three original functions and two optimized.
## binary. There are four original functions and three optimized.
## NOTE: at the moment we are emitting extra FDEs for patched functions, thus
## there is one more FDE for _start.
# RUN: llvm-readelf -u %t.bolt | grep -wc FDE \
# RUN: | FileCheck --check-prefix=CHECK-FDE %s
# CHECK-FDE: 6
# CHECK-FDE: 8

## In lite mode, optimized code will be separated from the original .text by
## over 128MB, making it impossible for call/bl instructions in cold functions
Expand Down Expand Up @@ -106,9 +106,9 @@ cold_function:
# CHECK-NEXT: add x4

## Check that non-relaxable GOT load is left intact.
adrp x5, :got:far_func
adrp x5, :got:far_func2
nop
ldr x5, [x5, #:got_lo12:far_func]
ldr x5, [x5, #:got_lo12:far_func2]
# CHECK-INPUT-NEXT: adrp x5
# CHECK-INPUT-NEXT: nop
# CHECK-INPUT-NEXT: ldr x5
Expand Down Expand Up @@ -155,3 +155,12 @@ far_func:
ret x30
.cfi_endproc
.size far_func, .-far_func

.globl far_func2
.type far_func2, %function
far_func2:
# FDATA: 0 [unknown] 0 1 far_func2 0 0 100
.cfi_startproc
ret x30
.cfi_endproc
.size far_func2, .-far_func2
2 changes: 1 addition & 1 deletion bolt/test/AArch64/use-old-text-zero-padding.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// RUN: llvm-readelf -S %t/test.bolt | awk '$3==".text"{print $6, $7}' \
// RUN: > %t/txt-loc
// RUN: bash -c "read O S < %t/txt-loc; \
// RUN: od -A x -t x1 -N 0x20 -j \$((0x\$O + 0x\$S)) %t/test.bolt" \
// RUN: od -A x -t x1 -N 32 -j \$((0x\$O + 0x\$S)) %t/test.bolt" \
// RUN: | FileCheck %s --check-prefix=PADDING

// PADDING: {{[0-9a-f]+}} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Expand Down
12 changes: 12 additions & 0 deletions clang-tools-extra/clang-tidy/readability/TrivialSwitchCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,24 @@ using namespace clang::ast_matchers;

namespace clang::tidy::readability {

TrivialSwitchCheck::TrivialSwitchCheck(StringRef Name,
ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
IgnoreMacros(Options.get("IgnoreMacros", true)) {}

void TrivialSwitchCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
Options.store(Opts, "IgnoreMacros", IgnoreMacros);
}

void TrivialSwitchCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(switchStmt().bind("switch"), this);
}

void TrivialSwitchCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Switch = Result.Nodes.getNodeAs<SwitchStmt>("switch");
if (IgnoreMacros && Switch->getBeginLoc().isMacroID())
return;

std::size_t CaseCount = 0;
bool HasDefault = false;

Expand Down
7 changes: 5 additions & 2 deletions clang-tools-extra/clang-tidy/readability/TrivialSwitchCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ namespace clang::tidy::readability {
/// https://clang.llvm.org/extra/clang-tidy/checks/readability/trivial-switch.html
class TrivialSwitchCheck : public ClangTidyCheck {
public:
TrivialSwitchCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
TrivialSwitchCheck(StringRef Name, ClangTidyContext *Context);
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
std::optional<TraversalKind> getCheckTraversalKind() const override {
return TK_IgnoreUnlessSpelledInSource;
}

private:
const bool IgnoreMacros;
};

} // namespace clang::tidy::readability
Expand Down
5 changes: 5 additions & 0 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,11 @@ Changes in existing checks
<clang-tidy/checks/readability/suspicious-call-argument>` check by avoiding a
crash from invalid ``Abbreviations`` option.

- Improved :doc:`readability-trivial-switch
<clang-tidy/checks/readability/trivial-switch>` check by adding an
`IgnoreMacros` option. When enabled, the check will ignore switch
statements originating from macros.

- Improved :doc:`readability-use-anyofallof
<clang-tidy/checks/readability/use-anyofallof>` check by emitting a diagnostic
note to suggest materializing the temporary range when iterating over temporary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ Otherwise, the ``switch`` can be better expressed with an ``if`` statement.
// The switch without any labels will be diagnosed.
int i = 42;
switch (i) {}

Options
-------

.. option:: IgnoreMacros

If set to `true`, the check will not give warnings inside macros. Default
is `true`.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// RUN: %check_clang_tidy -std=c++98-or-later %s readability-trivial-switch %t
// RUN: %check_clang_tidy -std=c++98-or-later -check-suffixes=,MACROS %s \
// RUN: readability-trivial-switch %t -- \
// RUN: -config="{CheckOptions: {readability-trivial-switch.IgnoreMacros: false}}"

void bad(int I) {
switch (I) {
Expand Down Expand Up @@ -42,3 +45,14 @@ void good(int I) {
break;
}
}

#define SINGLE_CASE_SWITCH(I) \
switch (I) { \
case 0: \
break; \
}

void macro(int I) {
SINGLE_CASE_SWITCH(I)
// CHECK-MESSAGES-MACROS: :[[@LINE-1]]:3: warning: switch with only one case; use an if statement
}
5 changes: 1 addition & 4 deletions clang/cmake/modules/ClangConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ set(CLANG_LINK_CLANG_DYLIB "@CLANG_LINK_CLANG_DYLIB@")
set(CLANG_DEFAULT_LINKER "@CLANG_DEFAULT_LINKER@")

# Provide all our library targets to users.
# Skip when cross-compiling, as host library targets are not usable.
if(NOT CMAKE_CROSSCOMPILING)
@CLANG_CONFIG_INCLUDE_EXPORTS@
endif()
@CLANG_CONFIG_INCLUDE_EXPORTS@

# By creating clang-tablegen-targets here, subprojects that depend on Clang's
# tablegen-generated headers can always depend on this target whether building
Expand Down
7 changes: 7 additions & 0 deletions clang/docs/AMDGPUSupport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,10 @@ Predefined Macros
- Defined if FP64 instruction is available (deprecated).

Please note that the specific architecture and feature names will vary depending on the GPU. Also, some macros are deprecated and may be removed in future releases.


Target-Specific Builtins
========================

Clang exposes AMDGPU hardware intrinsics as target-specific builtins with the
``__builtin_amdgcn_`` prefix. These are documented in :doc:`AMDGPUBuiltinReference`.
34 changes: 34 additions & 0 deletions clang/docs/LanguageExtensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5538,6 +5538,40 @@ int a = 1;
__builtin_dcbf (&a);
```

### z/OS Language Extensions

#### z/OS builtins

z/OS supports builtins for compare-and-swap operations that generate the
corresponding z/OS assembly instructions (CS, CSG, CDSG). These builtins compare
the value pointed to by oldptr to the value pointed to by curptr. If they are
equal, the value pointed to by newword (or newword itself for `__cs`) is
copied into the location pointed to by curptr. If they are unequal, the value
pointed to by curptr is copied into the location pointed to by oldptr.
The builtins return 0 if the values are equal, or 1 if they are unequal.

- `int __cs(unsigned int *oldptr, unsigned int *curptr, unsigned int newword)`

Generates a 4-byte compare-and-swap using the CS instruction.
Use `__cs` instead of `__cs1` when the newword arg is an r-value instead
of an l-value.

- `int __cs1(void *oldptr, void *curptr, void *newword)`

Generates a 4-byte compare-and-swap using the CS instruction.

- `int __csg(void *oldptr, void *curptr, void *newword)`

Generates an 8-byte compare-and-swap using the CSG instruction.

- `int __cds1(void *oldptr, void *curptr, void *newword)`

Generates an 8-byte compare-and-swap using the CSG instruction.

- `int __cdsg(void *oldptr, void *curptr, void *newword)`

Generates a 16-byte compare-and-swap using the CDSG instruction.

## Extensions for Static Analysis

Clang supports additional attributes that are useful for documenting program
Expand Down
6 changes: 6 additions & 0 deletions clang/docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,10 @@ latest release, please see the [Clang Web Site](https://clang.llvm.org) or the
- Fixed an assertion where we improperly handled implicit conversions to integral types from an atomic-type with a conversion function. (#GH201770)
- Fixed assertion failures involving code completion with delayed default arguments and exception specifications. (#GH200879)
- Fixed a regression where calling a function that takes a class-type parameter by value inside `decltype` of a concept could be incorrectly rejected when used as a non-type template argument. (#GH175831)
- Clang no longer crashes if `__attribute__((cleanup))` is applied to an invalid declaration. Furthermore, in declarations that
contain multiple `cleanup` attributes, Clang now only uses the last one, matching GCC's behaviour (previously, Clang
would only use the first one). A new warning that diagnoses such declarations has been added to `-Wignored-attributes`.
(#GH191829)
- Fixed a crash in the constant evaluator when an ill-formed array new-expression whose bound could not be determined (e.g. `new int[]()`) was used in a constant expression. (#GH200139)
- Clang now defines the GCC-compatible predefined macros `__WCHAR_MIN__`, `__WINT_MIN__`, and `__SIG_ATOMIC_MIN__`. (#GH199678)

Expand Down Expand Up @@ -846,6 +850,7 @@ latest release, please see the [Clang Web Site](https://clang.llvm.org) or the
- Clang no longer errors on overloads with different ref-qualifiers and constraints. (#GH120812)
- Fixed a crash when a default argument is passed to an explicit object parameter. (#GH176639)
- Fixed an alias template CTAD crash.
- Improvements to typo correction involving template names. (#GH207498)
- Correctly diagnose uses of `co_await` / `co_yield` in the default argument of nested function declarations. (#GH98923)
- Fixed a crash when diagnosing an invalid static member function with an explicit object parameter (#GH177741)
- Clang incorrectly instantiated variable specializations outside of the immediate context. (#GH54439)
Expand Down Expand Up @@ -942,6 +947,7 @@ latest release, please see the [Clang Web Site](https://clang.llvm.org) or the
immediate-escalated callable. (#GH192846)
- Fixed a crash when passing one sized implicitly casted vector to a `abs` function. (#GH204777)
- Fixed a crash when diagnosing an invalid out-of-line definition of a member class template. (#GH201490)
- Fixed a crash in the parser when a missing semicolon after a tag definition is followed by a template-id not preceded by `::`. (#GH207992)

### OpenACC Specific Changes

Expand Down
17 changes: 17 additions & 0 deletions clang/docs/analyzer/checkers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3967,6 +3967,23 @@ The goal of this rule is to make sure that lifetime of any dynamically allocated

The rules of when to use and not to use CheckedPtr / CheckedRef are same as alpha.webkit.UncountedCallArgsChecker for ref-counted objects.

alpha.webkit.UncheckedLambdaCapturesChecker
"""""""""""""""""""""""""""""""""""""""""""
Raw pointers and references to unchecked types can't be captured in lambdas. Only CheckedPtr or CheckedRef is allowed.

.. code-block:: cpp

struct CheckedObject {
void incrementCheckedPtr() {}
void decrementCheckedPtr() {}
};

void foo(CheckedObject* a, CheckedObject& b) {
[&, a](){ // warn about 'a'
do_something(b); // warn about 'b'
};
};

alpha.webkit.UnretainedCallArgsChecker
""""""""""""""""""""""""""""""""""""""
The goal of this rule is to make sure that lifetime of any dynamically allocated NS or CF objects passed as a call argument keeps its memory region past the end of the call. This applies to call to any function, method, lambda, function pointer or functor. NS or CF objects aren't supposed to be allocated on stack so we check arguments for parameters of raw pointers and references to unretained types.
Expand Down
9 changes: 8 additions & 1 deletion clang/include/clang/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2049,13 +2049,17 @@ class FunctionDecl : public DeclaratorDecl,

};

/// Stashed information about a defaulted/deleted function body.
/// Stashed information about a defaulted/deleted function body, including
/// the active FP pragma overrides (FPOptionsOverride) from the declaration
/// site. These overrides are required to correctly synthesize the function
/// body.
class DefaultedOrDeletedFunctionInfo final
: llvm::TrailingObjects<DefaultedOrDeletedFunctionInfo, DeclAccessPair,
StringLiteral *> {
friend TrailingObjects;
unsigned NumLookups;
bool HasDeletedMessage;
FPOptionsOverride FPFeatures;

size_t numTrailingObjects(OverloadToken<DeclAccessPair>) const {
return NumLookups;
Expand All @@ -2064,8 +2068,11 @@ class FunctionDecl : public DeclaratorDecl,
public:
static DefaultedOrDeletedFunctionInfo *
Create(ASTContext &Context, ArrayRef<DeclAccessPair> Lookups,
FPOptionsOverride FPFeatures,
StringLiteral *DeletedMessage = nullptr);

FPOptionsOverride getFPFeatures() const { return FPFeatures; }

/// Get the unqualified lookup results that should be used in this
/// defaulted function definition.
ArrayRef<DeclAccessPair> getUnqualifiedLookups() const {
Expand Down
Loading
Loading