[flang][semantic] parser node types and rewrite for explicit-shape-bounds-spec (#188447)
This commit lays the groundwork for semantic analysis of rank-1 integer array expressions being used as bounds in a declaration with explicit bounds.
Enumeration Type Lowering: FIR code generation (PR 9)
Maps enumeration types to i32 at the FIR level. Intercepts enumeration
DerivedTypeSpec in ConvertType to produce IntegerType, lowers
enumeration constructors/constants, and generates NEXT/PREVIOUS/HUGE
intrinsic lowering with STAT boundary handling and error termination.
Files from original PR 9 plus PR 7/8 lowering additions (PREVIOUS,
STAT, void-cast fixes).
Enumeration Type Sem-3: Intrinsics + I/O + Module Files (PRs 6-8)
Adds enumeration type intrinsics (HUGE, NEXT, PREVIOUS, INT) with
constant folding, STAT argument support with boundary detection,
formatted I/O rejection for enumeration types, module file round-trip
support, and runtime STAT_ENUM_BOUNDARY error code.
Files from original PRs 6-8 (including PREVIOUS intrinsic from PR 7).
[APINotes] Early return when no apinotes files are loaded
When no APINotes readers are available, let's not spend time trying to
determine the current decl's context or do other redundant work.
Resolves https://github.com/llvm/llvm-project/issues/202214
[MLIR][LLVM] Preserve unknown function metadata on import
Import non-debug function metadata without a kind-specific dialect conversion into LLVMFuncOp function_metadata. Preserve repeated metadata kinds through the generic carrier so LLVM IR import and export can round-trip those attachments.
[MLIR][LLVM] Translate LLVMFuncOp function metadata
Materialize LLVMFuncOp function_metadata through ModuleTranslation metadata conversion. Attach function metadata after module-level symbols are mapped so metadata references to functions, globals, aliases, and ifuncs can be resolved.
[MLIR][LLVM] Add function metadata to LLVMFuncOp
Add a generic LLVM dialect carrier for LLVM IR function metadata on LLVMFuncOp.
Represent attachments as an ordered list so repeated metadata kinds, such as
multiple type metadata attachments, can be preserved while keeping metadata names
language-agnostic.
[ids-check] Update the workflow and script (#199710)
In compnerd/ids#58, support was added to parse a header file using a
given source file's flags. This solves many of the issues we had
encountered with the `ids-check-helper.py` script and its corresponding
workflow.
* Update ids to the current version, which includes the `--main-file`
changes.
* Use a more recent LLVM compiler to build a subset of LLVM.
* Build a subset of LLVM targets to properly parse more header files.
* Use the `--main-file` argument when invoking `idt`.
* Add explicit overrides and exclude header lists.
This was tested on every public header in LLVM and forthcoming PRs will
land the changes found with the updated script. Once all of the headers
have been updated, the workflow will be re-enabled. This effort is
tracked in #109483.
[MLIR][LLVM] Preserve global value metadata operands on import
Import global value references inside LLVM metadata operands as LLVM dialect metadata symbol-reference attributes. Add llvm.read_register import coverage for function, global, alias, and nameless-global metadata operands.
[AMDGPU] Fix wrong truth table in BitOp3_Op for shared sub-expressions. (#198556)
When the LHS and RHS of a boolean node share a common sub-expression,
LHS recursion can decompose that shared node via the "replace parent
operator" mechanism in getOperandBits (Src[I] = Op where Src[I] == In).
This replaces the Src slot that RHS was originally mapped to with a
sub-operand. If RHS recursion then fails to re-derive its own
decomposition, RHSBits still refers to the old slot index — but the slot
now holds a different value, producing an incorrect truth table.
Fix this by tracking which Src slot RHS occupies before LHS recursion.
If RHS recursion fails and that specific slot was modified, roll back
Src and the bit assignments to the pre-recursion state.
Add a test to show a specific example.
Assisted-by: Cursor (Claude)
[MLIR][LLVM] Share LLVM metadata attribute translation
Share LLVM dialect metadata materialization through ModuleTranslation so named
metadata and metadata-as-value lowering use one conversion path. Resolve metadata
symbol references to functions, globals, aliases, and ifuncs, and diagnose
malformed required metadata before lowering.
[IR] Remove unused and mark debug-only verifier templates (NFC) (#202975)
Two verifier templates trip `-Wunused-template`.
In `Verifier.cpp`, `isValidMetadataArray` is a leftover declaration with
no definition and no callers, so it's removed. In
`SafepointIRVerifier.cpp`, `PrintValueSet` is only used inside
`LLVM_DEBUG`, so it gets compiled out in release builds and never
instantiates; it's marked `[[maybe_unused]]`.
NFC.
Part of #202945.
[clang-tidy] Add newline style note to contributing guide. NFC. (#202999)
Recently I found around 10 checks that hardcode `\n` in their fix-its.
This is not ideal, the generated fix-it should probably preserve the
newline style of the file, rather than always inserting LF. Otherwise,
applying a fix-it may unexpectedly change part of a CRLF file to LF.
This commit documents this expectation in contributing guide.
[Clang] Rebind the closure temporary when rebuilding default member initializers
Fixes https://github.com/llvm/llvm-project/issues/196469
Since the CWG1815 implementation, `InitListChecker` rebuilds a default
member initializer at its point of use in aggregate initialization. The
rebuild uses the `EnsureImmediateInvocationInDefaultArgs` tree
transform, where `TransformCXXBindTemporaryExpr` strips
`CXXBindTemporaryExpr` nodes, relying on the subexpression's rebuild to
re-create the temporary binding: every `Rebuild*` path funnels through
`Sema::MaybeBindToTemporary`, which also re-registers the cleanup in
the current evaluation context.
However, the transform overrides `TransformLambdaExpr` to return the
closure unchanged (the body is not a subexpression), skipping the
`MaybeBindToTemporary` call that `BuildLambdaExpr` ends with. The
rebuilt initializer then lacks both the `CXXBindTemporaryExpr` around
the closure and the `ExprWithCleanups` marker, so CodeGen never emits
the closure's destructor and init-captured members leak.
[6 lines not shown]
[libc++] Remove _Lazy (#202303)
We don't actually need to evaluate anything as lazily as `_Lazy` does or
we can achieve the same amount of laziness in other ways, so we can get
rid of it. This was required previously in some places due to a Clang
bug, which has been resolved and implemented by all compilers we
support.
[SPIR-V] Fix result type deduction for sub-byte G_TRUNC (#202717)
G_TRUNC fell through to the default operand-based deduction, so a
sub-byte truncation inherited its wider source type and fed an ill-typed
value into i32 consumers
[FunctionAttrs] Remove unused legacy-PM runImpl template (NFC) (#202983)
`runImpl` here is a leftover from the legacy pass manager (it takes
`CallGraphSCC`), with no callers since the legacy PM was removed. It
never instantiates, so it trips `-Wunused-template`. Removing the dead
template.
NFC.
Part of #202945.
[GitHub] Move permissions check to separate job in test-suite.yml (#203002)
Copy what's done in libcxx-run-benchmarks.yml. Also checkout the llvm
repo beforehand.