SuccessChanges

Summary

  1. [analyzer][RetainCount] Tie diagnostics to osx.cocoa.RetainCount rather then RetainCountBase, for the most part (details)
  2. [analyzer][MallocChecker] Make NewDeleteLeaks depend on DynamicMemoryModeling rather than NewDelete (details)
  3. [NFC] Fix formatting for the 'aix-ld.c' test case. (details)
  4. Modify verifier checks to support musttail + preallocated (details)
  5. [llvm-objcopy][MachO] Add support for removing Swift symbols (details)
  6. [mlir][shape] Add `shape.get_extent`. (details)
  7. [lldb/Test] Modify TestSymbolTable.py for reproducers (details)
  8. [lldb][Core] Remove dead codepath in Mangled (details)
  9. Autogen a couple of test files to make a future diff easier to read (details)
  10. Split a test file so that most of it can be autogened (details)
  11. [lldb/Docs] Add the application speicfic lldbinit to the man page (details)
  12. Add self as code owner for SCEV and IndVars (details)
  13. [AArch64][GlobalISel] Do not modify predicate when optimizing G_ICMP (details)
  14. [NFC, StackSafety] Better names for internal stuff (details)
  15. [NFC, StackSafety] Remove duplicate code (details)
  16. [NFC, StackSafety] Add some missing includes (details)
  17. [StackSafety] Simplify SCEVRewriteVisitor (details)
  18. GlobalISel: Basic legalization for G_PTRMASK (details)
  19. GlobalISel: Add a clarification to G_STORE documentation (details)
  20. Temporarily Revert "[Clang][AArch64] Capturing proper pointer alignment for Neon vld1 intrinsicts" (details)
Commit 5192783bb29c32196f87044de113fc43d7dfaae8 by dkszelethus
[analyzer][RetainCount] Tie diagnostics to osx.cocoa.RetainCount rather then RetainCountBase, for the most part

Similarly to other patches of mine, I'm trying to uniformize the checker
interface so that dependency checkers don't emit diagnostics. The checker that
made me most anxious so far was definitely RetainCount, because it is definitely
impacted by backward compatibility concerns, and implements a checker hierarchy
that is a lot different to other examples of similar size. Also, I don't have
authority, nor expertise regarding ObjC related code, so I welcome any
objection/discussion!

Differential Revision: https://reviews.llvm.org/D78099
The file was modifiedclang/test/Analysis/Inputs/expected-plists/objc-radar17039661.m.plist
The file was modifiedclang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
The file was modifiedclang/test/Analysis/Inputs/expected-plists/objc-arc.m.plist
The file was modifiedclang/test/Analysis/Inputs/expected-plists/plist-output-alternate.m.plist
The file was modifiedclang/test/Analysis/Inputs/expected-plists/retain-release-path-notes.m.plist
The file was modifiedclang/test/Analysis/Inputs/expected-plists/edges-new.mm.plist
The file was modifiedclang/test/Analysis/Inputs/expected-plists/plist-output.m.plist
The file was modifiedclang/test/Analysis/inlining/Inputs/expected-plists/path-notes.m.plist
The file was modifiedclang/test/Analysis/test-separate-retaincount.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h
The file was modifiedclang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.h
The file was modifiedclang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp
The file was modifiedclang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist
The file was modifiedclang/test/Analysis/incorrect-checker-names.mm
The file was modifiedclang/test/Analysis/Inputs/expected-plists/retain-release.m.objc.plist
Commit efd1a8e66eaa13afff709ebf16ff6280caa82ead by dkszelethus
[analyzer][MallocChecker] Make NewDeleteLeaks depend on DynamicMemoryModeling rather than NewDelete

If you remember the mail [1] I sent out about how I envision the future of the
already existing checkers to look dependencywise, one my main points was that no
checker that emits diagnostics should be a dependency. This is more problematic
for some checkers (ahem, RetainCount [2]) more than for others, like this one.

The MallocChecker family is a mostly big monolithic modeling class some small
reporting checkers that only come to action when we are constructing a warning
message, after the actual bug was detected. The implication of this is that
NewDeleteChecker doesn't really do anything to depend on, so this change was
relatively simple.

The only thing that complicates this change is that FreeMemAux (MallocCheckers
method that models general memory deallocation) returns after calling a bug
reporting method, regardless whether the report was ever emitted (which may not
always happen, for instance, if the checker responsible for the report isn't
enabled). This return unfortunately happens before cleaning up the maps in the
GDM keeping track of the state of symbols (whether they are released, whether
that release was successful, etc). What this means is that upon disabling some
checkers, we would never clean up the map and that could've lead to false
positives, e.g.:

error: 'warning' diagnostics seen but not expected:
  File clang/test/Analysis/NewDelete-intersections.mm Line 66: Potential leak of memory pointed to by 'p'
  File clang/test/Analysis/NewDelete-intersections.mm Line 73: Potential leak of memory pointed to by 'p'
  File clang/test/Analysis/NewDelete-intersections.mm Line 77: Potential leak of memory pointed to by 'p'

error: 'warning' diagnostics seen but not expected:
  File clang/test/Analysis/NewDelete-checker-test.cpp Line 111: Undefined or garbage value returned to caller
  File clang/test/Analysis/NewDelete-checker-test.cpp Line 200: Potential leak of memory pointed to by 'p'

error: 'warning' diagnostics seen but not expected:
  File clang/test/Analysis/new.cpp Line 137: Potential leak of memory pointed to by 'x'
There two possible approaches I had in mind:

Make bug reporting methods of MallocChecker returns whether they succeeded, and
proceed with the rest of FreeMemAux if not,
Halt execution with a sink node upon failure. I decided to go with this, as
described in the code.
As you can see from the removed/changed test files, before the big checker
dependency effort landed, there were tests to check for all the weird
configurations of enabled/disabled checkers and their messy interactions, I
largely repurposed these.

[1] http://lists.llvm.org/pipermail/cfe-dev/2019-August/063070.html
[2] http://lists.llvm.org/pipermail/cfe-dev/2019-August/063205.html

Differential Revision: https://reviews.llvm.org/D77474
The file was modifiedclang/test/Analysis/NewDelete-intersections.mm
The file was removedclang/test/Analysis/Malloc+NewDelete_intersections.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
The file was modifiedclang/test/Analysis/NewDelete-checker-test.cpp
The file was modifiedclang/test/Analysis/new.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Checkers/Checkers.td
Commit a924dac44f31ffa19508165fc61a9f10cd1d4836 by wanyu9511
[NFC] Fix formatting for the 'aix-ld.c' test case.

Summary:
Based on comments received in D80415 pertinent to test case format, the following fixes are provided to other tests in 'aix-ld.c' for the sake of consistency and readability,
  - Align flags in RUN directives vertically.
  - Align patterns in CHECK directives vertically.
  - Remove the ‘-o %t.o’ as it’s unnecessary for tests with ‘-###’.
  - Fix typos in comments.

Reviewers: ZarkoCA, hubert.reinterpretcast, daltenty

Reviewed By: hubert.reinterpretcast

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80532
The file was modifiedclang/test/Driver/aix-ld.c
Commit 9a0b0855a96ad91e082c6fb066e0ebabe72eb6b3 by aeubanks
Modify verifier checks to support musttail + preallocated

Summary:
preallocated and musttail can work together, but we don't want to call
@llvm.call.preallocated.setup() to modify the stack in musttail calls.
So we shouldn't have the "preallocated" operand bundle when a
preallocated call is musttail.

Also disallow use of preallocated on calls without preallocated.

Codegen not yet implemented.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80581
The file was modifiedllvm/test/Verifier/preallocated-invalid.ll
The file was modifiedllvm/lib/IR/Verifier.cpp
The file was modifiedllvm/test/Verifier/preallocated-valid.ll
The file was modifiedllvm/docs/LangRef.rst
Commit 842a8cc10c4146cee6cedd94fbf556c94b8ec365 by alexshap
[llvm-objcopy][MachO] Add support for removing Swift symbols

cctools strip has the option "-T" which removes Swift symbols.
This diff implements this option in llvm-strip for MachO.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D80099
The file was addedllvm/test/tools/llvm-objcopy/MachO/remove-swift-symbols.test
The file was modifiedllvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp
The file was modifiedllvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp
The file was modifiedllvm/tools/llvm-objcopy/StripOpts.td
The file was modifiedllvm/tools/llvm-objcopy/CopyConfig.h
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOReader.h
The file was modifiedllvm/tools/llvm-objcopy/CopyConfig.cpp
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOReader.cpp
The file was modifiedllvm/tools/llvm-objcopy/MachO/Object.h
The file was modifiedllvm/docs/CommandGuide/llvm-strip.rst
Commit cf42b704391c44e84485dd2547ae006196998266 by silvasean
[mlir][shape] Add `shape.get_extent`.

Summary:
This op extracts an extent from a shape.

This also is the first op which constant folds to shape.const_size,
which revealed that shape.const_size needs a folder (ConstantLike ops
seem to always need folders for the constant folding infra to work).

Differential Revision: https://reviews.llvm.org/D80394
The file was modifiedmlir/lib/Dialect/Shape/IR/Shape.cpp
The file was modifiedmlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
The file was modifiedmlir/test/Dialect/Shape/canonicalize.mlir
Commit e724db03752a0cd06a86153fea0d95e377f999c0 by Jonas Devlieghere
[lldb/Test] Modify TestSymbolTable.py for reproducers

Work around global module caching during reproducer replay. See inline
comment for the details.
The file was modifiedlldb/test/API/lang/objc/foundation/TestSymbolTable.py
Commit 1079978b3c506abca2b4dd9a5b131c024330206b by apl
[lldb][Core] Remove dead codepath in Mangled

Summary:
Objective-C names are stored in m_demangled, not in m_mangled. The
method in the condition will never return true.

Differential Revision: https://reviews.llvm.org/D79823
The file was modifiedlldb/source/Core/Mangled.cpp
Commit b90eb0f23b5bf3db4a091748b3ea6de9a45645c9 by listmail
Autogen a couple of test files to make a future diff easier to read
The file was modifiedllvm/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll
The file was modifiedllvm/test/Transforms/RewriteStatepointsForGC/basic.ll
The file was modifiedllvm/test/Transforms/RewriteStatepointsForGC/deopt-lowering-attrs.ll
Commit bed6624ac43bc223114d0b9380d593f2dfd749ff by listmail
Split a test file so that most of it can be autogened
The file was modifiedllvm/test/Transforms/RewriteStatepointsForGC/scalar-base-vector.ll
The file was addedllvm/test/Transforms/RewriteStatepointsForGC/scalar-base-vector-2.ll
Commit 40c4ecabc238cfdd639bc1e927800337457e69e3 by Jonas Devlieghere
[lldb/Docs] Add the application speicfic lldbinit to the man page

This used to be part of the man page but got lost when we moved to
generating it with Sphinx.
The file was modifiedlldb/docs/man/lldb.rst
Commit 323d850427472ed060fc4c495b2010e6174b875b by listmail
Add self as code owner for SCEV and IndVars

This was discussed on llvm-dev thread "Transferring code ownership for SCEV and IndVars" a few months back.  I just forgot to make the actual change.
The file was modifiedllvm/CODE_OWNERS.TXT
Commit ae597a771ed4d7530e2ef232d02a253067e3312f by Jessica Paquette
[AArch64][GlobalISel] Do not modify predicate when optimizing G_ICMP

This fixes a bug in `tryOptArithImmedIntegerCompare`.

It is unsafe to update the predicate on a MachineOperand when optimizing a
G_ICMP, because it may be used in more than one place.

For example, when we are optimizing G_SELECT, we allow compares which are used
in more than one G_SELECT. If we modify the G_ICMP, then we'll break one of
the G_SELECTs.

Since the compare is being produced to either

1) Select a G_ICMP
2) Fold a G_ICMP into an instruction when profitable

there's no reason to actually modify it. The change is local to the specific
compare.

Instead, pass a `CmpInst::Predicate` to `tryOptArithImmedIntegerCompare` which
can be modified by reference.

Differential Revision: https://reviews.llvm.org/D80585
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-arith-immed-compare.mir
The file was modifiedllvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
Commit f20ace6f333fa56af1879f7480a0e7979201c374 by Vitaly Buka
[NFC, StackSafety] Better names for internal stuff

Remove const from some parameters as upcoming changes in ScalarEvolution
calls will need non const pointers.
The file was modifiedllvm/lib/Analysis/StackSafetyAnalysis.cpp
Commit 5afef79ff465e1711a9412f6814d66ff80f50dcf by Vitaly Buka
[NFC, StackSafety] Remove duplicate code
The file was modifiedllvm/lib/Analysis/StackSafetyAnalysis.cpp
Commit 4320d4aa1c1c7d8bd75537703f7a11140552b0fa by Vitaly Buka
[NFC, StackSafety] Add some missing includes
The file was modifiedllvm/lib/Analysis/StackSafetyAnalysis.cpp
Commit b5ae70046b0211ff75be8459f7282fe07ad918d8 by Vitaly Buka
[StackSafety] Simplify SCEVRewriteVisitor

Probably NFC.
The file was modifiedllvm/lib/Analysis/StackSafetyAnalysis.cpp
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/local.ll
Commit ef3e83122665adcb2f7a7f380c9deb3dac68cb80 by Matthew.Arsenault
GlobalISel: Basic legalization for G_PTRMASK
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-ptrmask.mir
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
Commit 8e3307f5519fa58827c7b030274f122b1ed36617 by Matthew.Arsenault
GlobalISel: Add a clarification to G_STORE documentation

Mirror the note on G_LOAD. We probably do need to add an explicit
G_TRUNCSTORE opcode for the vector case, although I do not have a use
for it.
The file was modifiedllvm/docs/GlobalISel/GenericOpcode.rst
Commit 97a133f15724aa7ddf5d9b62dc9c0657a4efd115 by echristo
Temporarily Revert "[Clang][AArch64] Capturing proper pointer alignment for Neon vld1 intrinsicts"
as it's causing crashes on code generation and https://bugs.llvm.org/show_bug.cgi?id=46084

This reverts commit 98cad555e29187a03e2bc3db5780762981913902.
The file was modifiedclang/test/CodeGen/aarch64-neon-intrinsics.c
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp