Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
c443d6a
[libc] ensure tls dtors are called in main thread
SchrodingerZhu Mar 30, 2025
30295d0
[libc] add an defense for reentrant exit
SchrodingerZhu Mar 30, 2025
3d6301f
mark thread test as hermetic only
SchrodingerZhu Mar 30, 2025
79d9ea2
alternative approach
SchrodingerZhu Mar 30, 2025
c754437
align with bionic
SchrodingerZhu Mar 31, 2025
16a3922
Update atexit.cpp
SchrodingerZhu Mar 31, 2025
c8bebd7
Update atexit.cpp
SchrodingerZhu Mar 31, 2025
2046840
[clang] implement common-sugar for adjusted member-pointers (#133613)
mizvekov Mar 30, 2025
1849156
[CodeGen][StaticDataSplitter]Support constant pool partitioning (#129…
mingmingl-llvm Mar 30, 2025
67d8c30
[llvm-reduce]: print short form, actionable names in the log (#133561)
YLChenZ Mar 30, 2025
d416281
[ExecutionEngine] Avoid repeated hash lookups (NFC) (#133615)
kazutakahirata Mar 30, 2025
9ddb8ad
[bugpoint] Avoid repeated hash lookups (NFC) (#133616)
kazutakahirata Mar 30, 2025
8fb5973
llvm-reduce: Remove trailing whitespace
arsenm Mar 30, 2025
7fb44a0
llvm-reduce: Trim unnecessary includes
arsenm Mar 30, 2025
b0acb7e
[Clang][NFC] Improve const correctness of constraint normalization (#…
cor3ntin Mar 30, 2025
670c2d4
[libc++][NFC] Remove _LIBCPP_DLL_VIS
philnik777 Mar 30, 2025
77ec428
[bazel] Make DeltaPasses.def available for fea6b388055284f37852e615fb…
d0k Mar 30, 2025
c666b4e
Revert the llvm::append_range change in lib/Target/X86/X86WinEHState.cpp
alexfh Mar 30, 2025
c523e43
InlineCostAnnotationPrinter: Fix constructing random TargetTransformI…
arsenm Mar 30, 2025
c6e5346
[VPlan] Remove dead UF argument from VPTransformState ctor (NFC).
fhahn Mar 30, 2025
a0930ac
[RISCV] Remove dead code from evaluateTargetFixup
MaskRay Mar 30, 2025
6f14f1c
[RISCV] Remove unused declarations and getSpecifier. NFC
MaskRay Mar 30, 2025
b4d148a
StackProtector: use isInTailCallPosition to verify tail call position…
taoliq Mar 30, 2025
efcf0fb
[clang-tidy][NFC][doc] improve "options" sections of `bugprone-` and …
vbvictor Mar 30, 2025
78a60db
[ADT] Add `DenseMap::insert_range` (#133600)
vbvictor Mar 30, 2025
944424f
Move relocation specifiers to AMDGPUMCExpr::Specifier
MaskRay Mar 30, 2025
2ca97b4
[AArch64] Use llvm::erase_if (NFC) (#133647)
kazutakahirata Mar 30, 2025
7b17e09
[mlir] Use llvm::hasSingleElement (NFC) (#133648)
kazutakahirata Mar 30, 2025
d7f3e66
[TableGen] Use llvm::append_range (NFC) (#133649)
kazutakahirata Mar 30, 2025
b7075ae
[Transforms] Use llvm::append_range (NFC) (#133650)
kazutakahirata Mar 30, 2025
35de81c
[VPlan] Handle scalar casts and blend in isUniformAfterVectorization.
fhahn Mar 30, 2025
e4fcd59
[VPlan] Remove duplicated VPDerivedIVRecipe handling (NFC).
fhahn Mar 30, 2025
8520b60
[lldb] Combine disassembler gtest binaries for efficiency (#133539)
rnk Mar 30, 2025
cdf5511
[lldb] Fix cmake logic when no targets are configured
rnk Mar 30, 2025
d50b782
[NFC][clang-tidy] Add type annotations to check_clang_tidy (#133140)
nicovank Mar 30, 2025
572e212
[lldb] Remove unused Version.h include in Telemetry.cpp (NFC)
JDevlieghere Mar 30, 2025
c8b2c31
[clang-format] Add an option for editing enum trailing commas (#133576)
owenca Mar 30, 2025
6ab27e5
[MC] Don't print () around $ names
MaskRay Mar 30, 2025
5eb50d9
[lldb-dap] Swapping to not use FLAG_ENUM and just defining typed enum…
ashgti Mar 30, 2025
fe9bab6
[Exegesis][AArch64] Use more generic cycles counter (#133376)
r-belenov Mar 30, 2025
455b41d
Lint: Replace -lint-abort-on-error cl::opt with pass parameter (#132933)
arsenm Mar 31, 2025
f7c8afe
[llvm] Use llvm::append_range (NFC) (#133658)
kazutakahirata Mar 31, 2025
99879ce
[SLP] NFC. Remove the redundant MainOp and AltOp find process. (#133642)
HanKuanChen Mar 31, 2025
c33cf7b
[ORC] MapperJITLinkMemoryManager should deinitialize on abandon, not …
Mar 31, 2025
b9cf6e4
[RISCV] Cleanup assembler predicates after #133377. (#133652)
topperc Mar 31, 2025
3aea827
[MC] Simplify MCBinaryExpr/MCUnaryExpr printing by reducing parenthes…
MaskRay Mar 31, 2025
3011ae7
[MC] maybeParseSectionType: test CommentString instead of AllowAtInId…
MaskRay Mar 31, 2025
25aad90
[RISCV] Fix the operand types for shift instructions in RISCVInstrInf…
topperc Mar 31, 2025
47e99c6
[clang] Use DenseMap::insert_range (NFC) (#133655)
kazutakahirata Mar 31, 2025
094e06c
[Vectorize] Use DenseMap::insert_range (NFC) (#133656)
kazutakahirata Mar 31, 2025
8dabd7f
[polly] Use DenseMap::insert_range (NFC) (#133657)
kazutakahirata Mar 31, 2025
a8b28ec
[analyzer] Unknown array lvalue element in Store (#133381)
T-Gruber Mar 31, 2025
a30ac88
[VPlan] Support early-exit loops in optimizeForVFAndUF. (#131539)
fhahn Mar 31, 2025
830ff32
Reland [MS][clang] Add support for vector deleting destructors (#133451)
Fznamznon Mar 31, 2025
7c4ea16
[RISCV] Vectorize phi for loop carried @llvm.vp.reduce.* (#131974)
NexMing Mar 31, 2025
85e67bd
[lldb] Make GetRowForFunctionOffset compatible with discontinuous fun…
labath Mar 31, 2025
2df8f9d
[lld][LoongArch] Relax TLSDESC code sequence (#123677)
ylzsx Mar 31, 2025
c845987
[mlir][mpi] Lowering MPI_Allreduce (#133133)
fschlimb Mar 31, 2025
72e2bdb
[ARM64EC] Add support for function aliases on ARM64EC (#132295)
cjacek Mar 31, 2025
8446886
llvm-reduce: Use 80 dashes for section separator in status printing (…
arsenm Mar 31, 2025
2212763
[LV]Split store-load forward distance analysis from other checks, NFC…
alexey-bataev Mar 31, 2025
bd12349
[LV][NFC] Regenerate some SVE tests using --filter-out-after option (…
david-arm Mar 31, 2025
9e8833e
[X86] combineINSERT_SUBVECTOR - pull out common variables. NFC. (#133…
RKSimon Mar 31, 2025
0eacc11
[ARM] Silence signed comparison warning. NFC
davemgreen Mar 31, 2025
bc8a039
[AArch64] Add bitcast + extend tests. NFC
davemgreen Mar 31, 2025
a4d1a26
[DAG] visitEXTRACT_SUBVECTOR - don't return early on failure of EXTRA…
RKSimon Mar 31, 2025
be32e42
[clang-format] Recognize wait fork in Verilog (#132042)
sstwcw Mar 31, 2025
d5d8271
[clang-format] Handle C++ keywords in other languages better (#132941)
sstwcw Mar 25, 2025
3447209
[clang][Sema] Fix typo in 'offsetof' diagnostics (#133448)
Michael137 Mar 31, 2025
cb69e12
[X86] Add regression test for insert_subvector(x,extract_subvector(br…
RKSimon Mar 31, 2025
f7d11e8
[RISCV] Add combine for shadd family of instructions. (#130829)
stefanp-synopsys Mar 31, 2025
b65f394
[X86][AVX10] Re-target mavx10.1 and emit warning for mavx10.x-256/512…
phoebewang Mar 31, 2025
d7ebfa1
[libc][math][c23] Add hypotf16 function (#131991)
meltq Mar 31, 2025
2fbc1c5
[AMDGPU][True16][CodeGen] Skip combineDpp with t16 instructions (#128…
broxigarchen Mar 31, 2025
d0a6867
Enable unnecessary-virtual-specifier by default (#133265)
DKLoehr Mar 31, 2025
531ff74
Add support for fixed-point types (#129596)
tromey Mar 31, 2025
c4c11c3
[libc] add _malloc_thread_cleanup option
SchrodingerZhu Mar 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Options
.. option:: AssertMacros

A comma-separated list of the names of assert macros to be checked.
Default is `assert,NSAssert,NSCAssert`.

.. option:: CheckFunctionCalls

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Possible fixes:
object types.
- passing ``this`` pointer as parameter

Options
-------

.. option:: FunctionWrapperTypes

A semicolon-separated list of names of types. Used to specify function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,16 @@ so both arguments will have the same type.
return false;
}

Options
-------

.. option:: CharTypdefsToIgnore

A semicolon-separated list of typedef names. In this list, we can list
typedefs for ``char`` or ``signed char``, which will be ignored by the
check. This is useful when a typedef introduces an integer alias like
``sal_Int8`` or ``int8_t``. In this case, human misinterpretation is not
an issue.
an issue. Default is an empty string.

.. option:: DiagnoseSignedUnsignedCharComparisons

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Examples:

Options
-------

.. option:: StrictMode

Default value: 0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ lead to a compilation error due to the explicit nature of the ``std::string``
constructor. Consequently, developers might opt for ``sv.data()`` to resolve the
compilation error, albeit introducing potential hazards as discussed.

Options
-------

.. option:: StringViewTypes

Option allows users to specify custom string view-like types for analysis. It
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ It's recommended to enable the compiler warning
`-Wtautological-constant-out-of-range-compare` as well, since check does not
inspect compile-time constant loop boundaries to avoid overlaps with the warning.

Options
-------

.. option:: MagnitudeBitsUpperLimit

Upper limit for the magnitude bits of the loop variable. If it's set the check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ temporary object into ``this`` (needs a move assignment operator):
}
};

Options
-------

.. option:: WarnOnlyIfThisHasSuspiciousField

When `true`, the check will warn only if the container class of the copy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ Or cast to char to explicitly indicate that output should be a character.

std::cout << static_cast<char>(v);

Options
-------

.. option:: CastTypeName

When `CastTypeName` is specified, the fix-it will use `CastTypeName` as the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ Options
of every placeholder parameter list. Without this, it is possible for a fix-it
to perform an incorrect transformation in the case where the result of the ``bind``
is used in the context of a type erased functor such as ``std::function`` which
allows mismatched arguments. For example:
allows mismatched arguments. Default is is `false`.

For example:

.. code-block:: c++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ Similarly, the ``main()`` function is ignored. Its second and third parameters
can be either ``char* argv[]`` or ``char** argv``, but cannot be
``std::array<>``.

Options
-------

.. option:: AllowStringArrays

When set to `true` (default is `false`), variables of character array type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ however the check can be configured to work without C++20 by specifying a
function to reverse a range and optionally the header file where that function
lives.

Options
-------

.. option:: UseCxx20ReverseRanges

When set to true convert loops when in C++20 or later mode using
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ Options

.. option:: IgnoreDefaultInitialization

If set to non-zero, the check does not suggest edits that will transform
If set to `false`, the check does not suggest edits that will transform
default initialization into value initialization, as this can cause
performance regressions. Default is `1`.
performance regressions. Default is `true`.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ Options

.. option:: IgnoreDefaultInitialization

If set to non-zero, the check does not suggest edits that will transform
If set to `false`, the check does not suggest edits that will transform
default initialization into value initialization, as this can cause
performance regressions. Default is `1`.
performance regressions. Default is `true`.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ An escaped horizontal tab, form feed, or vertical tab prevents the string
literal from being converted. The presence of a horizontal tab, form feed or
vertical tab in source code is not visually obvious.

Options
-------

.. option:: DelimiterStem

Custom delimiter to escape characters in raw string literals. It is used in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ Options
Semicolon-separated list of containers without their template parameters
and some ``emplace``-like method of the container. Example:
``vector::emplace_back``. Those methods will be checked for improper use and
the check will report when a temporary is unnecessarily created.
the check will report when a temporary is unnecessarily created. All STL
containers with such member functions are supported by default.

Example
^^^^^^^
Expand Down
39 changes: 20 additions & 19 deletions clang-tools-extra/test/clang-tidy/check_clang_tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,16 @@
import re
import subprocess
import sys
from typing import List, Tuple


def write_file(file_name, text):
def write_file(file_name: str, text: str) -> None:
with open(file_name, "w", encoding="utf-8") as f:
f.write(text)
f.truncate()


def try_run(args, raise_error=True):
def try_run(args: List[str], raise_error: bool = True) -> str:
try:
process_output = subprocess.check_output(args, stderr=subprocess.STDOUT).decode(
errors="ignore"
Expand All @@ -71,12 +72,12 @@ def try_run(args, raise_error=True):

# This class represents the appearance of a message prefix in a file.
class MessagePrefix:
def __init__(self, label):
def __init__(self, label: str) -> None:
self.has_message = False
self.prefixes = []
self.prefixes: List[str] = []
self.label = label

def check(self, file_check_suffix, input_text):
def check(self, file_check_suffix: str, input_text: str) -> bool:
self.prefix = self.label + file_check_suffix
self.has_message = self.prefix in input_text
if self.has_message:
Expand All @@ -85,7 +86,7 @@ def check(self, file_check_suffix, input_text):


class CheckRunner:
def __init__(self, args, extra_args):
def __init__(self, args: argparse.Namespace, extra_args: List[str]) -> None:
self.resource_dir = args.resource_dir
self.assume_file_name = args.assume_filename
self.input_file_name = args.input_file_name
Expand Down Expand Up @@ -143,11 +144,11 @@ def __init__(self, args, extra_args):
if self.resource_dir is not None:
self.clang_extra_args.append("-resource-dir=%s" % self.resource_dir)

def read_input(self):
def read_input(self) -> None:
with open(self.input_file_name, "r", encoding="utf-8") as input_file:
self.input_text = input_file.read()

def get_prefixes(self):
def get_prefixes(self) -> None:
for suffix in self.check_suffix:
if suffix and not re.match("^[A-Z0-9\\-]+$", suffix):
sys.exit(
Expand Down Expand Up @@ -189,7 +190,7 @@ def get_prefixes(self):
)
assert expect_diagnosis or self.expect_no_diagnosis

def prepare_test_inputs(self):
def prepare_test_inputs(self) -> None:
# Remove the contents of the CHECK lines to avoid CHECKs matching on
# themselves. We need to keep the comments to preserve line numbers while
# avoiding empty lines which could potentially trigger formatting-related
Expand All @@ -198,7 +199,7 @@ def prepare_test_inputs(self):
write_file(self.temp_file_name, cleaned_test)
write_file(self.original_file_name, cleaned_test)

def run_clang_tidy(self):
def run_clang_tidy(self) -> str:
args = (
[
"clang-tidy",
Expand Down Expand Up @@ -238,11 +239,11 @@ def run_clang_tidy(self):
print("------------------------------------------------------------------")
return clang_tidy_output

def check_no_diagnosis(self, clang_tidy_output):
def check_no_diagnosis(self, clang_tidy_output: str) -> None:
if clang_tidy_output != "":
sys.exit("No diagnostics were expected, but found the ones above")

def check_fixes(self):
def check_fixes(self) -> None:
if self.has_check_fixes:
try_run(
[
Expand All @@ -254,7 +255,7 @@ def check_fixes(self):
]
)

def check_messages(self, clang_tidy_output):
def check_messages(self, clang_tidy_output: str) -> None:
if self.has_check_messages:
messages_file = self.temp_file_name + ".msg"
write_file(messages_file, clang_tidy_output)
Expand All @@ -268,7 +269,7 @@ def check_messages(self, clang_tidy_output):
]
)

def check_notes(self, clang_tidy_output):
def check_notes(self, clang_tidy_output: str) -> None:
if self.has_check_notes:
notes_file = self.temp_file_name + ".notes"
filtered_output = [
Expand All @@ -287,7 +288,7 @@ def check_notes(self, clang_tidy_output):
]
)

def run(self):
def run(self) -> None:
self.read_input()
if self.export_fixes is None:
self.get_prefixes()
Expand All @@ -313,7 +314,7 @@ def run(self):
C_STANDARDS = ["c99", ("c11", "c1x"), "c17", ("c23", "c2x"), "c2y"]


def expand_std(std):
def expand_std(std: str) -> List[str]:
split_std, or_later, _ = std.partition("-or-later")

if not or_later:
Expand All @@ -335,11 +336,11 @@ def expand_std(std):
return [std]


def csv(string):
def csv(string: str) -> List[str]:
return string.split(",")


def parse_arguments():
def parse_arguments() -> Tuple[argparse.Namespace, List[str]]:
parser = argparse.ArgumentParser(
prog=pathlib.Path(__file__).stem,
description=__doc__,
Expand Down Expand Up @@ -374,7 +375,7 @@ def parse_arguments():
return parser.parse_known_args()


def main():
def main() -> None:
args, extra_args = parse_arguments()

abbreviated_stds = args.std
Expand Down
41 changes: 41 additions & 0 deletions clang/docs/ClangFormatStyleOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3976,6 +3976,47 @@ the configuration (without a prefix: ``Auto``).



.. _EnumTrailingComma:

**EnumTrailingComma** (``EnumTrailingCommaStyle``) :versionbadge:`clang-format 21` :ref:`¶ <EnumTrailingComma>`
Insert a comma (if missing) or remove the comma at the end of an ``enum``
enumerator list.

.. 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.

Possible values:

* ``ETC_Leave`` (in configuration: ``Leave``)
Don't insert or remove trailing commas.

.. code-block:: c++

enum { a, b, c, };
enum Color { red, green, blue };

* ``ETC_Insert`` (in configuration: ``Insert``)
Insert trailing commas.

.. code-block:: c++

enum { a, b, c, };
enum Color { red, green, blue, };

* ``ETC_Remove`` (in configuration: ``Remove``)
Remove trailing commas.

.. code-block:: c++

enum { a, b, c };
enum Color { red, green, blue };



.. _ExperimentalAutoDetectBinPacking:

**ExperimentalAutoDetectBinPacking** (``Boolean``) :versionbadge:`clang-format 3.7` :ref:`¶ <ExperimentalAutoDetectBinPacking>`
Expand Down
14 changes: 10 additions & 4 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,13 @@ Hexagon Support
X86 Support
^^^^^^^^^^^

- Disable ``-m[no-]avx10.1`` and switch ``-m[no-]avx10.2`` to alias of 512 bit
options.
- Change ``-mno-avx10.1-512`` to alias of ``-mno-avx10.1-256`` to disable both
256 and 512 bit instructions.
- The 256-bit maximum vector register size control was removed from
`AVX10 whitepaper <https://cdrdv2.intel.com/v1/dl/getContent/784343>_`.
* Re-target ``m[no-]avx10.1`` to enable AVX10.1 with 512-bit maximum vector register size.
* Emit warning for ``mavx10.x-256``, noting AVX10/256 is not supported.
* Emit warning for ``mavx10.x-512``, noting to use ``m[no-]avx10.x`` instead.
* Emit warning for ``m[no-]evex512``, noting AVX10/256 is not supported.
* The features avx10.x-256/512 keep unchanged and will be removed in the next release.

Arm and AArch64 Support
^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -434,6 +437,7 @@ Windows Support
- Clang now can process the `i128` and `ui128` integeral suffixes when MSVC
extensions are enabled. This allows for properly processing ``intsafe.h`` in
the Windows SDK.
- Clang now supports MSVC vector deleting destructors (GH19772).

LoongArch Support
^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -492,6 +496,8 @@ clang-format
- Allow specifying the language (C, C++, or Objective-C) for a ``.h`` file by
adding a special comment (e.g. ``// clang-format Language: ObjC``) near the
top of the file.
- Add ``EnumTrailingComma`` option for inserting/removing commas at the end of
``enum`` enumerator lists.

libclang
--------
Expand Down
Loading
Loading