- Oct 10, 2023
-
-
Tom Stellard authored
(cherry picked from commit 95b2c6b3)
-
Martin Storsjö authored
This should fix #66912. When emitting SEH unwind info, we need to be able to calculate the exact length of functions before alignments are fixed. Until that limitation is overcome, just disable all loop alignment on Windows targets. (cherry picked from commit 6ae36c01)
-
Shoaib Meenai authored
Right now, `-Wformat` for a scoped enum will suggest a cast based on the format specifier being used. This can lead to incorrect results, e.g. attempting to format a scoped enum with `%s` would suggest casting to `char *` instead of fixing the specifier. Change the logic to treat the scoped enum's underlying type as the intended type to be printed, and suggest format specifier changes and casts based on that. (cherry picked from commit 0b07b06e)
-
- Oct 03, 2023
-
-
René Rebe authored
This addresses missing cmake files needed to build some sub-projects like libstdcxx. Co-authored-by:René Rebe <rene@exactcode.de>
-
Arthur Eubanks authored
Otherwise they may mistakenly get the large section flag. (cherry picked from commit b915f606) (fix was slightly different since cherry-pick didn't apply well)
-
Tobias Hieta authored
[workflow] Fix abi checker in llvm-tests. Same fix as in 99fb0af8 (#67957) Fixes #67651
-
Martin Storsjö authored
Prior to 591c4b64, the mingw specific linker options -mthreads, -mconsole, -mwindows and -mdll would be tolerated also at compile time, but generating a warning about being unused. After that commit, they were marked as target specific, which means that it's an error if they're unused (which would consider them used for the wrong target). These specific options are only relevant when linking, but we want to tolerate them at compile time too, like before. This was fixed for -mthreads in a79995ca, while the other options didn't seem to be commonly used during compilation. After the 17.x release, we've got more reports about this actually being an issue, in #64464. Therefore, apply the same fix for them; marking them as tolerated for mingw targets during compilation, even if they're unused. Also add a testcase for -mthreads which was already handled. Thus, this fixes #64464. (cherry picked from commit e39de2b8) Adapted from the original commit; the test in the original commit depended on f39c399d. Instead of using -###, when we're not actually using the printed output of -###, instead use -fdriver-only.
-
Martin Storsjö authored
Before af744f0b, the first entry among the search paths was the empty string, indicating searching in (or starting from) the current directory. After af744f0b, the toolchain/clang specific lib directories were added at the head of the search path. This would cause lookups of literal file names or relative paths to match paths in the toolchain, if there are coincidental files with similar names there, even if they would be find in the current directory as well. Change addClangLibSearchPaths to append to the list like all other operations on searchPaths - but move the invocation of the function to the right place in the sequence. This fixes #67779. (cherry picked from commit f906fd53)
-
Martin Storsjö authored
Also switch the test case to use -NEXT to strictly match all lines. (cherry picked from commit 7d7d9e46)
-
Matheus Izvekov authored
In order to reduce noise for a MR. (cherry picked from commit a5e280bc)
-
Martin Storsjö authored
This reverts one part of commit 9f4dfcb7, with a modified comment added about the code. Ideally, this would only be reinstated temporarily - but given the situation in vcpkg, it looks likely that they would keep passing the duplicate options for quite some time. The conflicting CRT choice usually are benign but only would cause warnings about one option overriding the other, if passing e.g. "/MDd /MT". However when vcpkg currently sets these options in CMAKE_*_FLAGS_DEBUG, it passes the redundant option /D_DEBUG; thus the compiler finally ends up with e.g. "/D_DEBUG /MDd /MT", which has the effect of defining _DEBUG while using a release mode CRT, which allegedly breaks the build. There's a PR up for removing this redundant /D_DEBUG option in vcpkg in https://github.com/microsoft/vcpkg/pull/34123. With that in place, this change wouldn't be strictly needed. (cherry picked from commit 7bc09a47)
-
- Sep 29, 2023
-
-
DianQK authored
Alias metadata may no longer be valid after replacing the call argument. Fix this by merging it with the memcpy alias metadata. This fixes a miscompilation encountered in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Failing.20tests.20when.20rustc.20is.20compiled.20with.201.20CGU. (cherry picked from commit 4e6e4763)
-
Nikita Popov authored
(cherry picked from commit d5c8b23b)
-
Argyrios Kyrtzidis authored
[DependencyScanningFilesystem] Make sure the local/shared cache filename lookups use only absolute paths (#66122) Previously a relative path would be used as a key for cache lookup and if the same relative path was used from another compiler invocation with a different working directory then the first cache entry was erroneously returned. (cherry picked from commit 36b37c77)
-
Shoaib Meenai authored
`Lexer::getLocForEndOfToken` is documented as returning an invalid source location when the end of the token is inside a macro expansion. We don't want that for this particular application, so just calculate the end location directly instead. Before this, format fix-its would omit the closing parenthesis (thus producing invalid code) for macros, e.g.: ``` $ cat format.cpp extern "C" int printf(const char *, ...); enum class Foo { Bar }; #define LOG(...) printf(__VA_ARGS__) void f(Foo foo) { LOG("%d\n", foo); } $ clang -fsyntax-only format.cpp format.cpp:4:29: warning: format specifies type 'int' but the argument has type 'Foo' [-Wformat] 4 | void f(Foo f) { LOG("%d\n", f); } | ~~ ^ | static_cast<int>( format.cpp:3:25: note: expanded from macro 'LOG' 3 | #define LOG(...) printf(__VA_ARGS__) | ^~~~~~~~~~~ 1 warning generated. ``` We now emit a valid fix-it: ``` $ clang -fsyntax-only format.cpp format.cpp:4:31: warning: format specifies type 'int' but the argument has type 'Foo' [-Wformat] 4 | void f(Foo foo) { LOG("%d\n", foo); } | ~~ ^~~ | static_cast<int>( ) format.cpp:3:25: note: expanded from macro 'LOG' 3 | #define LOG(...) printf(__VA_ARGS__) | ^~~~~~~~~~~ 1 warning generated. ``` Fixes https://github.com/llvm/llvm-project/issues/63462 (cherry picked from commit 61c5ad88) -
Artem Belevich authored
Fixes https://github.com/llvm/llvm-project/issues/57544 (cherry picked from commit 588023dd)
-
Alex Langford authored
In a8097201 I refactored some logic to deal with the clang resource directory in standalone LLDB builds. However, this logic escaped me because it only runs when you do not build LLDB.framework. Differential Revision: https://reviews.llvm.org/D156763 (cherry picked from commit 6888de11)
-
Alex Langford authored
As of 0beffb85 there is a CMake function to actually calculate the relative path to the clang resource directory. Currently we have some bespoke logic that looks in a few places, but with this new function we should be able to eliminate some complexity here. Also, I moved the functionality from LLDBConfig to LLDBStandalone since it is only used in standalone builds. Differential Revision: https://reviews.llvm.org/D156270 (cherry picked from commit a8097201)
-
Wael Yehia authored
Co-authored-by:
Wael Yehia <wyehia@ca.ibm.com> (cherry picked from commit da55b1b5)
-
- Sep 28, 2023
-
-
namazso authored
Fixes EHCont implementation in LLD. Closes #64570 Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D157623 (cherry picked from commit e335c78e)
- Sep 27, 2023
-
-
Tulio Magno Quites Machado Filho authored
lit tests require commands FileCheck and not. They must be available in the PATH. This also guarantees that python3-psutil is installed in order to enable more tests. Fixes #64892. (cherry picked from commit b2247f85)
-
Nikita Popov authored
This is a followup to #66988. The implementation there did not account for the possibility of the catch object frame index referrring to a fixed object, which is the case on win64. (cherry picked from commit aa70f4d8)
-
Nikita Popov authored
The write to the SEH catch object happens before cleanuppads are executed, while the first reference to the object will typically be in a catchpad. If we make use of first-use analysis, we may end up allocating an alloca used inside the cleanuppad and the catch object at the same stack offset, which would be incorrect. https://reviews.llvm.org/D86673 was a previous attempt to fix it. It used the heuristic "a slot loaded in a WinEH pad and never written" to detect catch objects. However, because it checks for more than one load (while probably more than zero was intended), the fix does not actually work. The general approach also seems dubious to me, so this patch reverts that change entirely, and instead marks all catch object slots as conservative (i.e. excluded from first-use analysis) based on the WinEHFuncInfo. As far as I can tell we don't need any heuristics here, we know exactly which slots are affected. Fixes https://github.com/llvm/llvm-project/issues/66984. (cherry picked from commit b3cb4f06)
-
Nikita Popov authored
(cherry picked from commit 8b4e29b3)
-
Nikita Popov authored
When unswitching via invariant condition injection, we currently mark the condition in the old loop, so that it does not get unswitched again. However, if there are multiple branches for which conditions can be injected, then we can do that for both the old and new loop. This means that the number of unswitches increases exponentially. Change the handling to be more similar to partial unswitching, where we instead mark the whole loop, rather than a single condition. This means that we will only generate a linear number of loops. TBH I think even that is still highly undesirable, and we should probably be unswitching all candidates at the same time, so that we end up with only two loops. But at least this mitigates the worst case. The test case is a reduced variant that generates 1700 lines of IR without this patch and 290 with it. Fixes https://github.com/llvm/llvm-project/issues/66868. (cherry picked from commit 8362cae7)
-
Nikita Popov authored
The in-loop successor is only on the left after a potential condition inversion. As we re-use the old condition as-is, we should also reuse the old successors as-is. Fixes https://github.com/llvm/llvm-project/issues/63962. (cherry picked from commit afd7db48)
-
Antonio Frighetto authored
(cherry picked from commit c990d944)
-
Antonio Frighetto authored
An assertion issue that arose when handling union member access with virtual base class has been addressed. As pointed out by @zygoloid, there is no need for further derived-to-base analysis in this instance, so we can bail out upon encountering a virtual base class. Minor refinement on the function name as we might not be handling a union. Reported-By: ormris Fixes: https://github.com/llvm/llvm-project/issues/65982 (cherry picked from commit 660876a4)
-
Takuya Shimizu authored
When the caret location is lower than the lowest source range, clang is printing wrong line numbers. The first line number should consider caret location line even when there are source ranges provided. Current wrong line example: https://godbolt.org/z/aj4qEjzs4 (cherry picked from commit ef5217b3)
-
Kazu Hirata authored
This reverts commit d6f994ac. Several people have reported breakage resulting from this patch: - https://github.com/llvm/llvm-project/issues/65152 - https://github.com/llvm/llvm-project/issues/65205 (cherry picked from commit b4301df6)
-
- Sep 25, 2023
-
-
Nikita Popov authored
Followup to D158849: We also need to remove the phi node from the VN table, which is not handled by removeInstruction(). Fixes https://github.com/llvm/llvm-project/issues/65447. (cherry picked from commit 18e77760)
-
Nikita Popov authored
Duplicate phi nodes were being directly removed, without invalidating MDA. This could result in a new phi node being allocated at the same address, incorrectly reusing a cache entry. Fix this by optionally allowing EliminateDuplicatePHINodes() to collect phi nodes to remove into a vector, which allows GVN to handle removal itself. Fixes https://github.com/llvm/llvm-project/issues/64598. Differential Revision: https://reviews.llvm.org/D158849 (cherry picked from commit 7c229f6e)
-
Tobias Hieta authored
-
paulwalker-arm authored
The stores created when passing operands via memory don't typically maintain the chain, because they can be done in any order. Instead, a new chain is created based on all collated stores. SVE parameters passed via memory don't follow this idiom and try to maintain the chain, which unfortunately can result in them being incorrectly deadcoded when the chain is recreated. This patch brings the SVE side in line with the non-SVE side to ensure no stores become lost whilst also allowing greater flexibility when ordering the stores.
-
Paul Walker authored
When calling func_f8_and_v0_passed_via_memory the memory used to hold the first vector operand is allocated but not initialised.
-
- Sep 19, 2023
-
-
Tobias Hieta authored
-
Tobias Hieta authored
-
- Sep 18, 2023
-
-
Chuanqi Xu authored
This reverts commit f05226d7.
-