[clang] Reject enum element types in ext_vector_type (#228863)
`BuildExtVectorType` checks element types with `isIntegerType()`, which
also accepts complete unscoped enums. However,
`ASTContext::getExtVectorType` does not support enum elements.
For example:
```c
typedef enum { A } E;
typedef E V __attribute__((ext_vector_type(4)));
```
Before this change, compiling with `-fsyntax-only` in an
assertion-enabled build crashes in `ASTContext::getExtVectorType`:
```text
clang: clang/lib/AST/ASTContext.cpp:4839:
QualType clang::ASTContext::getExtVectorType(QualType, unsigned int) const:
[11 lines not shown]
[alpha.webkit.NoDeleteChecker] Blame the code that is actually unsafe (#224728)
The checker reported the whole top-level statement containing the
problem, because VisitChildren was the only place that recorded an
offending statement and IsFunctionTrivial clears the recorder before
descending into a callee. For
offset = std::min<unsigned>(9, offset +
localHeadingOffset(*htmlAncestor));
that put the caret on the entire assignment, which reads as an
accusation against std::min even though std::min is trivial and the real
problem is an opaque function three levels down inside the second
argument.
Record the offending statement in a Visit() wrapper instead. Recursion
unwinds innermost-first, so the deepest failing node wins and the caret
lands on 'localHeadingOffset(*htmlAncestor)'. Nodes without a source
location are skipped in favour of the nearest enclosing node that was
[15 lines not shown]
[FastISel] Ignore debug uses when folding a load (#228719)
DBG_VALUE was counted as a use of the loaded value, so the load was
folded only without -g. Once the load is folded, its vreg is never
defined, so mark its debug values undef.
Fixes #228711
Assisted-by: Claude Opus 5.5
clang: Fix nostdlib.c test with CLANG_USE_XCSELECT (#229418)
With CLANG_USE_XCSELECT, the driver injects the host macOS SDK as the
sysroot for the i386-apple-darwin run line. The SDK does not support i386, so
-Wincompatible-sysroot fires. Pass --no-xcselect, as other darwin driver
tests do.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Add middleware support for LIO ALUA HA
Wire up the middleware side of LIO ALUA high-availability: load
lio_ha.ko with per-node addresses on service start, manage ALUA
state across failover events, clean up STANDBY configfs on pool
export, and add pre-flight validation that targets have static
initiator ACLs before ALUA can be enabled.
For each target, create a portal-less phantom TPG carrying the peer
node's controller group so that a single RTPG response from any
connected port lists both ALUA groups. Write tpgt_N/rtpi explicitly
before enable so that relative target port IDs in RTPG match the
tag formula (portal.tag on Node A, portal.tag + 32000 on Node B)
rather than being auto-assigned sequentially by the kernel.
ALUA group states are driven by role and ha_state:
MASTER + synced local=OPTIMIZED remote=NONOPTIMIZED
MASTER + connected local=OPTIMIZED remote=TRANSITIONING
[4 lines not shown]
stand: userboot: improve userdisk error handling
Currently, userdisk_init() iterates through disks and
checks whether DIOCGSECTORSIZE and DIOCGMEDIASIZE ioctls
are available for the device. If either ioctl fails, userdisk_init()
returns ENXIO with ud_info only partially initialized.
devinit() records the failure, but loader_main() ignores
devinit()'s return value, so later code may access an
uninitialized entry.
In certain cases this code can still boot from a disk even if
userdisk_init() returns ENXIO, for example, when the first of
two disks is valid and the second errors out.
To address this issue while not breaking the current behavior, do
the following:
- Zero-initialize the userdisk_info array and use a zero media size
to mark disks that do not support the ioctls mentioned above or
[14 lines not shown]
[Flang][#212316] Fix -Wunused-template errors under -Werror (#218985)
Some function templates with internal linkage are never instantiated in
their translation unit, which triggers -Wunused-template. When the
warning (-Wunused-template) and warning as error (-Werror, e.g.
-DFLANG_ENABLE_WERROR=ON) are enabled, these become fatal errors.
Fix each case with the minimal change that preserves semantics, and
remove unused templates:
- Drop 'static' (give external linkage) for free function templates at
namespace/file scope: DirectivesCommon.h, PFTBuilder.h, RTBuilder.h,
fold-reduction.h.
- Add [[maybe_unused]] where dropping 'static' would change linkage/ODR
semantics (member, anonymous-namespace, or global generic-named
templates): check-cuda.cpp, tools.cpp.
- Remove unused templates: formatting.cpp, CUFAllocationConversion.cpp,
resolve-directives.cpp, ConvertType.cpp, IO.cpp, openmp-utils.cpp.
Behavior is unchanged, while selected template linkage is intentionally
[7 lines not shown]
Count empty iterator ranges and keep induction types
Translation converted iterator bounds to i64 and mapped the rebuilt i64
induction value onto the region argument. An i32 induction value forwarded
to a block argument therefore produced an ill-typed PHI, and a single-block
region stored an i64 into an i32 slot. The count (ub - lb) / step + 1 also
gave dynamic empty ranges such as 3:2:2 one entry, so the locator was
evaluated.
Count each range with the canonical trip-count helper on operands widened
by one bit, so empty ranges in either direction count as zero. Keep bounds
in their declared type and rebuild the induction value in that type. The
verifier now requires one region argument per range, typed like its
bounds, which translation relies on.
[CIR][CodeGen][NFC] Retire the CodeGenUtils.h catch-all header
Moves the last helpers out of `CodeGenUtils.h` into `ClassUtils.h`,
`ModuleUtils.h`, `TargetUtils.h` and `FunctionUtils.h` (`checkTargetFeatures`,
since it came from CodeGenFunction.cpp) and deletes the header. Only moves code
already on main, so it can be dropped on its own.
Assisted-by: Claude Code (Claude Fable 5.1).
[CIR][CodeGen][NFC] Share the bit-field and vbase layout ABI predicates
Deduplicates `isDiscreteBitFieldABI` and `isOverlappingVBaseABI` between CIR and
classic CodeGen into `RecordLayoutUtils.h`, as free functions taking the
`ASTContext`.
Assisted-by: Claude Code (Claude Fable 5.1).
[CIR][CodeGen][NFC] Share hasOwnStorage
Deduplicates `hasOwnStorage` between CIR and classic CodeGen into
`RecordLayoutUtils.h`.
Assisted-by: Claude Code (Claude Fable 5.1).
[CIR][CodeGen][NFC] Share hasOwnStorage
Deduplicates `hasOwnStorage` between CIR and classic CodeGen into
`RecordLayoutUtils.h`.
Assisted-by: Claude Code (Claude Fable 5.1).
[CIR][CodeGen][NFC] Share requiresAMDGPUProtectedVisibility
Deduplicates `requiresAMDGPUProtectedVisibility` between CIR and classic CodeGen
into `TargetUtils.h`. The shared version takes a bool for "currently hidden" in
place of the `llvm::GlobalValue` and `cir::VisibilityKind` the two callers
passed.
Assisted-by: Claude Code (Claude Fable 5.1).
[CIR][CodeGen][NFC] Share the Itanium __vmi_class_type_info flags computation
Deduplicates the `__vmi_class_type_info` and `__base_class_type_info` flags and
`computeVMIClassTypeInfoFlags` between CIR and classic CodeGen into
`ItaniumCXXABIUtils.h`.
Assisted-by: Claude Code (Claude Fable 5.1).
[CIR][CodeGen][NFC] Share the bit-field and vbase layout ABI predicates
Deduplicates `isDiscreteBitFieldABI` and `isOverlappingVBaseABI` between CIR and
classic CodeGen into `RecordLayoutUtils.h`, as free functions taking the
`ASTContext`.
Assisted-by: Claude Code (Claude Fable 5.1).