Commit Graph

486947 Commits

Author SHA1 Message Date
Aiden Grossman
8e99a63899 [Github] Update paths for mlgo PR subscribers
This patch updates the paths in the PR labelling config for the MLGO
label. In particular, the path for the new mlgo-utils subfolder under
llvm/utils has been added and two other files that were missed in the
original introduction.
2024-01-21 03:37:18 +00:00
Aiden Grossman
39f1ca522b [MLGO] Remove absl dep from libraries
The library files in the new mlgo-utils utilities folder only depend on
absl.logging. The builtin Python logging library is a direct drop-in
replacement here, so we can just change the include and drop the test
dependency.
2024-01-21 03:33:15 +00:00
Kazu Hirata
bb6564a1b5 [TableGen] Use StringRef::consume_front (NFC) 2024-01-20 18:57:36 -08:00
Kazu Hirata
f523a5522b [Sema] Use llvm::all_of (NFC) 2024-01-20 18:57:35 -08:00
Kazu Hirata
1ce5a80d08 [Mips] Use MachineBasicBlock::pred_size (NFC) 2024-01-20 18:57:33 -08:00
Kazu Hirata
24790a7788 [Hexagon] Use llvm::children (NFC) 2024-01-20 18:57:31 -08:00
Kazu Hirata
9b2c25c704 [clang] Use SmallString::operator std::string (NFC) 2024-01-20 18:57:30 -08:00
Vassil Vassilev
2759e47067 [clang-repl] We do not need to call new in the object allocation. (#78843)
This test demonstrates template instantiation via the interpreter code.
In order to do that we can allocate the object on the stack and extend
its lifetime by boxing it into a clang::Value.

That avoids the subtle problem where we call the new operator on an
object only known to the interpreter and we cannot destroy it from
compiled code since there is not suitable facility in clang::Value yet.

That should resolve the asan issues that was reported in
llvm/llvm-project#76218.
2024-01-20 17:00:38 -08:00
Jerry Wu
dedc7d4d36 [mlir] Exclude masked ops in VectorDropLeadUnitDim (#76468)
Don't insert cast ops for ops in `vector.mask` region in
`VectorDropLeadUnitDim`.
2024-01-20 19:37:46 -05:00
lntue
975deb3664 [libc] Add missing header ioctl.h on aarch64. (#78865) 2024-01-20 18:16:45 -05:00
XDeme
a464e05109 [clang-format] Handle templated elaborated type specifier in function… (#77013)
… return type.

The behavior now is consistent with the non template version.
Enabled and updated old test.
2024-01-20 14:47:58 -08:00
Kazu Hirata
11b3b10856 [Support] Use llvm::children and llvm::inverse_children (NFC) 2024-01-20 14:30:37 -08:00
Kazu Hirata
851143608e [Frontend] Use SmallString::operator std::string (NFC) 2024-01-20 14:30:36 -08:00
Kazu Hirata
aa530c7d00 [Passes] Use a range-based for loop with llvm::successors (NFC) 2024-01-20 14:30:34 -08:00
Kazu Hirata
81218356fd [Sparc] Use StringRef::starts_with_insensitive (NFC) 2024-01-20 14:30:32 -08:00
Kazu Hirata
84cb8eaeeb [Sema] Use llvm::is_contained (NFC) 2024-01-20 14:30:30 -08:00
Vincent Lee
06ca52e252 [InlineOrder] Fix InlineOrder erase_if implementation (#78684)
The InlineOrder Heap stores a CallBase ptr and InlineHistoryID pair.
When running the `erase_if` method, InlineHistoryID is always returned
with 0. Instead, we should be retrieving it from the `InlineHistoryMap`
(similar to what is done in the `pop` implementation).

This change is completely harmless because no one is using
InlineHistoryID right now as part of the `erase_if` implementation which
is currently only used in the ModuleInliner.
2024-01-20 14:22:31 -08:00
David Green
49212d1601 [Flang] Fix for replacing loop uses in LoopVersioning pass (#77899)
The added test case has a loop that is versioned, which has a use of the
loop in an if block after the loop. The current code replaces all uses
of the loop with the new version If, but only if the parent blocks
match. As far as I can see it should be safe to replace all the uses,
then construct the result for the If with op.op.
2024-01-20 22:16:05 +00:00
OldWorldOrdr
46a9135d61 [lld-macho] Find objects in library search path (#78628)
Find object files in library search path just like Apple's linker, this
makes building with some older MacOS SDKs easier since clang runs with
`-lcrt1.10.6.o`
2024-01-20 13:53:55 -08:00
Hristo Hristov
07b5829fca [libc++] FreeBSD CI: Adds <signal.h> to check_assertion.h (#78863)
...in attempt to fix the FreeBSD CI.

I noticed that suddenly some tests in the latest PRs fail to compile on
FreeBSD (`SIGILL` and `SIGTRAP` not defined). This tries to resolve
the issue.

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-20 13:48:48 -08:00
Vitaly Buka
aaa7de1fc9 [libc++][hardening] XFAIL test in fast mode under HWASAN (#78862)
After #77883, `fast` mode uses TRAP, and HWASAN
replaces TRAP with abort or error exit code.

On a quick looks it should be possible to avoid doing
that in HWASAN, but historically this is convention for all
sanitizers. Changing this behavior may break existing
users.

Other sanitizers are not affected because they don't
install TRAP handlers by default. But if they do, they also
replace TRAP with abort/exit.
2024-01-20 13:37:38 -08:00
XDeme
2fc2ee136c [clang-format] Fix poor spacing in AlignArrayOfStructures: Left (#77868)
Fixes llvm/llvm-project#62904

`AlignArrayOfStructures: Left` combined with `SpacesInParentheses: true`
causes the first cell of every row to have 1 additional space.
We were only setting the first cell of the first row to be against the
left brace, now every row will be against the left brace.
2024-01-20 13:34:37 -08:00
Hui
85a8e5c3e0 [libc++] fix condition_variable_any hangs on stop_request (#77127)
When I implemented `condition_variable_any::wait`, I missed the most
important paragraph in the spec:

> The following wait functions will be notified when there is a stop
request on the passed stop_token.
> In that case the functions return immediately, returning false if the
predicate evaluates to false.

From
https://eel.is/c++draft/thread.condition#thread.condvarany.intwait-1.

Fixes #76807
2024-01-20 21:18:44 +00:00
lntue
1cc7cd46a9 [libc] Fix size_t used without including stddef.h in CPP/limit.h. (#78861) 2024-01-20 16:14:17 -05:00
Daniil Dudkin
0175a1e4d3 new-prs-labeler: Add clang-tools-extra labeling (#78633)
There is no automatic labeling for the Extra Clang Tools, except
Clang-Tidy and ClangD.
2024-01-20 23:19:17 +03:00
LEE KYOUNGHEON
448b8e6162 Module documentation improvement: prebuilt module location can be directly fetched via CMake variable. (#78405)
CMake officially supports binary directory variable of installed
dependency using `FetchContent`. According to the current documentation,
it fetches `std` module and use its binary directory as hardcoded
string, `${CMAKE_BINARY_DIR}/_deps/std-build`, however it can be
replaced with `${std_BINARY_DIR}`.

Reference: https://cmake.org/cmake/help/latest/module/FetchContent.html
2024-01-20 21:06:02 +01:00
lntue
ce8fcad5f4 [libc] Fix float.h header to include the system float.h first and add more definitions. (#78857) 2024-01-20 14:44:51 -05:00
Nathan Sidwell
0880742a60 [NFC] Rename internal fns (#77994)
Internal functions should use a lowerCaseName, thus renamed.
2024-01-20 14:23:37 -05:00
Joseph Huber
ec0ac85e58 [Clang][Obvious] Correctly disable Windows on linker-wrapper test 2024-01-20 12:53:03 -06:00
kelbon
818de32f31 Warning for incorrect use of 'pure' attribute (#78200)
This adds a warning when applying the `pure` attribute along with the `const` attribute, or when applying the `pure` attribute to a function with a `void` return type (including constructors and destructors).

Fixes https://github.com/llvm/llvm-project/issues/77482
2024-01-20 12:37:35 -05:00
nsurbay
b9a1e2ab8d [AArch64] Rename LDAPR<x>pre to LDAPR<x>post (#77340)
The feature FEAT_LRCPC3 introduces post-increment version of LDAPR and
LDIAPP instructions. The current disassembly of theses instructions is
correct but the opcode name is misleading with a 'pre' suffix instead of
'post'.

see :
-
https://developer.arm.com/documentation/ddi0602/2023-12/Base-Instructions/LDAPR--Load-Acquire-RCpc-Register-
-
https://developer.arm.com/documentation/ddi0602/2023-12/Base-Instructions/LDIAPP--Load-Acquire-RCpc-ordered-Pair-of-registers-
2024-01-20 17:07:14 +00:00
Congcong Cai
0f80f5e362 [NFC] fix typo in clang/include/clang/Sema/ScopeInfo.h 2024-01-20 22:43:15 +08:00
Ryan Landay
d01145f760 Fix typo in AttrDocs.td (__single_inhertiance => __single_inheritance) (#78838) 2024-01-20 09:20:22 -05:00
Martin Storsjö
d0986519d5 [LLD] [COFF] Preserve directives and export names from LTO objects (#78802)
The export names are saved as StringRefs pointing into the COFF
directives. In the case of LTO objects, this can be memory allocated
that is owned by the LTO InputFile, which gets destructed when doing the
compilation.

In the case of LTO objects from an older version of LLVM, which require
being upgraded when loaded, the directives string gets destructed, while
when using LTO objects of a matching version (the common case), the
directives string points into memory that doesn't get destructed on LTO
compilation.

Test this by linking a bundled binary LTO object file, from an older
version of LLVM.

This fixes issue #78591, and downstream issue
https://github.com/mstorsjo/llvm-mingw/issues/392.
2024-01-20 16:15:44 +02:00
Hirofumi Nakamura
fcb6737f82 [clang-format] Support of TableGen identifiers beginning with a number. (#78571)
TableGen allows the identifiers beginning with a number.
This patch add the support of the recognition of such identifiers.
2024-01-20 21:15:58 +09:00
Kerry McLaughlin
a8a3711e74 [AArch64][SME2] Preserve ZT0 state around function calls (#78321)
If a function has ZT0 state and calls a function which does not
preserve ZT0, the caller must save and restore ZT0 around the call.
If the caller shares ZT0 state and the callee is not shared ZA, we must
additionally call SMSTOP/SMSTART ZA around the call.

This patch adds new AArch64ISDNodes for spilling & filling ZT0.
Where requiresPreservingZT0 is true, ZT0 state will be preserved
across a call.
2024-01-20 12:06:00 +00:00
Congcong Cai
fd3346dba8 [clang-tidy] fix modernize-use-auto incorrect fix hints for pointer (#77943) 2024-01-20 20:05:22 +08:00
Jay Foad
63d7ca924f [AMDGPU] Add GFX12 llvm.amdgcn.s.wait.*cnt intrinsics (#78723) 2024-01-20 11:44:42 +00:00
LLVM GN Syncbot
920bb5430a [gn build] Port 7a8f5d97af 2024-01-20 09:52:13 +00:00
Bharathi Ramana Joshi
d70bfeb4e1 [MLIR][Presburger] Implement IntegerRelation::setId (#77872) 2024-01-20 15:19:10 +05:30
Félix-Antoine Constantin
7a8f5d97af [clang-tidy] Added new check to detect redundant inline keyword (#73069)
This checks find usages of the inline keywork where it is already
implicitly defined by the compiler and suggests it's removal.

Fixes #72397
2024-01-20 10:45:59 +01:00
LLVM GN Syncbot
14d59527e7 [gn build] Port 1ad1f981a6 2024-01-20 09:11:11 +00:00
Piotr Zegar
1ad1f981a6 [clang-tidy] Add readability-redundant-casting check (#70595)
Detects explicit type casting operations that involve the same source
and destination types, and subsequently recommend their removal. Covers
a range of explicit casting operations. Its primary objective is to
enhance code readability and maintainability by eliminating unnecessary
type casting.

Closes #67534
2024-01-20 10:11:05 +01:00
Stefan Gränitz
6a433d77b1 [llvm-jitlink] Allow optional stub-kind filter in stub_addr() expressions (#78369)
We use `jitlink-check` lines in LIT tests as the primary tool for
testing JITLink backends. Parsing and evaluation of the expressions is
implemented in `RuntimeDyldChecker`. The `stub_addr(obj, name)`
expression allows to obtain the linker-generated stub for the external
symbol `name` in object file `obj`.

This patch adds support for a filter parameter to select one out of many
stubs. This is necessary for the AArch32 JITLink backend, which must be
able to emit two different kinds of stubs depending on the instruction
set state (Arm/Thumb) of the relocation site. Since the new parameter is
optional, we don't have to update existing tests.

Filters are regular expressions without brackets that match exactly one
existing stub. Given object file `armv7.o` with two stubs for external
function `ext` of kinds `armv7_abs_le` and `thumbv7_abs_le`, we get the
following filter results e.g.:
```
stub_addr(armv7.o, ext, thumb)        thumbv7_abs_le
stub_addr(armv7.o, ext, thumbv7)      thumbv7_abs_le
stub_addr(armv7.o, ext, armv7_abs_le) armv7_abs_le
stub_addr(armv7.o, ext, v7_.*_le)     Error: "ext" has 2 candidate stubs in file "armv7.o". Please refine stub-kind filter "v7_.*_le" for disambiguation (encountered kinds are "thumbv7_abs_le", "armv7_abs_le").
stub_addr(armv7.o, ext, v8)           Error: "ext" has 2 stubs in file "armv7.o", but none of them matches the stub-kind filter "v8" (all encountered kinds are "thumbv7_abs_le", "armv7_abs_le").
```
2024-01-20 09:57:03 +01:00
Vlad Serebrennikov
9eb0f86c27 [clang] Implement CWG1878 "operator auto template" (#78103)
C++14 introduced deduced return type for regular functions, but shortly after [CWG1878](https://wg21.link/cwg1878) was filed and resolved to disallow deduced return types in conversion function templates. So this patch diagnoses such usage of deduced return type in C++14 mode onwards.

Fixes #51776
2024-01-20 12:23:08 +04:00
Owen Pan
a7d7da6e45 [clang-format] Add SkipMacroDefinitionBody option (#78682)
Closes #67991.

See also: #70338

Co-authored-by: @tomekpaszek
2024-01-20 00:08:23 -08:00
Piotr Zegar
296fbee5af [clang-tidy] Fix crash in modernize-loop-convert when int is used as iterator (#78796)
Fix crash when built-in type (like int) is used as iterator, or when
call to begin() return integer.

Closes #78381
2024-01-20 08:48:09 +01:00
Fangrui Song
4b500147f0 [ELF] Improve LTO tests
Make it easy to change --save-temps filenames to follow COFF
(https://reviews.llvm.org/D137217).
2024-01-19 23:44:40 -08:00
Vitaly Buka
14ca0ac915 [fuzzer,test] Remove old debug logging 2024-01-19 23:27:32 -08:00
Vitaly Buka
3e3d74af86 Reapply "[sanitizer] Skip /include/c++/ from summary (#78534)"
Keep linux only test.

This reverts commit 4619147911.
2024-01-19 23:25:13 -08:00