Revert "[clang][bytecode] Use in `Expr::tryEvaluateObjectSize` (#1790… (#179099)
…33)"
This reverts commit 756c321c33af2be0bd40707948aae3c06163a0a6.
Test failure in clang/test/AST/ByteCode/builtins.c in CI build
CC @tbaederr
[clang][bytecode] Use in `Expr::tryEvaluateObjectSize` (#179033)
Fixes #138474
Use new bytecode intepreter in `Expr::tryEvaluateObjectSize`. Reuses the
already existing implementation for `__builtin_object_size` in of the
intepreter.
---------
Co-authored-by: Timm Baeder <tbaeder at redhat.com>
[libc][test] Fix TmMatcher and correct tm_yday/tm_wday test values (#179029)
The TmMatcher was using || instead of && to compare tm struct fields,
causing it to match if ANY field was equal rather than ALL fields. This
masked incorrect expected values in the time tests.
Happily, only the tests needed fixing. The code was correct.
Fixed the matcher and corrected all tm_yday and tm_wday values to match
glibc's gmtime_r output.
[lldb] [Process/FreeBSDKernel] Select paniced thread automatically (#178069)
Kernel panic is a special case, and there is no signal or exception for
that so we need to rely on special workaround called `dumptid`.
FreeBSDKernel plugin is supposed to find this thread and set it manually
through `SetStopInfo()` in `CalculateStopInfo()` like Mach core plugin
does.
Before (We had to find and select crashed thread list otherwise thread 1
was selected by default):
```
➜ sudo lldb /boot/panic/kernel -c /var/crash/vmcore.last
(lldb) target create "/boot/panic/kernel" --core "/var/crash/vmcore.last"
Core file '/var/crash/vmcore.last' (x86_64) was loaded.
(lldb) bt
* thread #1, name = '(pid 12991) dtrace'
* frame #0: 0xffffffff80bf9322 kernel`sched_switch(td=0xfffff8015882f780, flags=259) at sched_ule.c:2448:26
frame #1: 0xffffffff80bd38d2 kernel`mi_switch(flags=259) at kern_synch.c:530:2
frame #2: 0xffffffff80c29799 kernel`sleepq_switch(wchan=0xfffff8014edff300, pri=0) at subr_sleepqueue.c:608:2
[38 lines not shown]
[flang] Assign sizes & offsets before instantiating some component types (#178927)
Semantics is instantiating derived types too soon is some cases, leading
to incorrect sizes and component offsets in cases of valid forward
references to derived types -- these appear in the declarations of
allocatable and pointer components. The incorrect size led to a runtime
crash in the linked bug report after an insufficient allocation.
Since those components are indirect, their sizes in the derived type
instantiation can be known without having to recursive instantiate the
components' types. Then, after laying out the derived type
instantiation, the compiler can then ensure that the components' types
are instantiated.
Fixes https://github.com/llvm/llvm-project/issues/178786.
[flang] Fix proc ptr default initializers in structure constructors (#178897)
The default initializers for procedure pointer components are not being
used for unspecified components in structure constructors.
Fixes https://github.com/llvm/llvm-project/issues/178813.
[flang][CUDA] Allow constant to match device actual in specific procedure (#178658)
When scanning the specific procedures of a generic interface for a match
for a set of actual arguments, accept a constant actual argument as a
match for a dummy argument with the DEVICE attribute.
[flang] Fix exposed "free" instances of ac-implied-do indices (#178516)
Tweak the implementations of IsConstantExpr, IsInitialDataTarget, and
related utilities so that "free" instances of array constructor implied
DO indices are not treated as constant expressions when the surrounding
context (if any) doesn't contain their bounds. This fixes a current bug
in which a "free" implied DO index in a structure constructor got
wrapped up an a Constant<SomeDerived>, which led to a crash in lowering.
[ELF] Fix IRELATIVE addend if the resolver address is updated by linker relaxation (#179063)
For a non-preemptible ifunc, `handleNonPreemptibleIfunc` creates a
cloned
symbol (`directSym`) to compute the addend of the IRELATIVE dynamic
relocation.
This cloned symbol wasn't tracked by `initSymbolAnchors`, so its value
wasn't adjusted during RISC-V/LoongArch linker relaxation.
This caused IRELATIVE addends to point to pre-relaxation addresses.
Fix this by:
- Tracking cloned IRELATIVE symbols in `ctx.irelativeSyms`
- Adding these symbols to `relaxAux->anchors` in `initSymbolAnchors`
[VPlan] Split up attachCheckBlock in distinct helpers for re-use (NFC).
Split up attachCheckBlock into its distinct operations:
* inserting the check block in the CFG + updating phis, and
* adding the branch VPInstruction.
Those helpers can be re-used in follow-up changes.
[VPlan] Detect and create partial reductions in VPlan. (NFCI) (#167851)
As a first step, move the existing partial reduction detection logic to
VPlan, trying to preserve the existing code structure & behavior as
closely as possible.
With this, partial reductions are detected and created together in a
single step.
This allows forming partial reductions and bundling them up if
profitable together in a follow-up.
PR: https://github.com/llvm/llvm-project/pull/167851
[clang-tidy] Add new check readability-trailing-comma (#173669)
clang-format has a couple of similar options:
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#enumtrailingcomma
- add trailing commas for enum
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#inserttrailingcommas
- add trailing commas for C++
but generally they are marked with such warning:
> Warning
>
> Setting this option to any value other than Leave could lead to
incorrect code formatting due to clang-format’s lack of complete
semantic information. As such, extra care should be taken to review code
changes made by this option.
clang-tidy on the other hand has all semantic information, thus can
[5 lines not shown]