Changes

Summary

  1. [analyzer] Ignore single element arrays in getStaticSize() conditionally (details)
  2. [analyzer] SValBuilder should have an easy access to AnalyzerOptions (details)
  3. [clang][AST] Add support for SubstTemplateTypeParmPackType to ASTImporter (details)
  4. [compiler-rt] NFC: Fix trivial typo (details)
  5. [NFC] Added testcase for PR48641 (details)
  6. [NFC] Added testcase for PR39116 (details)
  7. [WebAssembly] Support opaque pointers in AddMissingPrototypes (details)
  8. [libc++][format] Implement formatters. (details)
  9. [gn build] Port d7444d9f41e3 (details)
  10. [libc++][format] Add a CMake Unicode option. (details)
  11. [Sanitizers][PGO] missing return statement (details)
  12. [X86][Atom] Add missing UOps override to AtomWriteResPair multiclass (details)
  13. [X86][Atom] MUL/DIV instructions require both ports, not either. (details)
Commit 91c07eb8ee6ea2d48158dce123bac7b7c30eb294 by balazs.benics
[analyzer] Ignore single element arrays in getStaticSize() conditionally

Quoting https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html:
> In the absence of the zero-length array extension, in ISO C90 the contents
> array in the example above would typically be declared to have a single
> element.

We should not assume that the size of the //flexible array member// field has
a single element, because in some cases they use it as a fallback for not
having the //zero-length array// language extension.
In this case, the analyzer should return `Unknown` as the extent of the field
instead.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D108230
The file was modifiedclang/test/Analysis/analyzer-config.c
The file was modifiedclang/test/Analysis/flexible-array-members.c
The file was modifiedclang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.def
The file was modifiedclang/lib/StaticAnalyzer/Core/MemRegion.cpp
Commit b97a96400a3f9ec33b80d0726111aae1c7b24513 by balazs.benics
[analyzer] SValBuilder should have an easy access to AnalyzerOptions

`SVB.getStateManager().getOwningEngine().getAnalysisManager().getAnalyzerOptions()`
is quite a mouthful and might involve a few pointer indirections to get
such a simple thing like an analyzer option.

This patch introduces an `AnalyzerOptions` reference to the `SValBuilder`
abstract class, while refactors a few cases to use this /simpler/ accessor.

Reviewed By: martong, Szelethus

Differential Revision: https://reviews.llvm.org/D108824
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h
The file was modifiedclang/lib/StaticAnalyzer/Core/MemRegion.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/SValBuilder.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
Commit d6ca91ea42455453d08a7922e96fa6685827028d by balazs.benics
[clang][AST] Add support for SubstTemplateTypeParmPackType to ASTImporter

Thank you @martong for acquiring a suitable test case!

Reviewed By: shafik, martong

Differential Revision: https://reviews.llvm.org/D109237
The file was modifiedclang/unittests/AST/ASTImporterTest.cpp
The file was modifiedclang/lib/AST/ASTImporter.cpp
Commit a1e7e401d2af002af26e1512a31e09eb2d0cf1dc by shivam98.tkg
[compiler-rt] NFC: Fix trivial typo

Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D77457
The file was modifiedcompiler-rt/test/BlocksRuntime/recursiveassign.c
The file was modifiedcompiler-rt/test/builtins/Unit/enable_execute_stack_test.c
The file was modifiedcompiler-rt/lib/profile/InstrProfilingInternal.h
The file was modifiedcompiler-rt/lib/asan/asan_interceptors.cpp
The file was modifiedcompiler-rt/test/asan/TestCases/Linux/malloc_delete_mismatch.cpp
The file was modifiedcompiler-rt/lib/msan/msan_interface_internal.h
The file was modifiedcompiler-rt/lib/scudo/CMakeLists.txt
The file was modifiedcompiler-rt/lib/builtins/fixunsxfsi.c
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
The file was modifiedcompiler-rt/lib/dfsan/done_abilist.txt
The file was modifiedcompiler-rt/test/tsan/custom_mutex0.cpp
The file was modifiedcompiler-rt/lib/xray/xray_basic_flags.h
The file was modifiedcompiler-rt/include/sanitizer/common_interface_defs.h
The file was modifiedcompiler-rt/lib/builtins/fixxfdi.c
The file was modifiedcompiler-rt/lib/interception/interception_win.cpp
The file was modifiedcompiler-rt/test/msan/param_tls_limit.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_clock.cpp
The file was modifiedcompiler-rt/lib/xray/xray_profiling.cpp
The file was modifiedcompiler-rt/lib/builtins/emutls.c
The file was modifiedcompiler-rt/lib/fuzzer/FuzzerMerge.cpp
The file was modifiedcompiler-rt/cmake/Modules/BuiltinTests.cmake
The file was modifiedcompiler-rt/lib/asan/asan_report.cpp
The file was modifiedcompiler-rt/test/asan/TestCases/initialization-bug.cpp
The file was modifiedcompiler-rt/utils/generate_netbsd_syscalls.awk
The file was modifiedcompiler-rt/cmake/config-ix.cmake
The file was modifiedcompiler-rt/lib/msan/msan.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_clock.h
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp
The file was modifiedcompiler-rt/lib/fuzzer/FuzzerDataFlowTrace.cpp
The file was modifiedcompiler-rt/lib/profile/InstrProfilingValue.c
The file was modifiedcompiler-rt/lib/xray/xray_flags.h
The file was modifiedcompiler-rt/lib/builtins/README.txt
The file was modifiedcompiler-rt/lib/asan/tests/asan_interface_test.cpp
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp
The file was modifiedcompiler-rt/lib/profile/InstrProfiling.h
The file was modifiedcompiler-rt/test/sanitizer_common/TestCases/Linux/new_delete_test.cpp
The file was modifiedcompiler-rt/lib/fuzzer/CMakeLists.txt
The file was modifiedcompiler-rt/lib/xray/xray_interface.cpp
The file was modifiedcompiler-rt/test/fuzzer/CustomMutatorTest.cpp
The file was modifiedcompiler-rt/lib/builtins/arm/truncdfsf2vfp.S
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_symbolizer_internal.h
The file was modifiedcompiler-rt/test/sanitizer_common/CMakeLists.txt
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp
The file was modifiedcompiler-rt/lib/fuzzer/FuzzerTracePC.cpp
The file was modifiedcompiler-rt/lib/fuzzer/FuzzerFork.cpp
The file was modifiedcompiler-rt/test/asan/TestCases/Windows/interface_symbols_windows.cpp
The file was modifiedcompiler-rt/test/lit.common.cfg.py
The file was modifiedcompiler-rt/include/sanitizer/asan_interface.h
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_local_address_space_view.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.cpp
The file was modifiedcompiler-rt/test/fuzzer/CustomCrossOverTest.cpp
The file was modifiedcompiler-rt/test/asan/TestCases/contiguous_container.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_mips.h
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
The file was modifiedcompiler-rt/lib/builtins/fixunsxfdi.c
The file was modifiedcompiler-rt/test/builtins/Unit/clear_cache_test.c
The file was modifiedcompiler-rt/test/builtins/Unit/fp_test.h
The file was modifiedcompiler-rt/lib/msan/msan_interceptors.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_stacktrace_sparc.cpp
The file was modifiedcompiler-rt/test/tsan/fd_dup_norace2.cpp
The file was modifiedcompiler-rt/lib/profile/InstrProfilingWriter.c
The file was modifiedcompiler-rt/lib/xray/tests/unit/function_call_trie_test.cpp
The file was modifiedcompiler-rt/test/fuzzer/merge.test
The file was modifiedcompiler-rt/utils/generate_netbsd_ioctls.awk
The file was modifiedcompiler-rt/lib/sanitizer_common/sancov_flags.inc
The file was modifiedcompiler-rt/test/asan/TestCases/Windows/dll_host.cpp
The file was modifiedcompiler-rt/test/tsan/deep_stack1.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_asm.h
The file was modifiedcompiler-rt/lib/xray/xray_buffer_queue.cpp
Commit 2aea581004d20dccd6aa8483704acec9a56e2345 by Dávid Bolvanský
[NFC] Added testcase for PR48641
The file was addedllvm/test/Transforms/SimplifyCFG/pr48641.ll
Commit 9e06c767a4b66f600f77626807688e4a213a3242 by Dávid Bolvanský
[NFC] Added testcase for PR39116
The file was addedllvm/test/Transforms/PhaseOrdering/pr39116.ll
Commit 66a54af96766ab635bc1a9fdaf2d568e3c46eb11 by nikita.ppv
[WebAssembly] Support opaque pointers in AddMissingPrototypes

The change here is basically the same as in D108880: Rather than
looking at bitcasts, look at calls and their function type. We
still need to look through bitcasts to find those calls.

The change in llvm/test/CodeGen/WebAssembly/add-prototypes-conflict.ll
is due to different visitation order. add-prototypes-opaque-ptrs.ll
is a copy of add-prototypes.ll with -force-opaque-pointers.

Differential Revision: https://reviews.llvm.org/D109256
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyAddMissingPrototypes.cpp
The file was addedllvm/test/CodeGen/WebAssembly/add-prototypes-opaque-ptrs.ll
The file was modifiedllvm/test/CodeGen/WebAssembly/add-prototypes-conflict.ll
Commit d7444d9f41e34886d7d316659090ba6bf4d61cba by koraq
[libc++][format] Implement formatters.

This implements the initial version of the `std::formatter` class and its specializations. It also implements the following formatting functions:
- `format`
- `vformat`
- `format_to`
- `vformat_to`
- `format_to_n`
- `formatted_size`

All functions have a `char` and `wchar_t` version. Parsing the format-spec and
using the parsed format-spec hasn't been implemented. The code isn't optimized,
neither for speed, nor for size.

The goal is to have the rudimentary basics working, which can be used as a
basis to improve upon. The formatters used in this commit are simple stubs that
will be replaced by real formatters in later commits.

The formatters that are slated to be replaced in this patch series don't have
an availability macro to avoid merge conflicts.

Note the formatter for `bool` uses `0` and `1` instead of "false" and
"true". This will be fixed when the stub is replaced with a real
formatter.

Implements parts of:
- P0645 Text Formatting

Completes:
- LWG3539 format_to must not copy models of output_iterator<const charT&>

Reviewed By: ldionne, #libc, vitaut

Differential Revision: https://reviews.llvm.org/D96664
The file was addedlibcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.signed_integral.pass.cpp
The file was addedlibcxx/include/__format/format_string.h
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/format/format_string.module.verify.cpp
The file was addedlibcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.unsigned_integral.pass.cpp
The file was removedlibcxx/test/std/utilities/format/format.arguments/format.args/get.pass.cpp
The file was addedlibcxx/test/libcxx/diagnostics/detail.headers/format/formatter.module.verify.cpp
The file was addedlibcxx/test/libcxx/utilities/format/format.arguments/format.args/get.pass.cpp
The file was modifiedlibcxx/test/std/utilities/format/format.arguments/format.arg/operator_bool.pass.cpp
The file was addedlibcxx/test/libcxx/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.floating_point.pass.cpp
The file was modifiedlibcxx/docs/ReleaseNotes.rst
The file was addedlibcxx/test/std/utilities/format/format.functions/formatted_size.locale.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.functions/format_to.locale.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.functions/format_tests.h
The file was addedlibcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.bool.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.functions/vformat_to.locale.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.functions/vformat_to.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.functions/vformat.locale.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.string.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.functions/format_to.pass.cpp
The file was addedlibcxx/include/__format/formatter.h
The file was modifiedlibcxx/include/module.modulemap
The file was addedlibcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.char.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.functions/format_to_n.locale.pass.cpp
The file was modifiedlibcxx/include/CMakeLists.txt
The file was addedlibcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.c_string.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.functions/format.pass.cpp
The file was removedlibcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.pass.cpp
The file was modifiedlibcxx/include/format
The file was addedlibcxx/test/std/utilities/format/format.functions/vformat.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.const_char_array.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.functions/format_to_n.pass.cpp
The file was addedlibcxx/test/std/utilities/format/format.functions/format.locale.pass.cpp
Commit a1ea479f0aa22360d2b02b12de9c85d6320fec23 by llvmgnsyncbot
[gn build] Port d7444d9f41e3
The file was modifiedllvm/utils/gn/secondary/libcxx/include/BUILD.gn
Commit df2af9936ca096d5bfbf3395c661c2d5a354f673 by koraq
[libc++][format] Add a CMake Unicode option.

This option is used to select between the format headers output column
width option. This option should be independent of the locale setting.
It's encouraged to default to Unicode unless the platform doesn't offer
that option.

[format.string.std]/10
```
  For the purposes of width computation, a string is assumed to be in a
  locale-independent, implementation-defined encoding. Implementations
  should use a Unicode encoding on platforms capable of displaying Unicode
```

Reviewed By: #libc, ldionne, vitaut

Differential Revision: https://reviews.llvm.org/D103379
The file was modifiedlibcxx/utils/ci/run-buildbot
The file was addedlibcxx/cmake/caches/Generic-no-unicode.cmake
The file was modifiedlibcxx/utils/libcxx/test/features.py
The file was modifiedlibcxx/utils/ci/buildkite-pipeline.yml
The file was modifiedlibcxx/CMakeLists.txt
The file was modifiedlibcxx/docs/ReleaseNotes.rst
Commit 08c3cdb8b8423c6bab14670bca5fd6b19a1fdfce by David CARLIER
[Sanitizers][PGO] missing return statement
The file was modifiedcompiler-rt/lib/profile/InstrProfilingUtil.c
Commit 0d0f39b0f3ee3b7d41a6caca6896a90d1a316437 by llvm-dev
[X86][Atom] Add missing UOps override to AtomWriteResPair multiclass

Make it easier to describe microcoded instructions.
The file was modifiedllvm/lib/Target/X86/X86ScheduleAtom.td
Commit 7d062d2c478b713ba7ac31729259d747fdd7d0b3 by llvm-dev
[X86][Atom] MUL/DIV instructions require both ports, not either.

Noticed while trying to improve multiplication costs for vectorization via the D103695 helper script. Confirmed with Intel AoM.
The file was modifiedllvm/lib/Target/X86/X86ScheduleAtom.td
The file was modifiedllvm/test/tools/llvm-mca/X86/Atom/resources-x86_64.s