Skip to content

[clang][analyzer] fix false positive of BlockInCriticalSectionChecker #126752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 263 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
263 commits
Select commit Hold shift + click to select a range
404ceb9
[Vectorize] Avoid repeated hash lookups (NFC) (#126681)
kazutakahirata Feb 11, 2025
044d916
[ValueTracking] Handle trunc to i1 as condition in dominating conditi…
andjo403 Feb 11, 2025
51340ca
[Clang][Driver][HIP] Fix test for HIP as it was failing (#126585)
Sharjeel-Khan Feb 11, 2025
4245955
[flang][acc] Fill-in name for privatized loop iv (#126601)
razvanlupusoru Feb 11, 2025
8921bf1
[clang][Sema] Move computing enum bits into a separate function (#126…
kuilpd Feb 11, 2025
e99e45b
[GitHub] Add aaronmondal to Bazel codeowners (#126760)
aaronmondal Feb 11, 2025
8607b92
[HLSL] Appropriately set function attribute optnone (#125937)
bharadwajy Feb 11, 2025
e929fba
[libc][test][stdbit] fix -Wimplicit-int-conversion (#126616)
nickdesaulniers Feb 11, 2025
edc7cbf
[Release Notes] Mention -fprofile-continuous in release notes
Feb 11, 2025
1e002aa
[analyzer][docs] Document how to use perf and uftrace to debug perfor…
steakhal Feb 11, 2025
5f1f59a
[GitHub] Skip undefcheck if no relevant files changed (#126749)
aaronmondal Feb 11, 2025
80d1b8c
[lldb] Devirtualize GetValueProperties (NFC) (#126583)
JDevlieghere Feb 11, 2025
bf768fa
[WebKit Checkers] Treat const Objective-C ivar as a safe origin (#126…
rniwa Feb 11, 2025
f42e757
AMDGPU: Handle gfx950 XDL-write-VGPR-VALU-Mem-Exp wait state change (…
VigneshwarJ Feb 11, 2025
d7ebf28
AMDGPU: Handle gfx950 XDL Write-VGPR-VALU-WAW wait state change (#126…
VigneshwarJ Feb 11, 2025
d387030
[llvm] Avoid out-of-order evaluation in DebugInfo (#125116)
elvinw-intel Feb 11, 2025
e3001ae
[flang][NFCI] Stop tracking memory source after a load in a more expl…
Renaud-K Feb 11, 2025
4d59b49
[Clang] [OpenMP] Add support for '#pragma omp stripe'. (#119891)
zahiraam Feb 11, 2025
e9a950c
[mlir][tosa] Change the shift of mul to be required (#125297)
Tai78641 Feb 11, 2025
04afd3d
[WebKit Checkers] Allow operator T&() in a const member function (#12…
rniwa Feb 11, 2025
18c0d85
[libc++] Fixes building with Python 3.8.
mordante Feb 11, 2025
1d7f11b
[Hexagon][Disassembler] Set CommentStream of Disassembler (#126766)
quic-areg Feb 11, 2025
6679b18
[flang][rt] Add decimal files to device runtime (#126778)
clementval Feb 11, 2025
a3b8829
[clang-linker-wrapper][lit] Fix SPIR-V ELF test when spirv-tools feat…
sarnex Feb 11, 2025
bd543c0
[MLIR] Make generated markdown doc more consistent (#119926)
GleasonK Feb 11, 2025
53ba8fc
Revert "[Clang] [OpenMP] Add support for '#pragma omp stripe'. (#1198…
kazutakahirata Feb 11, 2025
5157425
[DAG] Use ArrayRef to simplify ShuffleVectorSDNode::isSplatMask
preames Feb 11, 2025
1b38733
[Offload] Properly guard modifications to the RPC device array (#126790)
jhuber6 Feb 11, 2025
3d94088
[AArch64] Add a phase-order test for dot patterns. NFC
davemgreen Feb 11, 2025
4705987
[NFC] [clang] fix unused variable warning (#126796)
fmayer Feb 11, 2025
efa1101
[DependenceAnalysis][NFC] Removing PossiblyLoopIndependent parameter …
1997alireza Feb 11, 2025
2c0c71a
[RISCV] Add coverage for vmerge.vim shuffle lowering
preames Feb 11, 2025
2fb80ce
[clang] Assert the enum FPOpts and LangOpts fit into the storage (#12…
fmayer Feb 11, 2025
672a21a
[mlir][vector][nfc] Add clarification on "dim-1" bcast (#125425)
banach-space Feb 11, 2025
406064c
[SLP]Fix attempt to build the reorder mask for non-adjusted reuse mask
alexey-bataev Feb 11, 2025
77d7645
[NFC] [clang] Use isa instead of dyn_cast
fmayer Feb 11, 2025
b351873
[SandboxVec][Scheduler] Update ready list comparator (#126160)
vporpo Feb 11, 2025
7416711
[mlir] Silence -Wdangling-assignment-gsl in OperationSupport.h (#126140)
smeenai Feb 11, 2025
5a997d5
[libc][docgen] make note of sys/time.h interfaces removed in POSIX.1-…
nickdesaulniers Feb 11, 2025
6968f3e
[clang][HeuristicResolver] Track the expression whose type is being s…
HighCommander4 Feb 11, 2025
de7826e
[libc][math] Add float-only option for atan2f. (#122979)
lntue Feb 11, 2025
8bd8f5c
[AMDGPU][True16][CodeGen] true16 codegen for MadFmaMixPat (#124892)
broxigarchen Feb 11, 2025
973f013
[libc] create TimeReader to look at a struct tm (#126138)
michaelrj-google Feb 11, 2025
4e38ed5
[RISCV] Decompose single source shuffles (without exact VLEN) (#126108)
preames Feb 11, 2025
d9e66ab
[ORC] Switch to singleton pattern for UnwindInfoManager. (#126691)
lhames Feb 11, 2025
def306d
Revert "[mlir] Silence -Wdangling-assignment-gsl in OperationSupport.…
smeenai Feb 11, 2025
5dba28e
[CFIFixup] Fixup CFI for split functions with synchronous uwtables (#…
dhoekwater Feb 11, 2025
d7fe304
[libc][NFC] Remove DEFAULT_DOUBLE_SPLIT macro. (#126822)
lntue Feb 11, 2025
6dca4ec
[NFC] [clang] fixed unused variable warning
fmayer Feb 11, 2025
fe97f1b
[RISCV] Allow undef prefix for local repeating VLA shuffle lowering (…
preames Feb 11, 2025
9f107b4
[NVPTX] Lower invalid `ISD::ADDRSPACECAST` (#125607)
justinfargnoli Feb 11, 2025
a1474cb
Revert "[RISCV] Allow undef prefix for local repeating VLA shuffle lo…
preames Feb 11, 2025
769a916
[mlir] Enable LICM for ops with only read side effects in scf.for (#1…
ardaunal Feb 11, 2025
831dab1
[ExecutionEngine] Fix a warning
kazutakahirata Feb 11, 2025
3008086
[ExecutionEngine] Fix formatting (NFC)
kazutakahirata Feb 12, 2025
195da3d
[libc] fix get_epoch constexpr error (#126818)
michaelrj-google Feb 12, 2025
6e542c6
[LowerBufferFatPointers] Fix support for GEP T, p7, <N x T> idxs (#12…
krzysz00 Feb 12, 2025
77e3656
[scudo] Modify header corrupption error message (#126812)
cferris1000 Feb 12, 2025
464bf26
[mlir] [DataFlow] Fix bug in int-range-analysis (#126708)
cxy-1993 Feb 12, 2025
b252de4
[mlir][vector][NFC] Fix typos in tests (#126662)
linuxlonelyeagle Feb 12, 2025
2df73fb
[libc] implement endian related macros (#126368)
c8ef Feb 12, 2025
cf7c8e7
[msan] Add handlePairwiseShadowOrIntrinsic and use it to handle Arm N…
thurstond Feb 12, 2025
bfa8acf
[MemorySanitizer] Silence an unused-variable warning (NFC)
DamonFool Feb 12, 2025
be34333
[Clang][CMake][MSVC] Install PDBs alongside executables (#126675)
mayanez Feb 12, 2025
10d6057
[RISCV] Select mask operands as virtual registers and eliminate uses …
lukel97 Feb 12, 2025
40860cb
Revert "[mlir] Enable LICM for ops with only read side effects in scf…
htyu Feb 12, 2025
32942c0
[gn build] Port cc7e83601d75
llvmgnsyncbot Feb 12, 2025
7ee8958
[DAGCombiner] Add hasOneUse checks for folding (not (add X, -1)) to (…
tclin914 Feb 12, 2025
b968813
[MC] Use `std::move` to avoid copy (#126700)
abhishek-kaushik22 Feb 12, 2025
d8b2181
[RISCV] Fix a warning
kazutakahirata Feb 12, 2025
d03080a
[PGO][Offload] Profile profraw generation for GPU instrumentation #7…
EthanLuisMcDonough Feb 12, 2025
76bb67a
[AMDGPU][NewPM] Port "GCNRewritePartialRegUses" pass to NPM (#126024)
vikramRH Feb 12, 2025
ccb3f7b
[AsmParser] Remove OperandMatchResultTy (#126650)
lenary Feb 12, 2025
8104d41
[MC] Replace MCContext::GenericSectionID with MCSection::NonUniqueID …
HaohaiWen Feb 12, 2025
6dc8a9a
[PGO][Offload] Fix pgo1.c (#126864)
EthanLuisMcDonough Feb 12, 2025
7836801
AMDGPU: Use range to implement getSubRegs (#126861)
arsenm Feb 12, 2025
ee99f56
[NFC][Pipelines] Extract buildCoroConditionalWrapper (#126860)
vitalybuka Feb 12, 2025
26038e3
[clang-format][NFC] Fix test case format
owenca Feb 12, 2025
232b002
[SelectionDAGBuilder] Remove NodeMap updates from getValueImpl. NFC (…
topperc Feb 12, 2025
300a9b6
Reapply "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP."…
ampandey-1995 Feb 12, 2025
edcfdcf
[mlir][dlti] Query by strings (#126716)
adam-smnk Feb 12, 2025
0b11c4b
[NVPTX] Cleanup/Refactoring in NVPTX AsmPrinter and RegisterInfo (NFC…
AlexMaclean Feb 12, 2025
3937ea2
[BOLT] Use getMainExecutable() (#126698)
nikic Feb 12, 2025
80eef7b
[libc++] Remove obsolete guards for join_view being experimental (#12…
ldionne Feb 12, 2025
e575fee
[flang][FIR] handle argument attributes in fir.call (#126711)
jeanPerier Feb 12, 2025
320c79f
[libclc] Move conversion builtins to the CLC library (#124727)
frasercrmck Feb 12, 2025
83bab88
[clang][bytecode] Fix operator new source expression (#126870)
tbaederr Feb 12, 2025
a073687
[X86] combineEXTRACT_SUBVECTOR - fold extract_subvector(subv_broadcas…
RKSimon Feb 12, 2025
9f7d607
[MLIR][LLVMIR] Use TargetFolder when creating globals (#126745)
nikic Feb 12, 2025
87c9343
[llvm] Remove `br i1 undef` in some `llvm/test/CodeGen` tests (#126811)
Yeaseen Feb 12, 2025
7b12208
[mlir] Add missing dependency
nikic Feb 12, 2025
8e48631
[lldb] Support disassembling discontinuous functions (#126505)
labath Feb 12, 2025
29b74e8
[flang][OpenMP] Handle fixed length `charater`s in delayed privatizat…
ergawy Feb 12, 2025
baae21d
[X86] lowerShuffleAsBroadcast - use isShuffleEquivalent to search for…
RKSimon Feb 12, 2025
1bb3ab3
Revert "[NVPTX] Cleanup/Refactoring in NVPTX AsmPrinter and RegisterI…
metaflow Feb 12, 2025
0f21601
[bazel] port c03325cead2244ef0a89bb1cf365bddf16021daf
metaflow Feb 12, 2025
b3b8f0b
[analyzer] Add option assume-at-least-one-iteration (#125494)
NagyDonat Feb 12, 2025
daf67bc
[AArch64][DAG] Allow fptos/ui.sat to scalarized. (#126799)
davemgreen Feb 12, 2025
be69cae
[mlir] ArithToLLVM: fix memref bitcast lowering (#125148)
Hardcode84 Feb 12, 2025
667cb60
[NFC][LLVM][LangRef] Improve documentation for partial.reduce.add. (#…
paulwalker-arm Feb 12, 2025
0994ad7
Revert "[mlir] ArithToLLVM: fix memref bitcast lowering" (#126895)
Hardcode84 Feb 12, 2025
8d93683
[MLIR][mesh] Mesh fixes (#124724)
fschlimb Feb 12, 2025
b822746
[AArch64] Pre-commit tests for #125686 (NFC) (#126643)
jthackray Feb 12, 2025
ee39f9d
[NFC][LLVM][LangRef] Fix typos within partial.reduce.add documentation.
paulwalker-arm Feb 12, 2025
2adc9d4
[X86] canonicalizeShuffleWithOp - don't bother trying to move shuffle…
RKSimon Feb 12, 2025
79d53c6
[ValueTracking] Infer NonEqual from dominating conditions/assumptions…
dtcxzyw Feb 12, 2025
fbb6b8b
[libc++] Remove conditional for attributes that are always available …
philnik777 Feb 12, 2025
072927c
[X86] isShuffleFoldableLoad - only check that the SDValue has one use…
RKSimon Feb 12, 2025
a6efb2a
[libc++abi] Add a missing include for abort() (#126865)
atetubou Feb 12, 2025
ad82f39
Reland "CodeGen][NewPM] Port MachineScheduler to NPM. (#125703)" (#12…
optimisan Feb 12, 2025
e6d6f66
[mlir][bazel] Fix after https://github.com/llvm/llvm-project/commit/0…
chsigg Feb 12, 2025
c6cb410
[mlir][bazel] Fix after https://github.com/llvm/llvm-project/commit/0…
chsigg Feb 12, 2025
b24a854
[OpenMP][SIMD][FIX] Use conservative "omp simd ordered" lowering (#12…
MattPD Feb 12, 2025
7a8e769
[mlir] Mark variable as maybe_unused.
chsigg Feb 12, 2025
d73f9c9
[LoopVectorize] Make collectInLoopReductions more efficient (#126769)
david-arm Feb 12, 2025
a51016e
[Flang] Fix options for FunctionAttr pass (#126819)
rscottmanley Feb 12, 2025
7ed69fd
[HLSL] Change clang Driver Options to not set CXXOperatorNames (#126758)
farzonl Feb 12, 2025
f0b5e42
[SLP][NFC]Improve dump of the ScheduleData, NFC
alexey-bataev Feb 12, 2025
22f708d
[IRBuilder] Add additional overload with in-place Inserter constructi…
nikic Feb 12, 2025
488ce90
[NFC][Lanai][Hexagon] Define DEBUG_TYPE after including Debug.h. (#12…
nvjle Feb 12, 2025
e4345dd
Define -DLLVM_BUILD_TELEMETRY to be used in ifdef (#126746)
oontvoo Feb 12, 2025
a95a8fe
Revert "[SLP][NFC]Improve dump of the ScheduleData, NFC"
alexey-bataev Feb 12, 2025
5fdfad7
[gn] port fc4d87100a0
nico Feb 12, 2025
9bd4c7e
[SLP][NFC]Improve dump of the ScheduleData, NFC
alexey-bataev Feb 12, 2025
efd2bf0
[Flang] fix initializer with empty string to fix aarch64 build (#126918)
rscottmanley Feb 12, 2025
e32ef08
[clang][analysis] Fix flaky clang/test/Analysis/live-stmts.cpp test (…
steakhal Feb 12, 2025
5e46853
[Docs][LangRef] Fix broken ref to pointer capture. NFC (#126910)
dtcxzyw Feb 12, 2025
0d202bd
[NFC][analyzer] OOB test consolidation II: constraint checking (#126748)
NagyDonat Feb 12, 2025
5ffc2e6
[BOLT] Prevent addRelocation from adding pending relocs (#123635)
paschalis-mpeis Feb 12, 2025
b947982
[Flang][OpenMP] Update semantics checks for 'teams' nesting (#126922)
skatrak Feb 12, 2025
a098066
[X86] fp-fold.ll - regenerate checks
RKSimon Feb 12, 2025
beb99fd
[NVPTX] Convert scalar function nvvm.annotations to attributes (#125908)
AlexMaclean Feb 12, 2025
b5ed280
[X86] Avoid repeated hash lookups (NFC) (#126857)
kazutakahirata Feb 12, 2025
8c8123a
[bazel] port fc4d87100a01f08dbdf78b68e1a6a5c2584d840d
metaflow Feb 12, 2025
dfeef87
Reapply "[RISCV] Allow undef prefix for local repeating VLA shuffle l…
preames Feb 12, 2025
f285635
Revert "[Clang][CMake][MSVC] Install PDBs alongside executables" (#12…
mayanez Feb 12, 2025
fe8d601
[TableGen] Emit OpName as an enum class instead of a namespace (#125313)
jurahul Feb 12, 2025
6b02b0b
[lldb] Remove Debugger::Get{Output,Error}Stream (NFC) (#126821)
JDevlieghere Feb 12, 2025
147bd30
[flang] add ABI argument attributes in indirect calls (#126896)
jeanPerier Feb 12, 2025
e633db4
Revert "[RISCV] Decompose single source shuffles (without exact VLEN)…
preames Feb 12, 2025
3ba4250
[OpenMP][OpenMPIRBuilder] Support SPIR-V device variant matches (#126…
sarnex Feb 12, 2025
0cdced1
[Analysis] Avoid repeated hash lookups (NFC) (#126851)
kazutakahirata Feb 12, 2025
f4d3ed2
[CodeGen] Avoid repeated hash lookups (NFC) (#126852)
kazutakahirata Feb 12, 2025
7c9d95f
[Object] Avoid repeated map lookups (NFC) (#126853)
kazutakahirata Feb 12, 2025
3bf81f0
[SPIRV] Avoid repeated hash lookups (NFC) (#126854)
kazutakahirata Feb 12, 2025
e88d3a1
[Xtensa] Add XtensaDesc dependency to LLVMXtensaDisassembler (#126904)
e-kud Feb 12, 2025
c002af9
[Utils] Avoid repeated hash lookups (NFC) (#126856)
kazutakahirata Feb 12, 2025
535397e
[libc][bit_test] fix -Wimplicit-int-conversion (#126317)
nickdesaulniers Feb 12, 2025
3ae02a8
[X86] 2011-10-27-tstore.ll - regenerate checks
RKSimon Feb 12, 2025
e835edd
Reland [mlir] ArithToLLVM: fix memref bitcast lowering (#125148) (#12…
Hardcode84 Feb 12, 2025
0dc5629
[NFC] Avoid potential null dereference. (#126872)
schittir Feb 12, 2025
a9f9442
[DebugInfo] Update DIBuilder insertion to take InsertPosition (#126059)
hvdijk Feb 12, 2025
795902d
Revert "[DebugInfo] Update DIBuilder insertion to take InsertPosition…
hvdijk Feb 12, 2025
0bb20a2
workflows/release-binaries-all: Add missing secret input (#126921)
tstellar Feb 12, 2025
a78e911
[flang] [runtime] Explicitly disable EH & RTTI (#126920)
mgorny Feb 12, 2025
1624713
[libc] Fix implict cast to time_t warning (#126947)
michaelrj-google Feb 12, 2025
7610aac
Revert "[bazel] Temporarily disable a broken LookupAddressRangeWithSt…
labath Feb 12, 2025
f2ba3bb
[mlir] Match before rewrite in BubbleUpPackOpThroughGenericOp (#126946)
Max191 Feb 12, 2025
a7545ab
[X86] vec-strict-fptoint - regenerate VPTERNLOG comments
RKSimon Feb 12, 2025
c09e98b
[X86] vec-strict-cmp-512-skx.ll - regenerate checks
RKSimon Feb 12, 2025
03e71a3
[X86] vec-strict-cmp-128-fp16.ll - regenerate VMOVSH comments
RKSimon Feb 12, 2025
0b4a71d
[msan] Handle llvm.[us]cmp (starship operator) (#125804)
thurstond Feb 12, 2025
aa360a5
[DirectX] Set Shader Flag DisableOptimizations (#126813)
bharadwajy Feb 12, 2025
58a13f9
[lldb] Update ThreadPlanStepOut to handle new breakpoint behavior (#1…
jasonmolenda Feb 12, 2025
a5618a0
[lldb] inserted a typeo when checking in a suggested fix
jasonmolenda Feb 12, 2025
56167d6
[mlir] Python: Parse ModuleOp from file path (#126572)
nikalra Feb 12, 2025
adc7fc3
Add a pass to collect dropped var statistics for MIR (#126686)
rastogishubham Feb 12, 2025
5c95559
[libc][stdfix] Implement `countlsfx` functions in libc. (#126597)
krishna2803 Feb 12, 2025
f76827d
[HLSL][Docs] Update function calls docs (#106860)
llvm-beanz Feb 12, 2025
eacc139
[libc] Move __LLVM_LIBC__ define to __llvm-libc-common.h (#126877)
petrhosek Feb 12, 2025
9f04032
[SandboxVec][Scheduler] Fix top of schedule (#126820)
vporpo Feb 12, 2025
f35f69a
[clang] run clang-format on some CGObjC files (#126644)
DataCorrupted Feb 12, 2025
11974a4
[RISCV] Decompose single source shuffles (without exact VLEN) (#126951)
preames Feb 12, 2025
7481069
[SandboxVec][Legality] Fix mask on diamond reuse with shuffle (#126963)
vporpo Feb 12, 2025
51cad11
[AMDGPU] iglp.opt does not clobber memory operands (#126976)
jrbyrnes Feb 12, 2025
43120de
[mlir][acc] Clean up TypedValue builders (#126968)
razvanlupusoru Feb 12, 2025
745b475
[mlir] BytecodeWriter: invoke `reserveExtraSpace` (#126953)
nikalra Feb 12, 2025
ee72f6b
[hwasan][NFCI] Add more test cases to llvm/test/Instrumentation/HWAdd…
thurstond Feb 12, 2025
7010a40
[gn build] Port 92f916faba13
llvmgnsyncbot Feb 12, 2025
f7daffd
[RISCV] Default to MicroOpBufferSize = 1 for scheduling purposes (#12…
preames Feb 12, 2025
4a91ac3
[SandboxVec] Fix warnings introduced by 7a7f9190d03e
vporpo Feb 12, 2025
f8a4fe5
[LAA] Also clear CheckingGroups in RuntimePointerChecking::reset.
fhahn Feb 12, 2025
ec84684
[msan] Handle single-parameter Arm NEON vector convert intrinsics (#1…
thurstond Feb 12, 2025
5135feb
[libc][pthread] fix -Wmissing-field-initializers (#126314)
nickdesaulniers Feb 12, 2025
16044f7
[SanbdoxVec][BottomUpVec] Fix diamond shuffle with multiple vector in…
vporpo Feb 12, 2025
9bdaac9
[libc++] Add a link to __builtin_verbose_trap from the hardening docs…
ldionne Feb 12, 2025
0c6bfb6
[libc++] Simplify the apple-system-hardened CI configuration (#126911)
ldionne Feb 12, 2025
d64a9f9
[mlir][tosa]-Edit the verifier of tosa constShapeOp (#126962)
amirBish Feb 12, 2025
0da960f
[SandboxVec][DAG] Fix DAG when old interval is mem free (#126983)
vporpo Feb 12, 2025
0a4fb00
[mlir][tensor] Make useful Tensor utilities public (#126802)
banach-space Feb 12, 2025
5e636bc
[AMDGPU] SelDAG: fix lowering of undefined workitem intrinsics (#126058)
ro-i Feb 12, 2025
c58637a
[lldb-dap] add `debugAdapterExecutable` property to launch configurat…
matthewbastien Feb 12, 2025
0850676
[compiler-rt] [sanitizer] avoid UB in allocator (#126977)
fmayer Feb 12, 2025
369219a
[MLIR][Affine] Fix fusion crash for non-int/fp memref elt types (#126…
bondhugula Feb 12, 2025
27d9867
[lldb-dap] Fix: Could not find DAP in path (#126903)
da-viper Feb 13, 2025
10a80d8
[lldb-dap] Bump the version number for publishing in the Marketplace
JDevlieghere Feb 13, 2025
637ed4e
[msan] Handle Arm NEON saturating extract and narrow (#125742)
thurstond Feb 13, 2025
689998b
[Support] Prefer AUX vector for page size (#126863)
RossComputerGuy Feb 13, 2025
294b1e6
[MLIR][Affine] Fix sibling fusion - missing check (#126626)
bondhugula Feb 13, 2025
16ef2aa
[mlir][vector] Fix out-of-bounds access (#126734)
CoTinker Feb 13, 2025
d5e28e6
[NFC] [sanitizer] allow getauxval in symbolizer
fmayer Feb 13, 2025
989bb22
[hwasan][NFCI] Rename ClRandomSkipRate to ClRandomKeepRate (#126990)
thurstond Feb 13, 2025
7cb4380
[lldb-dap] Upgrade @types/node to fix TS2386 in node/module.d.ts (#12…
JDevlieghere Feb 13, 2025
77309b6
[SPARC][IAS] Add IAS flag handling for ISA levels
koachan Feb 13, 2025
b4777b8
[Support] Fix building on FreeBSD and OpenBSD (#127005)
brad0 Feb 13, 2025
4c7a2a8
Orc: Suppress a warning in #126691
chapuni Feb 13, 2025
fbac315
[bazel] Introduce HAVE_SYS_AUXV_H for #126863
chapuni Feb 13, 2025
873ee09
[ORC] Silence unused variable warnings.
lhames Feb 13, 2025
db43ed3
[flang][acc] Implement type categorization for FIR types (#126964)
razvanlupusoru Feb 13, 2025
23f7261
[LTO][Pipelines][Coro] Handle coroutines in LTO pipeline (#126168)
vitalybuka Feb 13, 2025
2e49d4f
[libclang] Always Dup in createRef(StringRef) (#125020)
vitalybuka Feb 13, 2025
e0ad3d9
[clang] [ASTDump] Add support for structural value template arguments…
sakria9 Feb 13, 2025
b9c250f
[InstCombine] Fold mul (shr exact (X, N)), 2^N + 1 -> add (X , shr ex…
AZero13 Feb 13, 2025
e9a3d26
[llvm][bazel] Adjust to HAVE_SYS_AUXV_H > HAVE_GETAUXVAL in https://g…
chsigg Feb 13, 2025
ff6a4cb
[RISCV][NFC] Move GenericModel to standalone file (#127003)
wangpc-pp Feb 13, 2025
88a4d24
[mlir][affine]make affine-loop-unroll a FunctionOpInterface pass. (#1…
linuxlonelyeagle Feb 13, 2025
9e4472e
[MLIR][LLVMIR] Always use TargetFolder in IRBuilder (#126929)
nikic Feb 13, 2025
57e9540
[libcxx] Add a missing include for __bit_iterator (#127015)
atetubou Feb 13, 2025
7a356c9
[libcxx] Add a missing include for __enable_if_t (#127016)
atetubou Feb 13, 2025
3a58168
[lldb/DWARF] Resolve type unit references in llvm DWARFDIE compatibil…
labath Feb 13, 2025
a0d7415
[flang] Update f128 tests
nikic Feb 13, 2025
fe864ab
[CaptureTracking][FunctionAttrs] Add support for CaptureInfo (#125880)
nikic Feb 13, 2025
2993012
[MISched][NFC] Remove unused heuristic NextDefUse from enum (#125879)
c-rhodes Feb 13, 2025
659d771
[SDAG] Harden assumption in getMemsetStringVal (#126207)
c-rhodes Feb 13, 2025
3d47d9a
[mlir][bufferization] Remove `buffer-deallocation` pass (#126366)
matthias-springer Feb 13, 2025
60f0e05
[mlir][bazel] Port a472147af4ad
chsigg Feb 13, 2025
cb5992e
[lldb] Fix Block::GetRangeIndexContainingAddress for discontinuous fu…
labath Feb 13, 2025
96458ef
[ARM] Fix calling convention for __fp16 with big-endian (#126741)
ostannard Feb 13, 2025
54a65dc
[IR] Mark mul constant expression as undesirable
nikic Feb 11, 2025
da2ac55
[LLVM][AArch64] Remove aliases of LSUI instructions (#126072)
kmclaughlin-arm Feb 13, 2025
8737638
[mlir][NFC] Add missing `)` in doc for `--mlir-print-local-scope` (#1…
vguerra Feb 13, 2025
e8c3575
[MLIR][LLVMIR] Fix use-after-move
nikic Feb 13, 2025
cf02e67
TableGen: Add missing consts to CodeGenSubRegIndex
arsenm Feb 13, 2025
e43dbb5
[lldb][SBAPI] Add new SBType::GetTemplateParameterValue API (#126901)
Michael137 Feb 13, 2025
e823f14
[analyzer] Disable a flaky test while triaging why its flaky (#127034)
steakhal Feb 13, 2025
3ef0e7f
[clang] Fix preprocessor output from #embed (#126742)
Fznamznon Feb 13, 2025
cd6f46d
AMDGPU: Add more tests for peephole opt subregister composing
arsenm Feb 4, 2025
909fd42
[lldb] Correctly resolve (discontinuous) function offsets when disass…
labath Feb 13, 2025
618e74f
[LoopVectorizer][AArch64] Add support for partial reduce subtraction …
NickGuy-Arm Feb 13, 2025
6878783
[reland][DebugInfo] Update DIBuilder insertion to take InsertPosition…
hvdijk Feb 13, 2025
95c06d4
[AMDGPU] Add a regression test for -mattr=dumpcode (#116982)
jayfoad Feb 13, 2025
6912175
AMDGPU: Add baseline test for treating v_pk_mov_b32 like reg_sequence…
arsenm Feb 13, 2025
8b10a39
[IR][ModRef] Introduce `errno` memory location
antoniofrighetto Feb 10, 2025
8c88cb5
[clang] CTAD: Remove an incorrect assertion in BuildDeductionGuideFor…
hokein Feb 13, 2025
08e541a
[flang][debug] Allow variable from non-entry blocks. (#125692)
abidh Feb 13, 2025
50f2560
AMDGPU: Mark sendmsg intrinsics as nocallback (#126782)
arsenm Feb 13, 2025
3ae58c1
LAA: fix logic for MaxTargetVectorWidth (#125487)
artagnon Feb 13, 2025
e865105
[X86] Fix shadow variable warning. NFC.
RKSimon Feb 13, 2025
021ebc6
add new lines to testcase
flovent Feb 13, 2025
551b041
implement with set and skip -1 file descriptor too
flovent Feb 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions clang/lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,92 @@ using MutexDescriptor =
std::variant<FirstArgMutexDescriptor, MemberMutexDescriptor,
RAIIMutexDescriptor>;

class NonBlockOpenVisitor : public BugReporterVisitor {
private:
const VarRegion *VR;
const CallExpr *OpenCallExpr;
int O_NONBLOCKV;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These POSIX constants are often defined as preprocessor macros, so I don't think it's a good idea to use these as symbol names where they could expand to their definition.

Copy link
Contributor Author

@flovent flovent Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not sure if i understand you comment right.
To avoid get it every time we need it, O_NONBLOCK's value is got for marco using tryExpandAsInteger API in reportBlockInCritSection, passed to NonBlockOpenVisitor and stored to this class member O_NONBLOCKV.
And it may not exists in current TU(didn't include certain header or some other reason), when we can't get it's value, the NonBlockOpenVisitor will not be needed then.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion is to call this int here something else. Maybe int ValueOfONonBlockVFlag; or just int ValueO_NONBLOCKV;. Something that prevents an accidental expansion to invalid code int 8;` or something in this file.

Getting the value at runtime from the target architecture and putting it behind this variable is not a problem to do. The only concern here is the name of this variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i understand now, thank you for explaining, i will change it in the subsequent modification

bool Satisfied;
CallDescription OpenFunction{CDM::CLibrary, {"open"}, 2};

public:
NonBlockOpenVisitor(const VarRegion *VR, int O_NONBLOCKV)
: VR(VR), OpenCallExpr(nullptr), O_NONBLOCKV(O_NONBLOCKV),
Satisfied(false) {}

static void *getTag() {
static int Tag = 0;
return static_cast<void *>(&Tag);
}

void Profile(llvm::FoldingSetNodeID &ID) const override {
ID.AddPointer(getTag());
ID.AddPointer(VR);
}

PathDiagnosticPieceRef VisitNode(const ExplodedNode *N,
BugReporterContext &BRC,
PathSensitiveBugReport &BR) override {
if (Satisfied)
return nullptr;

// check for open call's 2th argument
if (std::optional<StmtPoint> P = N->getLocationAs<StmtPoint>()) {
if (OpenCallExpr && OpenCallExpr == P->getStmtAs<CallExpr>()) {
Satisfied = true;
const auto *openFlagExpr = OpenCallExpr->getArg(1);
SVal flagSV = N->getSVal(openFlagExpr);
const llvm::APSInt *flagV = flagSV.getAsInteger();
if (!flagV)
return nullptr;

if ((*flagV & O_NONBLOCKV) != 0)
BR.markInvalid(getTag(), nullptr);

return nullptr;
}
}

const ExplodedNode *Pred = N->getFirstPred();
SVal presv = Pred->getState()->getSVal(VR);
SVal sv = N->getState()->getSVal(VR);

// check if file descirptor's SVal changed between nodes
if (sv == presv)
return nullptr;

std::optional<PostStore> P = N->getLocationAs<PostStore>();
if (!P)
return nullptr;

if (const auto *DS = P->getStmtAs<DeclStmt>()) {
// variable initialization
// int fd = open(...)
const VarDecl *VD = VR->getDecl();
if (DS->getSingleDecl() == VR->getDecl()) {
const auto *InitCall = dyn_cast_if_present<CallExpr>(VD->getInit());
if (!InitCall || !OpenFunction.matchesAsWritten(*InitCall))
return nullptr;

OpenCallExpr = InitCall;
}
} else if (const auto *BO = P->getStmtAs<BinaryOperator>()) {
// assignment
// fd = open(...)
const auto *DRE = dyn_cast<DeclRefExpr>(BO->getLHS());
if (DRE && DRE->getDecl() == VR->getDecl()) {
const auto *InitCall = dyn_cast<CallExpr>(BO->getRHS());
if (!InitCall || !OpenFunction.matchesAsWritten(*InitCall))
return nullptr;

OpenCallExpr = InitCall;
}
}

return nullptr;
}
};

class BlockInCriticalSectionChecker : public Checker<check::PostCall> {
private:
const std::array<MutexDescriptor, 8> MutexDescriptors{
Expand Down Expand Up @@ -339,6 +425,36 @@ void BlockInCriticalSectionChecker::reportBlockInCritSection(
os.str(), ErrNode);
R->addRange(Call.getSourceRange());
R->markInteresting(Call.getReturnValue());
// for 'read' call, check whether it's file descriptor(first argument) is
// created by 'open' API with O_NONBLOCK flag and don't report for this
// situation.
if (Call.getCalleeIdentifier()->getName() == "read") {
do {
const auto *arg = Call.getArgExpr(0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I know the function is not consistent at the moment but the coding convention requires variable names to start with an uppercase letter.

if (!arg)
break;

const auto *DRE = dyn_cast<DeclRefExpr>(arg->IgnoreImpCasts());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matching the AST is not a good idea. What if the user writes something like cond ? val1 : val2 as the argument? Any reason to not use CallEvent::getArgSVal?

Copy link
Contributor Author

@flovent flovent Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am hoping to get the MemRegion of file descriptor here and compare its corresponding SVal between pred node and current node in VisitNode, i can't use getArgSVal to get SVal as region because open call is evaluated to a symbol or a literal int value(-1), i need to recognize this two situation.
is there a way to check binding for SVal between nodes or i should do some other operations to check changed node position?

Alternatively, instead of using a BugReporterVisitor, we could maintain a set of file handles that are OK to use.

this is the same reason i didn't use set

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Unfortunately, matching on the memory region might not be the most reliable.

Having things like int a = b; would move the value in a new memory region. Also, matching the AST in the bug reporter visitor is fragile as there are many ways to express something.

E.g., imagine if someone has some logging and does something like int fd = LOG(open(...)) where the LOG macro inserts some extra code? In general, we should try to do as little matching on the AST as possible and should rely in the symbols when we can.

So my proposal would be to maintain a set of symbols in the analysis state. After each open call look at the returned symbol, and in case it was returning a non-blocking file descriptor put that symbol in the set.

When we report a problem check if the file descriptor we use to report the problem is in the set.

This works great for symbolic file descriptors. Unfortunately, this might break down for concrete integers like 1. But I am wondering if that is a rare edge case enough that we might not need to support. I'd expect open to almost always return a symbolic value. What do you think?

Copy link
Contributor Author

@flovent flovent Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for your detailed explanation, I did overlook some complex scenarios.

And I agree with your point, Checking for open's return value before calling read is very necessary in a real project, this is a modified testcase with checking for file descirptor,in that case we can ignore concrete integers situation.

void foo()
{
    std::lock_guard<std::mutex> lock(mtx);

    const char *filename = "example.txt";
    int fd = open(filename, O_RDONLY | O_NONBLOCK);

    char buffer[200] = {};
    if (fd == -1)
      return;
    read(fd, buffer, 199); // no-warning: fd is a non-block file descriptor
    close(fd);
}

if (!DRE)
break;

const auto *VD = dyn_cast_if_present<VarDecl>(DRE->getDecl());
if (!VD)
break;

const VarRegion *VR = C.getState()->getRegion(VD, C.getLocationContext());
if (!VR)
break;

std::optional<int> O_NONBLOCKV = tryExpandAsInteger(
"O_NONBLOCK", C.getBugReporter().getPreprocessor());
if (!O_NONBLOCKV)
break;

R->addVisitor(
std::make_unique<NonBlockOpenVisitor>(VR, O_NONBLOCKV.value()));
} while (false);
}
C.emitReport(std::move(R));
}

Expand Down
49 changes: 49 additions & 0 deletions clang/test/Analysis/issue-124474.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// RUN: %clang_analyze_cc1 \
// RUN: -analyzer-checker=unix.BlockInCriticalSection \
// RUN: -std=c++11 \
// RUN: -analyzer-output text \
// RUN: -verify %s

// expected-no-diagnostics

namespace std {
struct mutex {
void lock() {}
void unlock() {}
};
template<typename T>
struct lock_guard {
lock_guard<T>(std::mutex) {}
~lock_guard<T>() {}
};
template<typename T>
struct unique_lock {
unique_lock<T>(std::mutex) {}
~unique_lock<T>() {}
};
template<typename T>
struct not_real_lock {
not_real_lock<T>(std::mutex) {}
};
} // namespace std

std::mutex mtx;
using ssize_t = long long;
using size_t = unsigned long long;
int open (const char *__file, int __oflag, ...);
ssize_t read(int fd, void *buf, size_t count);
void close(int fd);
#define O_RDONLY 00
# define O_NONBLOCK 04000

void foo()
{
std::lock_guard<std::mutex> lock(mtx);

const char *filename = "example.txt";
int fd = open(filename, O_RDONLY | O_NONBLOCK);

char buffer[200] = {};
read(fd, buffer, 199); // no-warning: fd is a non-block file descriptor
close(fd);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: missing new line at the end of the file.