Skip to content

[pull] swiftwasm-stable/20210726 from apple:stable/20210726 #1567

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

Open
wants to merge 462 commits into
base: swiftwasm-stable/20210726
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
462 commits
Select commit Hold shift + click to select a range
a1656d5
Improve error logging when ast context is in fatal error state.
adrian-prantl Dec 15, 2021
e2549b7
Merge pull request #3692 from apple/compnerd/paths-are-dirs-but-dirs-…
compnerd Dec 15, 2021
3802524
[Passes] Improve opt-pipeline-vector-passes.ll test.
fhahn Dec 3, 2021
7c3779f
[Passes] Only run extra vector passes if loops have been vectorized.
fhahn Dec 10, 2021
9103340
Merge pull request #3675 from augusto2112/sidestep-wrong-triple-gen
augusto2112 Dec 15, 2021
b1368f1
Teach the backend to make references to swift_async_extendedFramePoin…
aschwaighofer Dec 15, 2021
7ed9e7b
Merge pull request #3697 from adrian-prantl/log-fatal
adrian-prantl Dec 15, 2021
ab0ddbf
[X86] Add test where block placement separates call from RV marker.
fhahn Dec 7, 2021
b4bb480
[X86] Use bundle for CALL_RVMARKER expansion.
fhahn Dec 14, 2021
e7c56da
Merge pull request #3695 from aschwaighofer/weak_swift_async_extended…
aschwaighofer Dec 15, 2021
dd25fc3
Use StringRef instead of char* (NFC)
adrian-prantl Dec 15, 2021
5eff329
Remove redundant check (NFC)
adrian-prantl Dec 15, 2021
18c09eb
[IndexStore] Add a `UsingEnum` subkind to match the index
bnbarham Oct 28, 2021
8c0d23f
Merge pull request #3708 from bnbarham/cherry-using-enum
akyrtzi Dec 16, 2021
e52de6b
Fix dynamic import of libraries in Xcode playgrounds.
adrian-prantl Dec 16, 2021
c35a041
[X86] Add test where block placement separates call from RV marker.
fhahn Dec 7, 2021
9becd18
[X86] Use bundle for CALL_RVMARKER expansion.
fhahn Dec 14, 2021
eeb4c48
[Passes] Improve opt-pipeline-vector-passes.ll test.
fhahn Dec 3, 2021
8ac6869
[Passes] Only run extra vector passes if loops have been vectorized.
fhahn Dec 10, 2021
d396937
[lld-macho] Remove old macho darwin lld
keith Dec 1, 2021
39e4d81
[clang][Darwin] Remove old lld implementation handling
keith Dec 2, 2021
41e3260
[DwarfDebug] Refuse to emit DW_OP_LLVM_arg values wider than 64 bits
adrian-prantl Dec 10, 2021
4fd6a9a
[analyzer] Move test case to existing test file and remove duplicated…
ASDenysPetrov Jul 19, 2021
6c7816d
[analyzer] Cleanup a FIXME in SValBuilder.cpp
vabridgers Aug 8, 2021
a47af12
[clang][analyzer] Improve bug report in alpha.security.ReturnPtrRange
balazske Aug 11, 2021
85457df
[analyzer][NFC] Make test/Analysis/self-assign.cpp readable
Szelethus Aug 13, 2021
ee627a7
[analyzer][NFC] Split the main logic of NoStoreFuncVisitor to an abst…
Szelethus Jul 7, 2021
c9761d2
[analyzer] MallocChecker: Add a visitor to leave a note on functions …
Szelethus Jul 5, 2021
6314603
[analyzer] Add option to SATest.py for extra checkers
RedDocMD Aug 17, 2021
38866f8
[analyzer] Adjust JS code of analyzer's HTML report for IE support.
ASDenysPetrov Aug 3, 2021
bc14e0e
scan-build-py: Force the opening in utf-8
sylvestre Aug 17, 2021
a51172e
Revert "Revert "[analyzer] Ignore IncompleteArrayTypes in getStaticSi…
Aug 25, 2021
c249d46
[analyzer] Catch leaking stack addresses via stack variables
Aug 27, 2021
a6939ba
[analyzer] Ignore single element arrays in getStaticSize() conditionally
Sep 4, 2021
32b389d
[analyzer] SValBuilder should have an easy access to AnalyzerOptions
Sep 4, 2021
9dcbb53
Fix scan-build-py executable lookup path
Sep 13, 2021
082f167
[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check e…
Szelethus Aug 19, 2021
b3a095a
[analyzer] MallocChecker: Add notes from NoOwnershipChangeVisitor onl…
Szelethus Aug 25, 2021
374d62c
[clang] disable implicit moves when not in CPlusPLus
mizvekov Sep 11, 2021
02f1929
[Analyzer] ConversionChecker: track back the cast expression
Sep 15, 2021
8acdbfa
[clang][scan-build] Use cc/c++ instead of gcc/g++ on OpenBSD.
fcambus Sep 17, 2021
1384c8a
Fix CLANG_ENABLE_STATIC_ANALYZER=OFF building all analyzer source
arichardson Sep 20, 2021
08a3b44
[analyzer] Retrieve a value from list initialization of constant arra…
ASDenysPetrov Sep 21, 2021
413e9d1
[analyzer] Fix deprecated plistlib functions
weirdsmiley Oct 1, 2021
ad09cd9
[analyzer] Add InvalidPtrChecker
Sep 18, 2021
57c42f0
[analyzer] canonicalize special case of structure/pointer deref
vabridgers Sep 28, 2021
43cd0fb
[analyzer][solver] Fix CmpOpTable handling bug
Sep 30, 2021
1c0177a
[analyzer][NFC] Add RangeSet::dump
Sep 30, 2021
0faf4f5
[analyzer] Fix non-obvious analyzer warning: Use of zero-allocated me…
haoNoQ Oct 12, 2021
27c35ea
[analyzer] Bifurcate on getenv() calls
Oct 13, 2021
997a3e1
[analyzer] Introduce the assume-controlled-environment config option
Oct 13, 2021
13f1415
[analyzer] Fix property access kind detection inside parentheses.
haoNoQ Oct 15, 2021
4b51568
[analyzer][NFC] Add unittests for CallDescription and split the old ones
Oct 18, 2021
a93e1f0
Teach the backend to make references to swift_async_extendedFramePoin…
aschwaighofer Dec 15, 2021
470efcc
[IndexStore] Add a `UsingEnum` subkind to match the index
bnbarham Oct 28, 2021
957cd05
Merge pull request #3709 from adrian-prantl/85431564
adrian-prantl Dec 17, 2021
bffea43
Initialize the Swift CompilerInstance with the triple from the load c…
adrian-prantl Dec 7, 2021
df6c1a0
Relax validation for GetChildCompilerTypeAtIndex
adrian-prantl Dec 9, 2021
81b52f6
Implement a short-circuit case for Clang types in GetNumChildren().
adrian-prantl Dec 10, 2021
2171827
[DwarfDebug] Refuse to emit DW_OP_LLVM_arg values wider than 64 bits
adrian-prantl Dec 10, 2021
3e7f8ae
Fix test on Apple Silicon
adrian-prantl Dec 10, 2021
0dcac30
Improve logging for dynamic library loading
adrian-prantl Dec 13, 2021
3eca550
Further improve wording of error message
adrian-prantl Dec 14, 2021
249b6ca
Improve error logging when ast context is in fatal error state.
adrian-prantl Dec 15, 2021
93b0217
Use StringRef instead of char* (NFC)
adrian-prantl Dec 15, 2021
774aa5c
Remove redundant check (NFC)
adrian-prantl Dec 15, 2021
eb88324
Fix dynamic import of libraries in Xcode playgrounds.
adrian-prantl Dec 16, 2021
982c765
Merge pull request #3711 from apple/eng/20210726-5.6-merge
hyp Dec 17, 2021
9295a4a
Merge commit '982c765c3403' from swift/release/5.6 into stable/20210726
Dec 20, 2021
0ad3c66
Merge commit 'c35a041b45140' from swift/release/5.6 into stable/20210726
hyp Dec 18, 2021
8647a7a
Merge commit '9becd18daa23' from swift/release/5.6 into stable/20210726
Dec 18, 2021
923dd3a
Merge commit 'eeb4c485157fd' from swift/release/5.6 into stable/20210726
hyp Dec 20, 2021
1f34c6a
Merge commit '8ac68692f98a' from swift/release/5.6 into stable/20210726
Dec 20, 2021
43f7de5
Merge pull request #3546 from ahoppen/pr/search-path-getters
ahoppen Dec 20, 2021
690a3bc
Merge commit 'eeb4c485157f' from swift/release/5.6 into stable/20210726
Dec 20, 2021
e133ddd
Merge pull request #3691 from augusto2112/unstatify-tss-typeref-funct…
augusto2112 Dec 22, 2021
b661a19
Support v2 of 'main bin spec' Mach-O LC_NOTE in corefiles
jasonmolenda Dec 22, 2021
25c5fa3
[analyzer][NFCI] Move a block from `getBindingForElement` to separate…
ASDenysPetrov Oct 18, 2021
e84f9ea
[analyzer] Retrieve incomplete array extent from its redeclaration.
ASDenysPetrov Oct 20, 2021
c8e0f2f
Merge commit 'a987185d6dae' from swift/release/5.6 into stable/20210726
Dec 23, 2021
a987185
Merge pull request #3730 from haoNoQ/static-analyzer-cherrypicks-25
haoNoQ Dec 23, 2021
56da298
lldb: link the swift compiler's swift modules to lldb
eeckstein Nov 15, 2021
92d0635
[lldb] Log modules using internal and public SDKs
kastiglione Dec 20, 2021
eaee47c
Merge pull request #3537 from eeckstein/libswift-in-lldb
eeckstein Dec 23, 2021
6bbb63f
Load binary by UUID from qProcessInfo packet fields
jasonmolenda Dec 23, 2021
99f01b0
swift-lldb cmake: fix a build problem when BOOTSTRAPPING=OFF
eeckstein Jan 3, 2022
de273e3
Merge pull request #3737 from eeckstein/fix-bootstrapping-off
compnerd Jan 4, 2022
ca7676a
lldb: fix the build after #3537
compnerd Jan 5, 2022
ab87766
Merge pull request #3732 from apple/lldb-Log-modules-using-internal-a…
kastiglione Jan 5, 2022
6f0e2b2
Merge pull request #3740 from apple/compnerd/ci
eeckstein Jan 5, 2022
e59cf91
[DSE] Add test case showing bug PR52774.
mariannems Dec 22, 2021
031406b
[DSE] Fix invalid removal of store instruction
mariannems Dec 22, 2021
a555f1c
[lldb] Remove some unnecessary scoped timers in TypeSystemSwiftTypeRef
kastiglione Jan 6, 2022
6b5f74a
Merge pull request #3685 from augusto2112/fix-cpp-exceptions-in-repl
augusto2112 Jan 6, 2022
b01a30b
[lldb] Use specified LD_EXTRAS when building TestSwiftCPPExceptionsIn…
augusto2112 Dec 14, 2021
9968d29
Merge pull request #3743 from apple/lldb-Remove-some-unnecessary-scop…
kastiglione Jan 6, 2022
c3a2138
Fix "break delete --disabled" with no arguments.
jimingham Jul 23, 2021
c0fcec0
[source map] fix relative path breakpoints
Jul 30, 2021
ac17901
Make Swift REPL pexpect test more robust by allowing extra control ch…
adrian-prantl Jan 6, 2022
5a077fd
Merge commit 'ae8b261b0b20' from swift/release/5.6 into stable/20210726
Jan 7, 2022
ae8b261
Merge pull request #3754 from adrian-prantl/cherry-pick-repl
adrian-prantl Jan 7, 2022
7b20e61
Merge commit '143f1389db63' from swift/release/5.6 into stable/20210726
Jan 7, 2022
143f138
Merge pull request #3751 from adrian-prantl/83503919
adrian-prantl Jan 7, 2022
5a01ee7
[lldb] Remove redundant log in SwiftASTContext
kastiglione Jan 8, 2022
4a292db
[lldb] Change ReconstructType positive cache hits logging to verbose
kastiglione Jan 8, 2022
420ba49
Merge commit '64a4d678f114' from swift/release/5.6 into stable/20210726
Jan 10, 2022
64a4d67
Merge pull request #3746 from augusto2112/5.6-fix-cpp-exceptions-in-repl
augusto2112 Jan 10, 2022
6272222
restore log instead with LOG_VERBOSE_PRINTF
kastiglione Jan 10, 2022
5c4dd35
[lldb] Don't eagerly load SwiftASTContext from DiagnoseWarnings
kastiglione Jan 11, 2022
6ff3862
Merge pull request #3763 from apple/lldb-Remove-redundant-log-in-Swif…
kastiglione Jan 11, 2022
7824be4
Merge pull request #3764 from apple/lldb-Change-ReconstructType-posit…
kastiglione Jan 11, 2022
200098b
Temporarily disable tests on Linux (5.6 branch only)
adrian-prantl Jan 11, 2022
4c782e8
Fix format specifier to not trigger an assertion
adrian-prantl Jan 11, 2022
8d8ea5c
[lldb] Teach LLDB about ExistentialType in the Swift AST.
hborla Jan 12, 2022
2ab388a
[lldb] Add missing SeverityForKind return statement
kastiglione Jan 12, 2022
41b9027
clean up switch
kastiglione Jan 12, 2022
0a1357f
update clangimporter types log grep counts
kastiglione Jan 12, 2022
eadf812
Merge commit '1d9bbf293b0b' from swift/release/5.6 into stable/20210726
Jan 12, 2022
1d9bbf2
Merge pull request #3716 from adrian-prantl/cherry-pick56
adrian-prantl Jan 12, 2022
b7eb4a2
Fix format specifier to not trigger an assertion
adrian-prantl Jan 11, 2022
91ffa10
Add missing nullptr check
adrian-prantl Jan 12, 2022
17ce99b
Revert "Temporarily disable tests on Linux (5.6 branch only)"
adrian-prantl Jan 12, 2022
4232fc6
Merge commit '8717a3e232d6' from swift/release/5.6 into stable/20210726
Jan 12, 2022
8717a3e
Merge pull request #3775 from adrian-prantl/fmt-56
adrian-prantl Jan 12, 2022
ff5ac68
[lldb] Remove low signal typeref logs
kastiglione Jan 12, 2022
cb6e652
Merge pull request #3779 from apple/lldb-Add-missing-SeverityForKind-…
kastiglione Jan 12, 2022
7ad4a35
[lldb] Make sure libCppLib.dylib is propery signed
JDevlieghere Jan 7, 2022
962fe56
Merge pull request #3780 from adrian-prantl/null-swiftastcontext56
adrian-prantl Jan 12, 2022
4606c38
Merge pull request #3781 from apple/lldb-Remove-low-signal-typeref-logs
kastiglione Jan 13, 2022
fca1726
Merge pull request #3786 from apple/jdevlieghere/cherrypick/990a48b72…
JDevlieghere Jan 13, 2022
3e2bc96
Fix use-after-free in SwiftLanguageRuntimeImpl::GetChildCompilerTypeA…
adrian-prantl Jan 13, 2022
e8914cf
Merge pull request #3778 from hborla/5.6-lldb-swift-existential-type
hborla Jan 14, 2022
d61a0a3
Merge commit 'b4fe124415f4' from swift/release/5.6 into stable/20210726
Jan 14, 2022
b4fe124
Merge pull request #3793 from adrian-prantl/87565969
adrian-prantl Jan 14, 2022
c1d2e32
Merge commit '962fe56c001d' from swift/release/5.6 into stable/20210726
JDevlieghere Jan 14, 2022
39c2c56
Merge commit 'e8914cfd2b27' from swift/release/5.6 into stable/20210726
Jan 14, 2022
8da499b
Work around upcoming removal of NestedArchetypeType.
DougGregor Jan 14, 2022
e494ec0
[lldb] Unwrap the type when dereferencing the value
werat Nov 11, 2021
8bc8b85
Merge pull request #3796 from DougGregor/swift-nested-archetype-remov…
DougGregor Jan 14, 2022
4f1fbc3
Merge commit 'a6644b3de724' from swift/release/5.6 into stable/20210726
Jan 15, 2022
a6644b3
Merge pull request #3801 from shafik/82009764_unwrap_type_when_defef_…
shafik Jan 15, 2022
a7fd7db
[GlobalISel] Look through truncs and extends in narrowScalarShift
konstantinschwarz Oct 8, 2020
55ecb91
[lldb] Move LLDBMemoryReader to its own file
augusto2112 Jan 18, 2022
d93f4f2
fix Shell/Swift tests
kastiglione Jan 18, 2022
ec92dc6
Merge pull request #3768 from apple/lldb-Don-t-eagerly-load-SwiftASTC…
kastiglione Jan 19, 2022
fa1b51e
Try harder to emit diagnostic on errors in file-descriptor destructor…
artemcm Sep 23, 2021
4dc283d
Merge pull request #3807 from augusto2112/move-lldb-memory-reader
augusto2112 Jan 21, 2022
a132b59
Merge pull request #3804 from asl/stable/20210726
ornata Jan 21, 2022
ccffd74
Avoid repeated initalizations of SwiftASTContext after a failure.
adrian-prantl Jan 22, 2022
b5e4c37
[lldb] Make functions that take SwiftASTContext in TSSTyperef not static
augusto2112 Dec 14, 2021
92dbadb
TypeSystemSwiftTypeRef: Look up type aliases in type cache
adrian-prantl Jan 20, 2022
306142e
Merge pull request #3835 from adrian-prantl/87911176-5.6
adrian-prantl Jan 25, 2022
01b47e1
Merge commit '306142e1f964' from swift/release/5.6 into stable/20210726
Jan 25, 2022
b84b718
Merge pull request #3828 from adrian-prantl/86311054-5.6
adrian-prantl Jan 26, 2022
ec55c32
Merge commit 'b84b718954db' from swift/release/5.6 into stable/20210726
adrian-prantl Jan 26, 2022
eac3cf1
[DSE] Add test case showing bug PR52774.
mariannems Dec 22, 2021
0d7d612
[DSE] Fix invalid removal of store instruction
mariannems Dec 22, 2021
20ddcb4
Add a DIExpression const-folder to prevent silly expressions.
pogo59 Jul 27, 2021
2fb951d
Fix UB in DwarfExpression::emitLegacyZExt()
adrian-prantl Jan 25, 2022
1c2e71d
Merge commit 'eac3cf194473' from swift/release/5.6 into stable/20210726
TNorthover Jan 27, 2022
4ed785f
Merge commit '0d7d6125ef45' from swift/release/5.6 into stable/20210726
Jan 27, 2022
3473447
Merge pull request #3845 from adrian-prantl/88033721-5.6
adrian-prantl Jan 27, 2022
bf0db11
Merge commit '3473447da778' from swift/release/5.6 into stable/20210726
Jan 27, 2022
a8d3705
[lldb] Move LLDBMemoryReader to its own file
augusto2112 Jan 18, 2022
7fdc72a
[GlobalISel] Look through truncs and extends in narrowScalarShift
konstantinschwarz Oct 8, 2020
5eca70d
[lldb] Disable TestSwiftAsyncFrameVar.py
kastiglione Jan 27, 2022
cdd08a7
[ConstraintElimination] Add test from PR53123.
fhahn Jan 24, 2022
fa79e4e
Merge commit 'cdd08a7a40d2' from swift/release/5.6 into stable/20210726
Jan 28, 2022
f6d4148
[ConstraintElimination] Fix sign of sub decomposition.
fhahn Jan 24, 2022
90dc814
Merge commit 'f6d41488fd19' from swift/release/5.6 into stable/20210726
Jan 28, 2022
87ace47
Merge pull request #3858 from rjmccall/lldb-Disable-TestSwiftAsyncFra…
rjmccall Jan 29, 2022
426a757
Merge commit '87ace477ab2e' from swift/release/5.6 into stable/20210726
Jan 29, 2022
e04d8f4
Merge pull request #3852 from augusto2112/move-lldb-memory-reader-5.6
augusto2112 Feb 1, 2022
1879d69
Merge commit 'e04d8f4bc7c6' from swift/release/5.6 into stable/20210726
Feb 1, 2022
cf92f74
Merge pull request #3853 from asl/swift-5.6-3804-cherry-pick
ornata Feb 2, 2022
d0d7592
Merge commit 'cf92f74992fe' from swift/release/5.6 into stable/20210726
Feb 2, 2022
ad2ce5a
[clang] fix out of bounds access in an empty string when lexing a _Pr…
hyp Dec 20, 2021
381cbe9
Merge pull request #3886 from apple/eng/979d0ee8ab30-5.6
hyp Feb 3, 2022
191bfbf
Merge commit '381cbe9fa1a7' from swift/release/5.6 into stable/20210726
Feb 3, 2022
a4aec1f
Merge pull request #3819 from artemcm/FDDestructorErrorDiagnostic2
artemcm Feb 3, 2022
7e8c5ce
Merge commit 'a4aec1ff0f0b' from swift/release/5.6 into stable/20210726
Feb 3, 2022
c15cd51
[GVN] Add tests for loop load PRE through select.
fhahn Jan 25, 2022
7324bf7
Merge commit 'c15cd51e664e' from swift/release/5.6 into stable/20210726
Feb 4, 2022
abe6d69
[GVN] Add additional tests for PRE with pointer selects.
fhahn Jan 28, 2022
4d1e198
Merge commit 'abe6d692097c' from swift/release/5.6 into stable/20210726
Feb 4, 2022
75a6e0d
[GVN] Add tests with redundant load of pointer select.
fhahn Jan 28, 2022
48797de
Merge commit '75a6e0de503a' from swift/release/5.6 into stable/20210726
Feb 4, 2022
8eb1947
[GVN] Add tests for D118143 not requiring loops.
fhahn Feb 1, 2022
b8a921a
Merge commit '8eb194789806' from swift/release/5.6 into stable/20210726
Feb 4, 2022
e360e77
[GVN] Add additional tests after 216d1a729.
fhahn Feb 1, 2022
6b1799b
Merge commit 'e360e7788fd6' from swift/release/5.6 into stable/20210726
Feb 4, 2022
23ef75b
[GVN] Support load of pointer-select to value-select conversion.
fhahn Feb 2, 2022
34812da
Merge commit '23ef75ba4577' from swift/release/5.6 into stable/20210726
Feb 4, 2022
17355e5
[GVN] Replace PointerIntPair with separate pointer & kind fields (NFC).
fhahn Feb 2, 2022
a7f24d7
Merge commit '17355e50c356' from swift/release/5.6 into stable/20210726
Feb 4, 2022
201ddc5
Merge pull request #3848 from apple/lldb-Implement-LLDBMemoryReader-r…
kastiglione Feb 2, 2022
ab4878b
Flip default to off: SwiftUseReflectionSymbols
kastiglione Feb 4, 2022
417ba5a
Remove dependency on #3800
kastiglione Feb 4, 2022
944efd0
Increase memory buffer for scanning objc classes on darwin systems
jasonmolenda Feb 5, 2022
822249a
Merge commit '944efd0dbf3a' from swift/release/5.6 into stable/20210726
Feb 8, 2022
9459603
Merge pull request #3899 from apple/reflection-symbol-use-release-5.6
kastiglione Feb 8, 2022
f0aa3a7
Merge commit '945960397103' from swift/release/5.6 into stable/20210726
Feb 8, 2022
14fd809
Revert "[lldb] Disable TestSwiftAsyncFrameVar.py"
rjmccall Feb 8, 2022
62b900d
Merge pull request #3916 from rjmccall/lldb-revert-disable-TestSwiftA…
rjmccall Feb 10, 2022
e3bfef6
Merge commit '62b900d3d0d5' from swift/release/5.6 into stable/20210726
Feb 10, 2022
8155435
XFAIL test on aarch64/linux
adrian-prantl Feb 16, 2022
9776c7f
Update TestIndirectEnumVariables.py
adrian-prantl Feb 17, 2022
016ddf3
Merge pull request #3953 from adrian-prantl/89044113
adrian-prantl Feb 17, 2022
29dde5d
Merge commit '016ddf3ba9bf' from swift/release/5.6 into stable/20210726
Feb 17, 2022
135964d
AArch64: do not use xzr for ldxp -> stxp dataflow.
TNorthover Feb 9, 2022
95337e9
[lldb] Disable BreakpointSimple.test
JDevlieghere Mar 3, 2022
230a299
Merge pull request #4017 from apple/jdevlieghere/rdar/79730016
JDevlieghere Mar 3, 2022
1c8b1c7
Merge commit '230a2994f219' from swift/release/5.6 into stable/20210726
Mar 3, 2022
bc8b625
Fix compile error in non-asserts builds
adrian-prantl Feb 21, 2022
ffcb89f
Merge pull request #4028 from adrian-prantl/ndebug-5.6
shahmishal Mar 7, 2022
89b0e4d
Merge commit 'ffcb89f1f340' from swift/release/5.6 into stable/20210726
Mar 7, 2022
806d4f2
Make test more robust
adrian-prantl Mar 7, 2022
900c3b6
Merge pull request #4031 from adrian-prantl/force-expr
shahmishal Mar 7, 2022
96aee44
Merge commit '900c3b6b832d' from swift/release/5.6 into stable/20210726
Mar 8, 2022
cf4f938
Cache the result of TypeSystemSwiftTypeRef::LookupClangType().
adrian-prantl Mar 10, 2022
821a802
[lldb] Unlock Swift scratch context before early return
kastiglione Feb 1, 2022
bbad294
Merge pull request #4104 from adrian-prantl/90666627
adrian-prantl Mar 23, 2022
3655ea5
Merge commit 'bbad294515da' from swift/release/5.6 into stable/20210726
Mar 23, 2022
b0435fd
use make_scope_exit
kastiglione Feb 1, 2022
02340bb
Revert "[dsymutil] Emit an error when the Mach-O exceeds the 4GB limit."
JDevlieghere Mar 23, 2022
77d6a49
Merge pull request #4105 from adrian-prantl/90666943
adrian-prantl Mar 24, 2022
fee10dd
Merge commit '77d6a49d03c7' from swift/release/5.6 into stable/20210726
Mar 24, 2022
d4048df
Merge pull request #4113 from apple/jdevlieghere/rdar/90667314
JDevlieghere Mar 24, 2022
e05cf6e
Merge commit 'd4048df1135a' from swift/release/5.6 into stable/20210726
Mar 24, 2022
f70eb62
Implement DLQ_GetPtrAuthMask using info from debugserver.
adrian-prantl Mar 23, 2022
3c2ef81
[lldb] Disable PlatformRemoteMacOSX
JDevlieghere Mar 30, 2022
5070023
Merge pull request #4144 from apple/jdevlieghere/rdar/90360204
JDevlieghere Mar 31, 2022
4494807
Merge commit '50700236b0f6' from swift/release/5.6 into stable/20210726
Mar 31, 2022
1677e3b
Merge pull request #4135 from adrian-prantl/90718091-5.6
adrian-prantl Apr 1, 2022
a0d29ed
Merge commit '1677e3b3d06b' from swift/release/5.6 into stable/20210726
Apr 1, 2022
e5b0318
Remove assertion
adrian-prantl Mar 29, 2022
f765bf5
Merge pull request #4167 from adrian-prantl/noptrauthassert-5.6
adrian-prantl Apr 5, 2022
752fe75
Merge commit 'f765bf5b71fd' from swift/release/5.6 into stable/20210726
Apr 5, 2022
1f237a8
[lldb] Disable TestPlatformSDK.py
JDevlieghere Apr 6, 2022
e4b9282
[lldb] Set the TERM environment variable for the API tests
JDevlieghere Mar 22, 2022
167beca
Merge pull request #4185 from apple/jdevlieghere/5.6/fix-ci
JDevlieghere Apr 7, 2022
aa9a288
Merge commit '167becab9a5b' from swift/release/5.6 into stable/20210726
Apr 7, 2022
92bae8f
[ObjCARC] Tolerate missing attachedcall op by ignoring the bundle.
ahmedbougacha Apr 12, 2022
bd8381a
Merge pull request #4211 from apple/ahmedbougacha/arccontract-twice-b…
ahmedbougacha Apr 14, 2022
76b803d
Merge commit 'bd8381a99eee' from swift/release/5.6 into stable/20210726
Apr 14, 2022
71d1bdf
Merge pull request #4015 from apple/eng/PR-88127379
TNorthover Apr 28, 2022
24ff7e8
Merge commit '71d1bdfee579' from swift/release/5.6 into stable/20210726
Apr 28, 2022
94036a2
[lldb][Test] Disable flakey tests on Swift branch
Michael137 Aug 18, 2022
72dbaa0
Merge pull request #5147 from Michael137/disable-ubsan-tests-5.6
Michael137 Aug 18, 2022
ec55014
Merge commit '72dbaa0dbac4' from swift/release/5.6 into stable/20210726
Aug 18, 2022
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
  •  
  •  
  •  
12 changes: 10 additions & 2 deletions clang/cmake/modules/AddClang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ macro(add_clang_library name)
# The Xcode generator doesn't handle object libraries correctly.
list(APPEND LIBTYPE OBJECT)
endif()
set_property(GLOBAL APPEND PROPERTY CLANG_STATIC_LIBS ${name})
if (NOT EXCLUDE_FROM_ALL)
# Only include libraries that don't have EXCLUDE_FROM_ALL set. This
# ensure that the clang static analyzer libraries are not compiled
# as part of clang-shlib if CLANG_ENABLE_STATIC_ANALYZER=OFF.
set_property(GLOBAL APPEND PROPERTY CLANG_STATIC_LIBS ${name})
endif()
endif()
llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs})

Expand All @@ -110,8 +115,11 @@ macro(add_clang_library name)
endif()

foreach(lib ${libs})
if(TARGET ${lib})
if(TARGET ${lib})
target_link_libraries(${lib} INTERFACE ${LLVM_COMMON_LIBS})
if (EXCLUDE_FROM_ALL)
continue()
endif()

if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
get_target_export_arg(${name} Clang export_to_clangtargets UMBRELLA clang-libraries)
Expand Down
57 changes: 55 additions & 2 deletions clang/docs/analyzer/checkers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2074,10 +2074,63 @@ Finds calls to the ``putenv`` function which pass a pointer to an automatic vari
if (retval < 0 || (size_t)retval >= sizeof(env)) {
/* Handle error */
}

return putenv(env); // putenv function should not be called with auto variables
}


alpha.security.cert.env
^^^^^^^^^^^^^^^^^^^^^^^

SEI CERT checkers of `POSIX C coding rules <https://wiki.sei.cmu.edu/confluence/x/JdcxBQ>`_.

.. _alpha-security-cert-env-InvalidPtr:

alpha.security.cert.env.InvalidPtr
"""""""""""""""""""""""""""

Corresponds to SEI CERT Rules ENV31-C and ENV34-C.

ENV31-C:
Rule is about the possible problem with `main` function's third argument, environment pointer,
"envp". When enviornment array is modified using some modification function
such as putenv, setenv or others, It may happen that memory is reallocated,
however "envp" is not updated to reflect the changes and points to old memory
region.

ENV34-C:
Some functions return a pointer to a statically allocated buffer.
Consequently, subsequent call of these functions will invalidate previous
pointer. These functions include: getenv, localeconv, asctime, setlocale, strerror

.. code-block:: c

int main(int argc, const char *argv[], const char *envp[]) {
if (setenv("MY_NEW_VAR", "new_value", 1) != 0) {
// setenv call may invalidate 'envp'
/* Handle error */
}
if (envp != NULL) {
for (size_t i = 0; envp[i] != NULL; ++i) {
puts(envp[i]);
// envp may no longer point to the current environment
// this program has unanticipated behavior, since envp
// does not reflect changes made by setenv function.
}
}
return 0;
}

void previous_call_invalidation() {
char *p, *pp;

p = getenv("VAR");
pp = getenv("VAR2");
// subsequent call to 'getenv' invalidated previous one

*p;
// dereferencing invalid pointer
}

.. _alpha-security-ArrayBound:

alpha.security.ArrayBound (C)
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/Basic/Attr.td
Original file line number Diff line number Diff line change
Expand Up @@ -2347,6 +2347,7 @@ def SwiftAttr : InheritableAttr {
let Spellings = [GNU<"swift_attr">];
let Args = [StringArgument<"Attribute">];
let Documentation = [SwiftAttrDocs];
let PragmaAttributeSupport = 1;
}

def SwiftBridge : InheritableAttr {
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Basic/Builtins.def
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,11 @@ BUILTIN(__builtin_alloca, "v*z" , "Fn")
BUILTIN(__builtin_alloca_with_align, "v*zIz", "Fn")
BUILTIN(__builtin_call_with_static_chain, "v.", "nt")

BUILTIN(__builtin_elementwise_abs, "v.", "nct")
BUILTIN(__builtin_elementwise_max, "v.", "nct")
BUILTIN(__builtin_elementwise_min, "v.", "nct")
BUILTIN(__builtin_reduce_max, "v.", "nct")
BUILTIN(__builtin_reduce_min, "v.", "nct")

BUILTIN(__builtin_matrix_transpose, "v.", "nFt")
BUILTIN(__builtin_matrix_column_major_load, "v.", "nFt")
Expand Down
3 changes: 2 additions & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -11355,7 +11355,8 @@ def err_builtin_launder_invalid_arg : Error<
def err_builtin_invalid_arg_type: Error <
"%ordinal0 argument must be a "
"%select{vector, integer or floating point type|matrix|"
"pointer to a valid matrix element type}1 (was %2)">;
"pointer to a valid matrix element type|"
"signed integer or floating point type|vector type}1 (was %2)">;

def err_builtin_matrix_disabled: Error<
"matrix types extension is disabled. Pass -fenable-matrix to enable it">;
Expand Down
5 changes: 1 addition & 4 deletions clang/include/clang/Driver/ToolChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,7 @@ class ToolChain {
/// is LLD. If it's set, it can be assumed that the linker is LLD built
/// at the same revision as clang, and clang can make assumptions about
/// LLD's supported flags, error output, etc.
/// If LinkerIsLLDDarwinNew is non-nullptr, it's set if the linker is
/// the new version in lld/MachO.
std::string GetLinkerPath(bool *LinkerIsLLD = nullptr,
bool *LinkerIsLLDDarwinNew = nullptr) const;
std::string GetLinkerPath(bool *LinkerIsLLD = nullptr) const;

/// Returns the linker path for emitting a static library.
std::string GetStaticLibToolPath() const;
Expand Down
2 changes: 2 additions & 0 deletions clang/include/clang/Sema/Sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -12679,6 +12679,8 @@ class Sema final {
bool CheckPPCMMAType(QualType Type, SourceLocation TypeLoc);

bool SemaBuiltinElementwiseMath(CallExpr *TheCall);
bool SemaBuiltinElementwiseMathOneArg(CallExpr *TheCall);
bool SemaBuiltinReduceMath(CallExpr *TheCall);

// Matrix builtin handling.
ExprResult SemaBuiltinMatrixTranspose(CallExpr *TheCall,
Expand Down
21 changes: 20 additions & 1 deletion clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def Taint : Package<"taint">, ParentPackage<SecurityAlpha>;

def CERT : Package<"cert">, ParentPackage<SecurityAlpha>;
def POS : Package<"pos">, ParentPackage<CERT>;
def ENV : Package<"env">, ParentPackage<CERT>;

def Unix : Package<"unix">;
def UnixAlpha : Package<"unix">, ParentPackage<Alpha>;
Expand Down Expand Up @@ -485,7 +486,17 @@ def DynamicMemoryModeling: Checker<"DynamicMemoryModeling">,
"allocating and deallocating functions are annotated with "
"ownership_holds, ownership_takes and ownership_returns.",
"false",
InAlpha>
InAlpha>,
CmdLineOption<Boolean,
"AddNoOwnershipChangeNotes",
"Add an additional note to the bug report for leak-like "
"bugs. Dynamically allocated objects passed to functions "
"that neither deallocated it, or have taken responsibility "
"of the ownership are noted, similarly to "
"NoStoreFuncVisitor.",
"true",
Released,
Hide>
]>,
Dependencies<[CStringModeling]>,
Documentation<NotDocumented>,
Expand Down Expand Up @@ -937,6 +948,14 @@ let ParentPackage = POS in {

} // end "alpha.cert.pos"

let ParentPackage = ENV in {

def InvalidPtrChecker : Checker<"InvalidPtr">,
HelpText<"Finds usages of possibly invalidated pointers">,
Documentation<HasDocumentation>;

} // end "alpha.cert.env"

let ParentPackage = SecurityAlpha in {

def ArrayBoundChecker : Checker<"ArrayBound">,
Expand Down
16 changes: 16 additions & 0 deletions clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,22 @@ ANALYZER_OPTION(bool, ShouldDisplayCheckerNameForText, "display-checker-name",
"Display the checker name for textual outputs",
true)

ANALYZER_OPTION(
bool, ShouldConsiderSingleElementArraysAsFlexibleArrayMembers,
"consider-single-element-arrays-as-flexible-array-members",
"Consider single element arrays as flexible array member candidates. "
"This will prevent the analyzer from assuming that a single element array "
"holds a single element.",
false)

ANALYZER_OPTION(
bool, ShouldAssumeControlledEnvironment, "assume-controlled-environment",
"Whether the analyzed application runs in a controlled environment. "
"We will assume that environment variables exist in queries and they hold "
"no malicious data. For instance, if this option is enabled, 'getenv()' "
"might be modeled by the analyzer to never return NULL.",
false)

//===----------------------------------------------------------------------===//
// Unsigned analyzer options.
//===----------------------------------------------------------------------===//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringRef.h"
#include <list>
#include <memory>
Expand Down Expand Up @@ -622,8 +623,118 @@ class TagVisitor : public BugReporterVisitor {
PathSensitiveBugReport &R) override;
};

} // namespace ento
class ObjCMethodCall;
class CXXConstructorCall;

/// Put a diagnostic on return statement (or on } in its absence) of all inlined
/// functions for which some property remained unchanged.
/// Resulting diagnostics may read such as "Returning without writing to X".
///
/// Descendants can define what a "state change is", like a change of value
/// to a memory region, liveness, etc. For function calls where the state did
/// not change as defined, a custom note may be constructed.
///
/// For a minimal example, check out
/// clang/unittests/StaticAnalyzer/NoStateChangeFuncVisitorTest.cpp.
class NoStateChangeFuncVisitor : public BugReporterVisitor {
private:
/// Frames modifying the state as defined in \c wasModifiedBeforeCallExit.
/// This visitor generates a note only if a function does *not* change the
/// state that way. This information is not immediately available
/// by looking at the node associated with the exit from the function
/// (usually the return statement). To avoid recomputing the same information
/// many times (going up the path for each node and checking whether the
/// region was written into) we instead lazily compute the stack frames
/// along the path.
// TODO: Can't we just use a map instead? This is likely not as cheap as it
// makes the code difficult to read.
llvm::SmallPtrSet<const StackFrameContext *, 32> FramesModifying;
llvm::SmallPtrSet<const StackFrameContext *, 32> FramesModifyingCalculated;

/// Check and lazily calculate whether the state is modified in the stack
/// frame to which \p CallExitBeginN belongs.
/// The calculation is cached in FramesModifying.
bool isModifiedInFrame(const ExplodedNode *CallExitBeginN);

void markFrameAsModifying(const StackFrameContext *SCtx);

/// Write to \c FramesModifying all stack frames along the path in the current
/// stack frame which modifies the state.
void findModifyingFrames(const ExplodedNode *const CallExitBeginN);

protected:
bugreporter::TrackingKind TKind;

/// \return Whether the state was modified from the current node, \p CurrN, to
/// the end of the stack frame, at \p CallExitBeginN. \p CurrN and
/// \p CallExitBeginN are always in the same stack frame.
/// Clients should override this callback when a state change is important
/// not only on the entire function call, but inside of it as well.
/// Example: we may want to leave a note about the lack of locking/unlocking
/// on a particular mutex, but not if inside the function its state was
/// changed, but also restored. wasModifiedInFunction() wouldn't know of this
/// change.
virtual bool wasModifiedBeforeCallExit(const ExplodedNode *CurrN,
const ExplodedNode *CallExitBeginN) {
return false;
}

/// \return Whether the state was modified in the inlined function call in
/// between \p CallEnterN and \p CallExitEndN. Mind that the stack frame
/// retrieved from a CallEnterN and CallExitEndN is the *caller's* stack
/// frame! The inlined function's stack should be retrieved from either the
/// immediate successor to \p CallEnterN or immediate predecessor to
/// \p CallExitEndN.
/// Clients should override this function if a state changes local to the
/// inlined function are not interesting, only the change occuring as a
/// result of it.
/// Example: we want to leave a not about a leaked resource object not being
/// deallocated / its ownership changed inside a function, and we don't care
/// if it was assigned to a local variable (its change in ownership is
/// inconsequential).
virtual bool wasModifiedInFunction(const ExplodedNode *CallEnterN,
const ExplodedNode *CallExitEndN) {
return false;
}

/// Consume the information on the non-modifying stack frame in order to
/// either emit a note or not. May suppress the report entirely.
/// \return Diagnostics piece for the unmodified state in the current
/// function, if it decides to emit one. A good description might start with
/// "Returning without...".
virtual PathDiagnosticPieceRef
maybeEmitNoteForObjCSelf(PathSensitiveBugReport &R,
const ObjCMethodCall &Call,
const ExplodedNode *N) = 0;

/// Consume the information on the non-modifying stack frame in order to
/// either emit a note or not. May suppress the report entirely.
/// \return Diagnostics piece for the unmodified state in the current
/// function, if it decides to emit one. A good description might start with
/// "Returning without...".
virtual PathDiagnosticPieceRef
maybeEmitNoteForCXXThis(PathSensitiveBugReport &R,
const CXXConstructorCall &Call,
const ExplodedNode *N) = 0;

/// Consume the information on the non-modifying stack frame in order to
/// either emit a note or not. May suppress the report entirely.
/// \return Diagnostics piece for the unmodified state in the current
/// function, if it decides to emit one. A good description might start with
/// "Returning without...".
virtual PathDiagnosticPieceRef
maybeEmitNoteForParameters(PathSensitiveBugReport &R, const CallEvent &Call,
const ExplodedNode *N) = 0;

public:
NoStateChangeFuncVisitor(bugreporter::TrackingKind TKind) : TKind(TKind) {}

PathDiagnosticPieceRef VisitNode(const ExplodedNode *N,
BugReporterContext &BR,
PathSensitiveBugReport &R) override final;
};

} // namespace ento
} // namespace clang

#endif // LLVM_CLANG_STATICANALYZER_CORE_BUGREPORTER_BUGREPORTERVISITORS_H
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Range {
ID.AddPointer(&To());
}
void dump(raw_ostream &OS) const;
void dump() const;

// In order to keep non-overlapping ranges sorted, we can compare only From
// points.
Expand Down Expand Up @@ -282,6 +283,7 @@ class RangeSet {
bool contains(llvm::APSInt Point) const { return containsImpl(Point); }

void dump(raw_ostream &OS) const;
void dump() const;

bool operator==(const RangeSet &Other) const { return *Impl == *Other.Impl; }
bool operator!=(const RangeSet &Other) const { return !(*this == Other); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

namespace clang {

class AnalyzerOptions;
class BlockDecl;
class CXXBoolLiteralExpr;
class CXXMethodDecl;
Expand Down Expand Up @@ -66,6 +67,8 @@ class SValBuilder {

ProgramStateManager &StateMgr;

const AnalyzerOptions &AnOpts;

/// The scalar type to use for array indices.
const QualType ArrayIndexTy;

Expand Down Expand Up @@ -96,11 +99,7 @@ class SValBuilder {

public:
SValBuilder(llvm::BumpPtrAllocator &alloc, ASTContext &context,
ProgramStateManager &stateMgr)
: Context(context), BasicVals(context, alloc),
SymMgr(context, BasicVals, alloc), MemMgr(context, alloc),
StateMgr(stateMgr), ArrayIndexTy(context.LongLongTy),
ArrayIndexWidth(context.getTypeSize(ArrayIndexTy)) {}
ProgramStateManager &stateMgr);

virtual ~SValBuilder() = default;

Expand Down Expand Up @@ -188,6 +187,8 @@ class SValBuilder {
MemRegionManager &getRegionManager() { return MemMgr; }
const MemRegionManager &getRegionManager() const { return MemMgr; }

const AnalyzerOptions &getAnalyzerOptions() const { return AnOpts; }

// Forwarding methods to SymbolManager.

const SymbolConjured* conjureSymbol(const Stmt *stmt,
Expand Down
1 change: 1 addition & 0 deletions clang/include/indexstore/indexstore.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ typedef enum {
INDEXSTORE_SYMBOL_SUBKIND_ACCESSORSETTER = 4,
INDEXSTORE_SYMBOL_SUBKIND_USINGTYPENAME = 5,
INDEXSTORE_SYMBOL_SUBKIND_USINGVALUE = 6,
INDEXSTORE_SYMBOL_SUBKIND_USINGENUM = 7,

INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORWILLSET = 1000,
INDEXSTORE_SYMBOL_SUBKIND_SWIFTACCESSORDIDSET = 1001,
Expand Down
Loading