1. [test] Improve SanitizerCoverage tests (details)
  2. adds more checks to -Wfree-nonheap-object (details)
  3. [mlir] Mark OpState::getAttrs() deprecated. (details)
  4. [libc++] Fix incorrect forwarding in tuple's assignment operator (details)
  5. [SanitizerCoverage] Drop !associated on metadata sections (details)
  6. Add a nullptr check. (details)
  7. [Clang][ASan] Introduce `-fsanitize-address-destructor-kind=` driver & frontend option. (details)
  8. [Clang][ASan] Teach Clang to not emit ASan module destructors when compiling with `-mkernel` or `-fapple-kext`. (details)
  9. [CodeGen] Call ConvertTypeForMem instead of ConvertType (details)
  10. [scudo][standalone] Compact pointers for Caches/Batches (details)
Commit 5bcb199a4317d30f6ada805c824e0e4be6db07bf by i
[test] Improve SanitizerCoverage tests
The file was removedllvm/test/Instrumentation/SanitizerCoverage/trace-pc-guard-nocomdat.ll
The file was removedllvm/test/Instrumentation/SanitizerCoverage/trace-pc-guard-comdat.ll
The file was modifiedllvm/test/Instrumentation/SanitizerCoverage/inline-bool-flag.ll (diff)
The file was addedllvm/test/Instrumentation/SanitizerCoverage/trace-pc-guard.ll
Commit 4f395db86b5cc11bb56853323d3cb1d4b6db5a0b by cjdb
adds more checks to -Wfree-nonheap-object

This commit adds checks for the following:

* labels
* block expressions
* random integers cast to `void*`
* function pointers cast to `void*`

Differential Revision:
The file was modifiedclang/test/Analysis/malloc-fnptr-plist.c (diff)
The file was modifiedclang/test/Analysis/free.c (diff)
The file was modifiedclang/include/clang/Basic/ (diff)
The file was addedclang/test/Analysis/free.cpp
The file was modifiedclang/lib/Sema/SemaChecking.cpp (diff)
The file was modifiedclang/test/Analysis/weak-functions.c (diff)
The file was modifiedclang/test/Analysis/malloc.c (diff)
Commit 8c074cb0b74e14ab1135d09cb53daf1a09602f73 by csigg
[mlir] Mark OpState::getAttrs() deprecated.

Fix call sites.

The method will be removed 2 weeks later.

Reviewed By: rriddle

Differential Revision:
The file was modifiedmlir/lib/Dialect/Affine/IR/AffineOps.cpp (diff)
The file was modifiedmlir/lib/Dialect/SPIRV/Transforms/DecorateCompositeTypeLayoutPass.cpp (diff)
The file was modifiedflang/include/flang/Optimizer/Dialect/ (diff)
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp (diff)
The file was modifiedmlir/lib/Dialect/OpenACC/IR/OpenACC.cpp (diff)
The file was modifiedmlir/include/mlir/IR/OpDefinition.h (diff)
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp (diff)
The file was modifiedmlir/lib/Dialect/Async/IR/Async.cpp (diff)
The file was modifiedmlir/lib/Dialect/PDL/IR/PDL.cpp (diff)
The file was modifiedmlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp (diff)
The file was modifiedmlir/examples/toy/Ch2/mlir/Dialect.cpp (diff)
The file was modifiedmlir/examples/toy/Ch7/mlir/Dialect.cpp (diff)
The file was modifiedmlir/lib/Dialect/Vector/VectorOps.cpp (diff)
The file was modifiedmlir/lib/Dialect/SCF/SCF.cpp (diff)
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp (diff)
The file was modifiedmlir/lib/Dialect/Shape/IR/Shape.cpp (diff)
The file was modifiedmlir/lib/Dialect/StandardOps/IR/Ops.cpp (diff)
The file was modifiedmlir/lib/IR/BuiltinDialect.cpp (diff)
The file was modifiedmlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp (diff)
Commit 618862e89a022b2e8f73a62bed7c91654060dbab by Louis Dionne
[libc++] Fix incorrect forwarding in tuple's assignment operator

Also, add a bunch of tests for tuple and pair's assignment operators
involving reference types.

Differential Revision:
The file was modifiedlibcxx/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp (diff)
The file was modifiedlibcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp (diff)
The file was modifiedlibcxx/test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp (diff)
The file was modifiedlibcxx/test/std/utilities/utility/pairs/pairs.pair/move_ctor.pass.cpp (diff)
The file was modifiedlibcxx/include/tuple (diff)
The file was modifiedlibcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp (diff)
The file was modifiedlibcxx/test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair_U_V.pass.cpp (diff)
The file was modifiedlibcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp (diff)
Commit 4d63892acb17ba8ee5b146e83d38f244d8d92222 by i
[SanitizerCoverage] Drop !associated on metadata sections

In SanitizerCoverage, the metadata sections (`__sancov_guards`,
`__sancov_cntrs`, `__sancov_bools`) are referenced by functions.  After
inlining, such a `__sancov_*` section can be referenced by more than one
functions, but its sh_link still refers to the original function's section.
(Note: a SHF_LINK_ORDER section referenced by a section other than its linked-to
section violates the invariant.)

If the original function's section is discarded (e.g. LTO internalization +
`ld.lld --gc-sections`), ld.lld may report a `sh_link points to discarded section` error.

This above reasoning means that `!associated` is not appropriate to be called by
an inlinable function. Non-interposable functions are inline candidates, so we
have to drop `!associated`. A `__sancov_pcs` is not referenced by other sections
but is expected to parallel a metadata section, so we have to make sure the two
sections are retained or discarded at the same time. A section group does the
trick.  (Note: we have a module ctor, so `getUniqueModuleId` guarantees to
return a non-empty string, and `GetOrCreateFunctionComdat` guarantees to return

For interposable functions, we could keep using `!associated`, but
LTO can change the linkage to `internal` and allow such functions to be inlinable,
so we have to drop `!associated`, too. To not interfere with section
group resolution, we need to use the `noduplicates` variant (section group flag 0).
(This allows us to get rid of the ModuleID parameter.)
In -fno-pie and -fpie code (mostly dso_local), instrumented interposable
functions have WeakAny/LinkOnceAny linkages, which are rare. So the
section group header overload should be low.

This patch does not change the object file output for COFF (where `!associated` is ignored).

Reviewed By: morehouse, rnk, vitalybuka

Differential Revision:
The file was modifiedllvm/test/Instrumentation/SanitizerCoverage/trace-pc-guard.ll (diff)
The file was modifiedllvm/lib/Transforms/IPO/SampleProfileProbe.cpp (diff)
The file was addedllvm/test/Instrumentation/SanitizerCoverage/interposable-symbol.ll
The file was modifiedllvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp (diff)
The file was removedllvm/test/Instrumentation/SanitizerCoverage/interposable-symbol-nocomdat.ll
The file was modifiedllvm/include/llvm/Transforms/Instrumentation.h (diff)
The file was modifiedllvm/test/Instrumentation/SanitizerCoverage/inline-bool-flag.ll (diff)
The file was modifiedllvm/lib/Transforms/Instrumentation/Instrumentation.cpp (diff)
Commit 169318088406510ce6816e6b022502a532b86d4b by Adrian Prantl
Add a nullptr check.

This doesn't actually reproduce with a dbg.declare(i8* null, ...)
which produces a non-null null Value, but I have seen this show up in
crash logs. I'm suspecting that there may be another pass forcibly
setting the operand to a nullptr.
The file was modifiedllvm/test/Transforms/Coroutines/coro-debug.ll (diff)
The file was modifiedllvm/lib/Transforms/Coroutines/CoroFrame.cpp (diff)
Commit 5d64dd8e3c22e12e4f7b3d08ffe88fc41e727117 by Dan Liew
[Clang][ASan] Introduce `-fsanitize-address-destructor-kind=` driver & frontend option.

The new `-fsanitize-address-destructor-kind=` option allows control over how module
destructors are emitted by ASan.

The new option is consumed by both the driver and the frontend and is propagated into
codegen options by the frontend.

Both the legacy and new pass manager code have been updated to consume the new option
from the codegen options.

It would be nice if the new utility functions (`AsanDtorKindToString` and
`AsanDtorKindFromString`) could live in LLVM instead of Clang so they could be
consumed by other language frontends. Unfortunately that doesn't work because
the clang driver doesn't link against the LLVM instrumentation library.


Differential Revision:
The file was modifiedclang/include/clang/Driver/ (diff)
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp (diff)
The file was addedclang/test/Driver/fsanitize-address-destructor-kind.c
The file was modifiedclang/lib/Driver/SanitizerArgs.cpp (diff)
The file was modifiedclang/lib/Basic/Sanitizers.cpp (diff)
The file was modifiedclang/include/clang/Basic/Sanitizers.h (diff)
The file was modifiedclang/include/clang/Driver/SanitizerArgs.h (diff)
The file was modifiedclang/lib/CodeGen/BackendUtil.cpp (diff)
The file was modifiedclang/include/clang/Basic/CodeGenOptions.def (diff)
The file was modifiedclang/docs/ClangCommandLineReference.rst (diff)
The file was modifiedclang/include/clang/Basic/CodeGenOptions.h (diff)
The file was addedclang/test/CodeGen/asan-destructor-kind.cpp
Commit fdce098b49cb038996441741a7b2ab3652502aec by Dan Liew
[Clang][ASan] Teach Clang to not emit ASan module destructors when compiling with `-mkernel` or `-fapple-kext`.


Differential Revision:
The file was addedclang/test/Driver/darwin-asan-mkernel-kext.c
The file was modifiedclang/lib/Driver/SanitizerArgs.cpp (diff)
Commit ec4408ad692b20a01cca8b5d86f359f6f16bae87 by Akira
[CodeGen] Call ConvertTypeForMem instead of ConvertType

This fixes a crash that occurs when the type passed to the method is

The file was modifiedclang/lib/CodeGen/CGNonTrivialStruct.cpp (diff)
The file was modifiedclang/test/CodeGenObjC/strong-in-c-struct.m (diff)
Commit 2c56776a319edf33505ca6c7f9be59657cdaf52b by kostyak
[scudo][standalone] Compact pointers for Caches/Batches

This CL introduces configuration options to allow pointers to be
compacted in the thread-specific caches and transfer batches. This
offers the possibility to have them use 32-bit of space instead of
64-bit for the 64-bit Primary, thus cutting the size of the caches
and batches by nearly half (and as such the memory used in size
class 0). The cost is an additional read from the region information
in the fast path.

This is not a new idea, as it's being used in the sanitizer_common
64-bit primary. The difference here is that it is configurable via
the allocator config, with the possibility of not compacting at all.

This CL enables compacting pointers in the Android and Fuchsia default

Differential Revision:
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/release_test.cpp (diff)
The file was modifiedcompiler-rt/lib/scudo/standalone/primary32.h (diff)
The file was modifiedcompiler-rt/lib/scudo/standalone/local_cache.h (diff)
The file was modifiedcompiler-rt/lib/scudo/standalone/primary64.h (diff)
The file was modifiedcompiler-rt/lib/scudo/standalone/release.h (diff)
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/combined_test.cpp (diff)
The file was modifiedcompiler-rt/lib/scudo/standalone/allocator_config.h (diff)
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/primary_test.cpp (diff)
The file was modifiedcompiler-rt/lib/scudo/standalone/size_class_map.h (diff)