[clang][modules] Add `-fmodules-ignore-search-path=<path>` (#217061)
This introduces the search-path counterpart to
`-fmodules-ignore-macro=<macro>`. The named header search `<path>` is
dropped from the context hash of every module and physically removed
from every module-build invocation, and kept only for the translation
unit itself.
The motivating case is a build system that hands every compile a
per-target header search directory (e.g. Xcode's `DerivedSources`) even
though no modules include anything from it. Under
`-fmodules-strict-context-hash` those directories feed every module's
context hash, so an SDK module like Foundation is rebuilt once per
target rather than just once. Ignoring the directories for modules lets
those builds share a single module cache while the TUs that really do
need them keep working.
This only works right when no module needs the path: a lookup that would
have resolved through an ignored path simply fails, exactly as ignoring
[6 lines not shown]
[clang][modules] Cache failures for explicit modules (#215968)
Explicit module files are a (binary) input to the compilation. Just like
any other input file they are expected to not change during compilation.
There's no reason to disable failure caching in the `FileManager` for
them.
[clang][modules] Cache failed stats of additional module maps (#215964)
The additional module maps stored in PCMs are just regular input files
that are not expected to change during compilation. There's no reason to
disable failure caching in the `FileManager` for them.
[IR] Remove dead declarations (#217701)
handleChangedLocation: The corresponding function definition was
removed on January 16, 2024 in commit
d499df02a2508641d67918d7dc41b2e01a4a4114.
noRenameOnPromotion: Added on February 28, 2026 in commit
3e05ab6322cbf2a96362dcacb5907ba519fe552d without a corresponding
function definition.
[flang][OpenMP] Switch SOURCE/SINK to use modifier infrastructure (#217644)
They are instances of the dependence-type modifier in the spec. Putting
them into the modifier infrastructure in the compiler will remove the
need for them to be validated by hand in the future.
[llvm] Propagate dso_local for jump table aliases (#217101)
LowerTypeTests should propagate dso_local if the original function it
would generate an alias for was also dso_local. The benefit here is that
references to the alias can now use PCREL relocs which could prevent
some GOT-generating relocs. Note this is independent of the visibility
and linkage so the types of symbols this would benefit are external
non-hidden dso_local functions.
Gemini was used to help generate tests. I reviewed this to the best of
my ability before posting a PR.
[AMDGPU] Do not propagate ninf/nsz from sqrt when forming rsq (#217599)
These flags only apply to the sqrt, not the quotient
1.0/sqrt(+0.0) is a valid +inf if the fdiv has no ninf, so copying them
makes it poison
[clang-format][docs] Fix grammar in AllowShortFunctionsOnASingleLine (#217625)
## Summary
The `InlineOnly` description said "does not implies `empty`". Change to
"does not imply".
Updated both `Format.h` (source of the style option docs) and
`ClangFormatStyleOptions.md`.
Fixes #195326
Assisted-by: Grok (xAI)
clang/AMDGPU: Use feature bitset for xnack/sramecc queries (#217704)
Complete the conversion of clang from the manual ArchAttr field
to the generated feature bitset.
Co-authored-by: Claude (Claude-Opus-4.8)
[lldb] Only report a symbol server error when the download failed (#217669)
Every symbol locator plugin writes into the same Status, and a plugin
that delivers a symbol file is under no obligation to clear what an
earlier step recorded there, so a search that ended in a download could
still report an error at the user. That contradicts what symbol_error
promises its readers, which is an explanation for a search that came up
short.
Take the download's own answer as the authority on whether anything was
delivered, and consult the Status only when nothing was.
Reported by Coverity (CID 1685292).
Assisted-by: Claude
[NFC][BoundsSafety] Give `counted_by_or_null`, `sized_by`, and `sized_by_or_null` their own documentation (#212877)
Previously the `counted_by`, `counted_by_or_null`, `sized_by`, and
`sized_by_or_null` attributes all pointed at a single `Documentation`
object (`CountedByDocs`). The generated `AttributeReference.rst`
therefore folded all four into one entry whose text described only
`counted_by` used on a C99 flexible array member.
This was misleading because the attributes differ in important ways that
went undocumented:
* `counted_by` counts *elements* whereas `sized_by` counts *bytes*.
* `counted_by` and `sized_by` require a null pointer to have a zero
count/size, while the `_or_null` variants allow a null pointer
regardless of the count or size.
* `counted_by` may be applied to a flexible array member, but
`sized_by`, `counted_by_or_null`, and `sized_by_or_null` apply to
pointers only.
[34 lines not shown]
[NFCI][OpenMP][OMPT] Move `for_static_init` work callbacks into macro (#217259)
`__kmp_for_static_init` uses a very similar pattern for dispatching the
work callback to an attached tool throughout the function. Hence, avoid
the duplication by moving the pattern into a macro, taking the number of
loop iterations as an argument. Without OMPT, this macro is a no-op.
Signed-off-by: Jan André Reuter <jan at zyten.de>
[BOLT] Fix code section ordering comparator (#216725)
## Summary
`RewriteInstance::getCodeSections()` used a comparator that violated
strict weak ordering:
- Distinct special sections with the same name could each compare less
than the other.
- Different cold sections could each be equivalent to an `Other` section
while remaining ordered relative to one another.
This replaces that comparator with `CodeSectionOrder`, which assigns
explicit ranks to section kinds and orders cold-section suffixes
deterministically.
## Main-branch reproduction
[49 lines not shown]
[Flang][OpenMP] Stop emitting implicit mappers for allocatable derived types (and arrays of them) unconditionally (#216184)
We should not be emitting these implicit mappers at the top level if the
contents of the derived type do not require mapping of allocatables. If
we do this, we negatively impact performance with unneccessary maps, in
certain cases (array of structs) this can be quite significant.
[Clang][Sema] Fix crash on default argument added after a parameter pack (#217386)
Fixes #216211
The DR1344 check that runs next locates "the
first defaulted parameter" as `getParamDecl(getMinRequiredArguments())`,
which is wrong when a parameter pack comes first: the pack is skipped by
the count but still occupies a slot. The lookup lands on the pack and
`assert(NewParam->hasDefaultArg())` fails. Without assertions, the
"makes this constructor a default constructor" error is emitted pointing
at the wrong parameter.
The DR1344 check now scans for the first parameter that actually has a
default argument, so the assertion holds and the diagnostic points at
the right parameter.
LLM tools were used for this contribution.
[VPlan] Sink single-scalar VPI to replicate regions (#208906)
The newly-introduced scalar-casts are sunk. The patch also generalizes
the existing special cases correctly using
vputils::doesGeneratePerAllLanes.
[clang][lex] Fix repeated `#import` of a header missing from umbrella (#217691)
The PR https://github.com/llvm/llvm-project/pull/216704 fixed repeated
`#import` of a header that belongs to a module in textual builds. One
omission was not setting the boolean we now use to make the decision to
import or skip when we tried importing a submodule but figured out it's
not covered by the umbrella. This PR fixes that.
rdar://185417139