Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0fd330d
[NFC][DirectX] Refactor `DXILPrepare`/`DXILTranslateMetadata` (#164285)
inbelic Oct 24, 2025
b6e6a4d
[msan] Convert target("aarch64.svcount") from compile-time crash to M…
thurstond Oct 24, 2025
e07aef9
[clang][Sema] close IsStandardConversion hole when adding cfi_uncheck…
brunodf-snps Oct 24, 2025
bd27abc
Revert "Reapply "[clang-format] Annotate ::operator and Foo::operator…
PiJoules Oct 24, 2025
8c29bce
[VPlan] Remove SCEVToExpansion mapping (NFC). (#164490)
fhahn Oct 24, 2025
825eefe
[flang][cuda] Accept scalar expression for bytes in kernel call (#165…
clementval Oct 24, 2025
fdcbf74
[Github][CI] Add default gha user for tooling containers (#164294)
vbvictor Oct 24, 2025
9b80fc3
[lldb] Add missing function call in test (NFC)
adrian-prantl Oct 24, 2025
4c52c45
[ADT] Rename variable names in IndexedMap (NFC) (#164925)
kazutakahirata Oct 24, 2025
30e7715
[ADT] Consolidate SparseSetValFunctor implementations (NFC) (#164926)
kazutakahirata Oct 24, 2025
8388a5b
[ADT] Rename identity_cxx20 to identity (#164927)
kazutakahirata Oct 24, 2025
b4d11c9
[clang] Proofread UsersManual.rst (#164928)
kazutakahirata Oct 24, 2025
7e76473
[DebugInfo] Add "override" where appropriate (NFC) (#164929)
kazutakahirata Oct 24, 2025
4448ff4
[CIR] Emit CIR builtins: coroAlloc, coroBegin, and coroSize (#164180)
Andres-Salamanca Oct 24, 2025
e68cf1e
[GitHub][CI] Remove 'Set Safe Directory' step (#165052)
vbvictor Oct 24, 2025
409c654
[CI] Update Windows premerge testing to use clang-cl.exe (#164900)
cmtice Oct 24, 2025
10a975b
[lldb] Introduce internal stop hooks (#164506)
yln Oct 25, 2025
3a59407
[CI] Make Postcommit Testing Pass In Correct Flags to Premerge Advisor
boomanaiden154 Oct 25, 2025
5fda2a5
[NFC][ADT] Add RadixTree (#164524)
vitalybuka Oct 25, 2025
8bb8301
merge main into amd-staging
z1-cciauto Oct 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .ci/monolithic-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ runtimes_targets="${4}"
start-group "CMake"
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt

export CC=cl
export CXX=cl
export CC=C:/clang/clang-msvc/bin/clang-cl.exe
export CXX=C:/clang/clang-msvc/bin/clang-cl.exe
export LD=link

# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
Expand All @@ -49,6 +49,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
-D CMAKE_CXX_FLAGS="-Wno-c++98-compat -Wno-c++14-compat -Wno-unsafe-buffer-usage -Wno-old-style-cast" \
-D LLVM_ENABLE_RUNTIMES="${runtimes}"

start-group "ninja"
Expand Down
10 changes: 7 additions & 3 deletions .ci/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ function at-exit {
fi

if [[ "$retcode" != "0" ]]; then
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
$(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
if [[ "$GITHUB_ACTIONS" != "" ]]; then
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_explain.py \
$(git rev-parse HEAD~1) "${BUILD_DIR}"/test-results.*.xml \
"${MONOREPO_ROOT}"/ninja*.log
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
$(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
else
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
$(git rev-parse HEAD) $BUILDBOT_BUILDNUMBER \
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
fi
fi
}
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/containers/github-action-ci-tooling/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ RUN apt-get update && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Create a new user with id 1001 as that is the user id that
# Github Actions uses to perform the checkout action.
RUN useradd gha -u 1001 -m -s /bin/bash
RUN adduser gha sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Don't set USER gha right away because we still need to install packages
# as root in 'ci-container-code-format' and 'ci-container-code-lint' containers


FROM base AS ci-container-code-format
ARG LLVM_VERSION
Expand All @@ -51,6 +59,8 @@ ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
COPY llvm/utils/git/requirements_formatting.txt requirements_formatting.txt
RUN pip install -r requirements_formatting.txt --break-system-packages && \
rm requirements_formatting.txt
USER gha
WORKDIR /home/gha


FROM base AS ci-container-code-lint
Expand Down Expand Up @@ -80,3 +90,5 @@ RUN apt-get update && \
COPY llvm/utils/git/requirements_linting.txt requirements_linting.txt
RUN pip install -r requirements_linting.txt --break-system-packages && \
rm requirements_linting.txt
USER gha
WORKDIR /home/gha
8 changes: 0 additions & 8 deletions .github/workflows/pr-code-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ jobs:
with:
fetch-depth: 2

# We need to set the repo checkout as safe, otherwise tj-actions/changed-files
# will fail due to the changed ownership inside the container.
# TODO(boomanaiden154): We should probably fix this by having the default user
# in the container have the same ID as the GHA user on the host.
- name: Set Safe Directory
run: |
chown -R root $(pwd)
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/pr-code-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ jobs:
with:
fetch-depth: 2

# FIXME: same as in ".github/workflows/pr-code-format.yml"
- name: Set Safe Directory
run: |
chown -R root $(pwd)
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
Expand Down
60 changes: 30 additions & 30 deletions clang/docs/UsersManual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Introduction
============

The Clang Compiler is an open-source compiler for the C family of
programming languages, aiming to be the best in class implementation of
programming languages, aiming to be the best-in-class implementation of
these languages. Clang builds on the LLVM optimizer and code generator,
allowing it to provide high-quality optimization and code generation
support for many targets. For more general information, please see the
Expand Down Expand Up @@ -56,7 +56,7 @@ migration from GCC to Clang. In most cases, code "just works".
Clang also provides an alternative driver, :ref:`clang-cl`, that is designed
to be compatible with the Visual C++ compiler, cl.exe.

In addition to language specific features, Clang has a variety of
In addition to language-specific features, Clang has a variety of
features that depend on what CPU architecture or operating system is
being compiled for. Please see the :ref:`Target-Specific Features and
Limitations <target_features>` section for more details.
Expand Down Expand Up @@ -299,7 +299,7 @@ output format of the diagnostics that it generates.

This option controls the output format of the filename, line number,
and column printed in diagnostic messages. The options, and their
affect on formatting a simple conversion diagnostic, follow:
effect on formatting a simple conversion diagnostic, follow:

**clang** (default)
::
Expand Down Expand Up @@ -360,7 +360,7 @@ output format of the diagnostics that it generates.
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,Format String]

This category can be used by clients that want to group diagnostics
by category, so it should be a high level category. We want dozens
by category, so it should be a high-level category. We want dozens
of these, not hundreds or thousands of them.

.. _opt_fsave-optimization-record:
Expand Down Expand Up @@ -750,7 +750,7 @@ control the crash diagnostics.

Disable auto-generation of preprocessed source files during a clang crash.

The -fno-crash-diagnostics flag can be helpful for speeding the process
The ``-fno-crash-diagnostics`` flag can be helpful for speeding the process
of generating a delta reduced test case.

.. option:: -fcrash-diagnostics-dir=<dir>
Expand Down Expand Up @@ -779,7 +779,7 @@ Options to Emit Optimization Reports
------------------------------------

Optimization reports trace, at a high-level, all the major decisions
done by compiler transformations. For instance, when the inliner
made by compiler transformations. For instance, when the inliner
decides to inline function ``foo()`` into ``bar()``, or the loop unroller
decides to unroll a loop N times, or the vectorizer decides to
vectorize a loop body.
Expand Down Expand Up @@ -845,11 +845,11 @@ compilations steps.

.. option:: -fproc-stat-report=

This option requests driver to print used memory and execution time of each
This option requests the driver to print used memory and execution time of each
compilation step. The ``clang`` driver during execution calls different tools,
like compiler, assembler, linker etc. With this option the driver reports
total execution time, the execution time spent in user mode and peak memory
usage of each the called tool. Value of the option specifies where the report
usage of each called tool. Value of the option specifies where the report
is sent to. If it specifies a regular file, the data are saved to this file in
CSV format:

Expand All @@ -869,7 +869,7 @@ compilations steps.
* peak memory usage in Kb.

It is possible to specify this option without any value. In this case statistics
are printed on standard output in human readable format:
are printed on standard output in human-readable format:

.. code-block:: console

Expand All @@ -884,7 +884,7 @@ compilations steps.

You can also use environment variables to control the process statistics reporting.
Setting ``CC_PRINT_PROC_STAT`` to ``1`` enables the feature, the report goes to
stdout in human readable format.
stdout in human-readable format.
Setting ``CC_PRINT_PROC_STAT_FILE`` to a fully qualified file path makes it report
process statistics to the given file in the CSV format. Specifying a relative
path will likely lead to multiple files with the same name created in different
Expand Down Expand Up @@ -922,7 +922,7 @@ Clang options that don't fit neatly into other categories.
most filenames can be written to the file without any special formatting.
Different Make tools will treat different sets of characters as "special"
and use different conventions for telling the Make tool that the character
is actually part of the filename. Normally Clang uses backslash to "escape"
is actually part of the filename. Normally, Clang uses backslash to "escape"
a special character, which is the convention used by GNU Make. The -MV
option tells Clang to put double-quotes around the entire filename, which
is the convention used by NMake and Jom.
Expand Down Expand Up @@ -957,7 +957,7 @@ Configuration files

Configuration files group command-line options and allow all of them to be
specified just by referencing the configuration file. They may be used, for
example, to collect options required to tune compilation for particular
example, to collect options required to tune compilation for a particular
target, such as ``-L``, ``-I``, ``-l``, ``--sysroot``, codegen options, etc.

Configuration files can be either specified on the command line or loaded
Expand Down Expand Up @@ -986,7 +986,7 @@ either during build or during runtime. At build time, use
``CLANG_CONFIG_FILE_USER_DIR`` and ``CLANG_CONFIG_FILE_SYSTEM_DIR``. At run
time use the ``--config-user-dir=`` and ``--config-system-dir=`` command line
options. Specifying config directories at runtime overrides the config
directories set at build time The first file found is used. It is an error if
directories set at build time. The first file found is used. It is an error if
the required file cannot be found.

The default configuration files are searched for in the same directories
Expand All @@ -996,7 +996,7 @@ the ``--no-default-config`` flag.

First, the algorithm searches for a configuration file named
``<triple>-<driver>.cfg`` where `triple` is the triple for the target being
built for, and `driver` is the name of the currently used driver. The algorithm
built, and `driver` is the name of the currently used driver. The algorithm
first attempts to use the canonical name for the driver used, then falls back
to the one found in the executable name.

Expand Down Expand Up @@ -1047,7 +1047,7 @@ It is not an error if either of these files is not found.
The configuration file consists of command-line options specified on one or
more lines. Lines composed of whitespace characters only are ignored as well as
lines in which the first non-blank character is ``#``. Long options may be split
between several lines by a trailing backslash. Here is example of a
between several lines by a trailing backslash. Here is an example of a
configuration file:

::
Expand Down Expand Up @@ -1229,7 +1229,7 @@ Clang also allows you to push and pop the current warning state. This is
particularly useful when writing a header file that will be compiled by
other people, because you don't know what warning flags they build with.

In the below example :option:`-Wextra-tokens` is ignored for only a single line
In the example below, :option:`-Wextra-tokens` is ignored for only a single line
of code, after which the diagnostics return to whatever state had previously
existed.

Expand All @@ -1253,7 +1253,7 @@ of warnings, so even when using GCC-compatible #pragmas there is no
guarantee that they will have identical behaviour on both compilers.

Clang also doesn't yet support GCC behavior for ``#pragma diagnostic pop``
that doesn't have a corresponding ``#pragma diagnostic push``. In this case
that doesn't have a corresponding ``#pragma diagnostic push``. In this case,
GCC pretends that there is a ``#pragma diagnostic push`` at the very beginning
of the source file, so "unpaired" ``#pragma diagnostic pop`` matches that
implicit push. This makes a difference for ``#pragma GCC diagnostic ignored``
Expand Down Expand Up @@ -1406,7 +1406,7 @@ project even if there are violations in some headers.
# directory. But it'll still complain for all the other sources, e.g:
$ cat foo/bar.cc
#include "dir/include.h" // Clang flags unused declarations here.
#include "foo/include.h" // but unused warnings under this source is omitted.
#include "foo/include.h" // but unused warnings under this source are omitted.
#include "next_to_bar_cc.h" // as are unused warnings from this header file.
// Further, unused warnings in the remainder of bar.cc are also omitted.

Expand Down Expand Up @@ -1648,7 +1648,7 @@ for more details.

.. option:: -fno-fast-math

Disable fast-math mode. This options disables unsafe floating-point
Disable fast-math mode. This option disables unsafe floating-point
optimizations by preventing the compiler from making any transformations that
could affect the results.

Expand Down Expand Up @@ -1766,7 +1766,7 @@ for more details.

* ``fast``: enable fusion across statements disregarding pragmas, breaking
compliance with the C and C++ standards (default for CUDA).
* ``on``: enable C and C++ standard complaint fusion in the same statement
* ``on``: enable C and C++ standard compliant fusion in the same statement
unless dictated by pragmas (default for languages other than CUDA/HIP)
* ``off``: disable fusion
* ``fast-honor-pragmas``: fuse across statements unless dictated by pragmas
Expand Down Expand Up @@ -1919,7 +1919,7 @@ for more details.
a single expression of the code.

Valid values are: ``source``, ``double``, and ``extended``.
For 64-bit targets, the default value is ``source``. For 32-bit x86 targets
For 64-bit targets, the default value is ``source``. For 32-bit x86 targets,
however, in the case of NETBSD 6.99.26 and under, the default value is
``double``; in the case of NETBSD greater than 6.99.26, with NoSSE, the
default value is ``extended``, with SSE the default value is ``source``.
Expand Down Expand Up @@ -3881,9 +3881,9 @@ See :doc:`LanguageExtensions`.
Differences between various standard modes
------------------------------------------

clang supports the -std option, which changes what language mode clang uses.
clang supports the ``-std`` option, which changes what language mode clang uses.
The supported modes for C are c89, gnu89, c94, c99, gnu99, c11, gnu11, c17,
gnu17, c23, gnu23, c2y, gnu2y, and various aliases for those modes. If no -std
gnu17, c23, gnu23, c2y, gnu2y, and various aliases for those modes. If no ``-std``
option is specified, clang defaults to gnu17 mode. Many C99 and C11 features
are supported in earlier modes as a conforming extension, with a warning. Use
``-pedantic-errors`` to request an error if a feature from a later standard
Expand Down Expand Up @@ -4609,7 +4609,7 @@ codebases.

On ``x86_64-mingw32``, passing i128(by value) is incompatible with the
Microsoft x64 calling convention. You might need to tweak
``WinX86_64ABIInfo::classify()`` in lib/CodeGen/Targets/X86.cpp.
``WinX86_64ABIInfo::classify()`` in ``lib/CodeGen/Targets/X86.cpp``.

For the X86 target, clang supports the `-m16` command line
argument which enables 16-bit code output. This is broadly similar to
Expand Down Expand Up @@ -4760,8 +4760,8 @@ is imported, the linker will generate fixup code for reading or writing to the
variable.

When multiple toc-data options are used, the last option used has the affect.
For example: -mno-tocdata=g5,g1 -mtocdata=g1,g2 -mno-tocdata=g2 -mtocdata=g3,g4
results in -mtocdata=g1,g3,g4
For example: ``-mno-tocdata=g5,g1 -mtocdata=g1,g2 -mno-tocdata=g2 -mtocdata=g3,g4``
results in ``-mtocdata=g1,g3,g4``

Names of variables not having external linkage will be ignored.

Expand Down Expand Up @@ -5143,16 +5143,16 @@ Execute ``clang-cl /?`` to see a list of supported options:
Instrument only functions from files where names match any regex separated by a semi-colon
-fprofile-generate=<dirname>
Generate instrumented code to collect execution counts into a raw profile file in the directory specified by the argument. The filename uses default_%m.profraw pattern
(overridden by LLVM_PROFILE_FILE env var)
(overridden by ``LLVM_PROFILE_FILE`` env var)
-fprofile-generate
Generate instrumented code to collect execution counts into default_%m.profraw file
(overridden by '=' form of option or LLVM_PROFILE_FILE env var)
(overridden by '=' form of option or ``LLVM_PROFILE_FILE`` env var)
-fprofile-instr-generate=<file_name_pattern>
Generate instrumented code to collect execution counts into the file whose name pattern is specified as the argument
(overridden by LLVM_PROFILE_FILE env var)
(overridden by ``LLVM_PROFILE_FILE`` env var)
-fprofile-instr-generate
Generate instrumented code to collect execution counts into default.profraw file
(overridden by '=' form of option or LLVM_PROFILE_FILE env var)
(overridden by '=' form of option or ``LLVM_PROFILE_FILE`` env var)
-fprofile-instr-use=<value>
Use instrumentation data for coverage testing or profile-guided optimization
-fprofile-use=<value>
Expand Down
4 changes: 1 addition & 3 deletions clang/include/clang/CIR/MissingFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,9 @@ struct MissingFeatures {
static bool zeroSizeRecordMembers() { return false; }

// Coroutines
static bool coroAllocBuiltinCall() { return false; }
static bool coroBeginBuiltinCall() { return false; }
static bool coroEndBuiltinCall() { return false; }
static bool coroSizeBuiltinCall() { return false; }
static bool coroutineFrame() { return false; }
static bool emitBodyAndFallthrough() { return false; }

// Various handling of deferred processing in CIRGenModule.
static bool cgmRelease() { return false; }
Expand Down
5 changes: 0 additions & 5 deletions clang/include/clang/Sema/Sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -2681,11 +2681,6 @@ class Sema final : public SemaBase {
/// function without this attribute.
bool DiscardingCFIUncheckedCallee(QualType From, QualType To) const;

/// Returns true if `From` is a function or pointer to a function without the
/// `cfi_unchecked_callee` attribute but `To` is a function or pointer to
/// function with this attribute.
bool AddingCFIUncheckedCallee(QualType From, QualType To) const;

/// This function calls Action when it determines that E designates a
/// misaligned member due to the packed attribute. This is used to emit
/// local diagnostics like in reference binding.
Expand Down
13 changes: 9 additions & 4 deletions clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,10 +449,15 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
}
case Builtin::BI__builtin_coro_free:
case Builtin::BI__builtin_coro_size: {
cgm.errorNYI(e->getSourceRange(),
"BI__builtin_coro_free, BI__builtin_coro_size NYI");
assert(!cir::MissingFeatures::coroSizeBuiltinCall());
return getUndefRValue(e->getType());
GlobalDecl gd{fd};
mlir::Type ty = cgm.getTypes().getFunctionType(
cgm.getTypes().arrangeGlobalDeclaration(gd));
const auto *nd = cast<NamedDecl>(gd.getDecl());
cir::FuncOp fnOp =
cgm.getOrCreateCIRFunction(nd->getName(), ty, gd, /*ForVTable=*/false);
fnOp.setBuiltin(true);
return emitCall(e->getCallee()->getType(), CIRGenCallee::forDirect(fnOp), e,
returnValue);
}
case Builtin::BI__builtin_prefetch: {
auto evaluateOperandAsInt = [&](const Expr *arg) {
Expand Down
Loading