SuccessChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. GlobalISel: Copy correct flags to select (details)
  2. [SVE] MOVPRFX zero merging test renaming (details)
  3. analyzer][CallAndMessage][NFC] Change old callbacks to rely on CallEvent (details)
  4. AMDGPU: Annotate functions that have stack objects (details)
  5. [analyzer][NFC] Merge checkNewAllocator's paramaters into CXXAllocatorCall (details)
  6. [asan_symbolize] Fix bug handling C++ symbols when using Atos. (details)
  7. [lldb/test] Move "DataFormatters/Mock.h" to "Plugins/Language/ObjC/Utilities.h" (details)
  8. Add terminateCommands to lldb-vscode protocol (details)
  9. [analyzer] Change the default output type to PD_TEXT_MINIMAL in the frontend, error if an output loc is missing for PathDiagConsumers that need it (details)
Commit 08ae945318f351af73b96838c869da4a81434713 by Matthew.Arsenault
GlobalISel: Copy correct flags to select

This was looking for a compare condition, and copying the compare
flags. I don't think this was ever correct outside of certain min/max
patterns which aren't checked, but this probably predates select
instructions having fast math flags.
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
Commit e89a08aefdaca716ee0168b18d79818076178910 by cameron.mcinally
[SVE] MOVPRFX zero merging test renaming

Differential Revision: https://reviews.llvm.org/D80244
The file was modifiedllvm/test/CodeGen/AArch64/sve-intrinsics-int-arith-merging.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-intrinsics-fp-arith-merging.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-intrinsics-shifts-merging.ll
Commit 3d0d2fefc0a18f13e45a17be04a3da8d2b1299f8 by dkszelethus
analyzer][CallAndMessage][NFC] Change old callbacks to rely on CallEvent

The following series of patches has something similar in mind with D77474, with
the same goal to finally end incorrect checker names for good. Despite
CallAndMessage not suffering from this particular issue, it is a dependency for
many other checkers, which is problematic, because we don't really want
dependencies to also emit diagnostics (reasoning for this is also more detailed
in D77474).

CallAndMessage also has another problem, namely that it is responsible for a lot
of reports. You'll soon learn that this isn't really easy to solve for
compatibility reasons, but that is the topic of followup patches.

Differential Revision: https://reviews.llvm.org/D77845
The file was modifiedclang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
Commit 21d2884a9c5b4227a3e7f3220e4398aab1e49e1c by Matthew.Arsenault
AMDGPU: Annotate functions that have stack objects

Relying on any MachineFunction state in the MachineFunctionInfo
constructor is hazardous, because the construction time is unclear and
determined by the first use. The function may be only partially
constructed, which is part of why we have many of these hacky string
attributes to track what we need for ABI lowering.

For SelectionDAG, all stack objects are created up-front before
calling convention lowering so stack objects are visible at
construction time. For GlobalISel, none of the IR function has been
visited yet and the allocas haven't been added to the MachineFrameInfo
yet. This should fix failing to set flat_scratch_init in GlobalISel
when needed.

This pass really needs to be turned into some kind of analysis, but I
haven't found a nice way use one here.
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/flat-scratch-init.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp
The file was modifiedllvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
Commit f2be30def37d248a7666cfac3c922ca9db308c2a by dkszelethus
[analyzer][NFC] Merge checkNewAllocator's paramaters into CXXAllocatorCall

Party based on this thread:
http://lists.llvm.org/pipermail/cfe-dev/2020-February/064754.html.

This patch merges two of CXXAllocatorCall's parameters, so that we are able to
supply a CallEvent object to check::NewAllocatorCall (see the description of
D75430 to see why this would be great).

One of the things mentioned by @NoQ was the following:

  I think at this point we might actually do a good job sorting out this
  check::NewAllocator issue because we have a "separate" "Environment" to hold
  the other SVal, which is "objects under construction"! - so we should probably
  simply teach CXXAllocatorCall to extract the value from the
  objects-under-construction trait of the program state and we're good.

I had MallocChecker in my crosshair for now, so I admittedly threw together
something as a proof of concept. Now that I know that this effort is worth
pursuing though, I'll happily look for a solution better then demonstrated in
this patch.

Differential Revision: https://reviews.llvm.org/D75431
The file was modifiedclang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/Checker.h
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/CheckerManager.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/CheckerManager.h
The file was modifiedclang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
Commit 5811f3a9f8d300bfa764ffebedeb37fd13b73a4b by Dan Liew
[asan_symbolize] Fix bug handling C++ symbols when using Atos.

Summary:
The previous code tries to strip out parentheses and anything in between
them. I'm guessing the idea here was to try to drop any listed arguments
for the function being symbolized. Unfortunately this approach is broken
in several ways.

* Templated functions may contain parentheses. The existing approach
messes up these names.
* In C++ argument types are part of a function's signature for the
purposes of overloading so removing them could be confusing.

Fix this simply by not trying to adjust the function name that comes
from `atos`.

A test case is included.

Without the change the test case produced output like:

```
WRITE of size 4 at 0x6060000001a0 thread T0
    #0 0x10b96614d in IntWrapper<void >::operator=> const&) asan-symbolize-templated-cxx.cpp:10
    #1 0x10b960b0e in void writeToA<IntWrapper<void > >>) asan-symbolize-templated-cxx.cpp:30
    #2 0x10b96bf27 in decltype>)>> >)) std::__1::__invoke<void >), IntWrapper<void > >>), IntWrapper<void >&&) type_traits:4425
    #3 0x10b96bdc1 in void std::__1::__invoke_void_return_wrapper<void>::__call<void >), IntWrapper<void > >>), IntWrapper<void >&&) __functional_base:348
    #4 0x10b96bd71 in std::__1::__function::__alloc_func<void >), std::__1::allocator<void >)>, void >)>::operator>&&) functional:1533
    #5 0x10b9684e2 in std::__1::__function::__func<void >), std::__1::allocator<void >)>, void >)>::operator>&&) functional:1707
    #6 0x10b96cd7b in std::__1::__function::__value_func<void >)>::operator>&&) const functional:1860
    #7 0x10b96cc17 in std::__1::function<void >)>::operator>) const functional:2419
    #8 0x10b960ca6 in Foo<void >), IntWrapper<void > >::doCall>) asan-symbolize-templated-cxx.cpp:44
    #9 0x10b96088b in main asan-symbolize-templated-cxx.cpp:54
    #10 0x7fff6ffdfcc8 in start (in libdyld.dylib) + 0
```

Note how the symbol names for the frames are messed up (e.g. #8, #1).

With the patch the output looks like:

```
WRITE of size 4 at 0x6060000001a0 thread T0
    #0 0x10005214d in IntWrapper<void (int)>::operator=(IntWrapper<void (int)> const&) asan-symbolize-templated-cxx.cpp:10
    #1 0x10004cb0e in void writeToA<IntWrapper<void (int)> >(IntWrapper<void (int)>) asan-symbolize-templated-cxx.cpp:30
    #2 0x100057f27 in decltype(std::__1::forward<void (*&)(IntWrapper<void (int)>)>(fp)(std::__1::forward<IntWrapper<void (int)> >(fp0))) std::__1::__invoke<void (*&)(IntWrapper<void (int)>), IntWrapper<void (int)> >(void (*&)(IntWrapper<void (int)>), IntWrapper<void (int)>&&) type_traits:4425
    #3 0x100057dc1 in void std::__1::__invoke_void_return_wrapper<void>::__call<void (*&)(IntWrapper<void (int)>), IntWrapper<void (int)> >(void (*&)(IntWrapper<void (int)>), IntWrapper<void (int)>&&) __functional_base:348
    #4 0x100057d71 in std::__1::__function::__alloc_func<void (*)(IntWrapper<void (int)>), std::__1::allocator<void (*)(IntWrapper<void (int)>)>, void (IntWrapper<void (int)>)>::operator()(IntWrapper<void (int)>&&) functional:1533
    #5 0x1000544e2 in std::__1::__function::__func<void (*)(IntWrapper<void (int)>), std::__1::allocator<void (*)(IntWrapper<void (int)>)>, void (IntWrapper<void (int)>)>::operator()(IntWrapper<void (int)>&&) functional:1707
    #6 0x100058d7b in std::__1::__function::__value_func<void (IntWrapper<void (int)>)>::operator()(IntWrapper<void (int)>&&) const functional:1860
    #7 0x100058c17 in std::__1::function<void (IntWrapper<void (int)>)>::operator()(IntWrapper<void (int)>) const functional:2419
    #8 0x10004cca6 in Foo<void (IntWrapper<void (int)>), IntWrapper<void (int)> >::doCall(IntWrapper<void (int)>) asan-symbolize-templated-cxx.cpp:44
    #9 0x10004c88b in main asan-symbolize-templated-cxx.cpp:54
    #10 0x7fff6ffdfcc8 in start (in libdyld.dylib) + 0
```

rdar://problem/58887175

Reviewers: kubamracek, yln

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D79597
The file was addedcompiler-rt/test/asan/TestCases/Darwin/asan-symbolize-templated-cxx.cpp
The file was modifiedcompiler-rt/lib/asan/scripts/asan_symbolize.py
Commit 82dbf4aca84ec889d0dc390674ff44e30441bcfd by Vedant Kumar
[lldb/test] Move "DataFormatters/Mock.h" to "Plugins/Language/ObjC/Utilities.h"

This addresses some post-commit review feedback from
https://reviews.llvm.org/D80150 by renaming "Mock.h" to something less
misleading, and keeping logic related to the ObjC plugin separate from
the generic DataFormatters library.
The file was removedlldb/include/lldb/DataFormatters/Mock.h
The file was modifiedlldb/source/Plugins/Language/ObjC/Cocoa.cpp
The file was addedlldb/unittests/Language/ObjC/CMakeLists.txt
The file was addedlldb/source/Plugins/Language/ObjC/Utilities.h
The file was modifiedlldb/unittests/Language/CMakeLists.txt
The file was removedlldb/unittests/DataFormatter/MockTests.cpp
The file was addedlldb/unittests/Language/ObjC/UtilitiesTests.cpp
The file was modifiedlldb/unittests/DataFormatter/CMakeLists.txt
Commit a3609b0ec68522cb417ffe36ce9eb2e25ca61578 by aadsm
Add terminateCommands to lldb-vscode protocol

Summary: Adding this in line with "stopCommands" and "exitCommands" so that we can run commands at the end of the debugging session.

Reviewers: clayborg, wallace, labath

Reviewed By: clayborg, labath

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D79726
The file was modifiedlldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
The file was modifiedlldb/test/API/tools/lldb-vscode/attach/TestVSCode_attach.py
The file was modifiedlldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py
The file was modifiedlldb/tools/lldb-vscode/README.md
The file was modifiedlldb/tools/lldb-vscode/VSCode.cpp
The file was modifiedlldb/tools/lldb-vscode/lldb-vscode.cpp
The file was modifiedlldb/tools/lldb-vscode/package.json
The file was modifiedlldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
The file was modifiedlldb/tools/lldb-vscode/VSCode.h
Commit fe1a3a7e8c8be33968b9a768666489823dabab10 by dkszelethus
[analyzer] Change the default output type to PD_TEXT_MINIMAL in the frontend, error if an output loc is missing for PathDiagConsumers that need it

The title and the included test file sums everything up -- the only thing I'm
mildly afraid of is whether anyone actually depends on the weird behavior of
HTMLDiagnostics pretending to be TextDiagnostics if an output directory is not
supplied. If it is, I guess we would need to resort to tiptoeing around the
compatibility flag.

Differential Revision: https://reviews.llvm.org/D76510
The file was modifiedclang/include/clang/Basic/DiagnosticDriverKinds.td
The file was modifiedclang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
The file was modifiedclang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
The file was modifiedclang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
The file was addedclang/test/Analysis/output_types.cpp