- Jul 13, 2022
-
-
Simon Pilgrim authored
Fix unused static function warning introduced by D129207
-
Kai Nacke authored
Some rework of getStackGuard() based on comments in https://reviews.llvm.org/D129505. - getStackGuard() now creates and returns the destination register, simplifying calls - the pointer type is passed to getStackGuard() to avoid recomputation - removed PtrMemTy in emitSPDescriptorParent(), because this type is only used here when loading the value but not when storing the value Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D129576
-
Augie Fackler authored
I have no idea what's going on here. This code was moved around/introduced in change cb26b01d and starts crashing with a NULL dereference once I apply https://reviews.llvm.org/D123090. I assume that I've unwittingly taught the attributor enough that it's able to do more clever things than in the past, and it's able to trip on this case. I make no claims about the correctness of this patch, but it passes tests and seems to fix all the crashes I've been seeing. Differential Revision: https://reviews.llvm.org/D129589
-
Jonas Devlieghere authored
Unlike Python 2 which reports 10.16 on any recent macOS, Python 3 correctly reports Ventura as macOS 13.
-
Jacques Pienaar authored
Avoids needing the two parallel functions as NamedAttrList already takes care of caching DictionaryAttr and implicitly can convert from either. Differential Revision: https://reviews.llvm.org/D129527
-
Sunho Kim authored
Differential Revision: https://reviews.llvm.org/D129582
-
Jonas Devlieghere authored
This fixes the static assert that's meant to keep the g_arguments_data table in sync with the CommandArgumentType enumeration. Indeed, the assert didn't fire even though the current code is missing an entry. This patches fixes that as well. Differential revision: https://reviews.llvm.org/D129529
-
Simon Pilgrim authored
-
Sam McCall authored
This was added in 2a095ff6, however it never worked with VSCode due to bugs in vscode-languageclient (https://github.com/microsoft/vscode-languageserver-node/issues/673). Now that it does work, we can tell the interactions with text editing, with snippets, and vscode's select-first-completion behavior are bad. The spec is vague and clients could do something reasonable with the current values. However they could clearly do something unreasonable too, and over time behavior+spec tends to converge on VSCode's behavior. This addresses https://github.com/clangd/vscode-clangd/pull/358 See also https://github.com/clangd/vscode-clangd/pull/358 which hotfixes this on the client-side (as we can't apply this change retroactively to clangd 12-14). Differential Revision: https://reviews.llvm.org/D129579
-
David Blaikie authored
-
sunho authored
-
Aaron Ballman authored
There is a failing bot: http://45.33.8.238/macm1/40002/step_7.txt It looks to be failing because of a regex and how it handles whitespace, so modifying the CHECK line slightly to account for that.
-
Mark de Wever authored
This was already reviewed as D128603. This contains only the updates to the test script. Differential Revision: https://reviews.llvm.org/D129578
-
Nico Weber authored
Like https://reviews.llvm.org/D129226, but for iOS. No behavior change. Differential Revision: https://reviews.llvm.org/D129569
-
Sunho Kim authored
This fixes the buildbot failure in release only buildbots.
-
LLVM GN Syncbot authored
-
Sunho Kim authored
Adds initial COFF support in JITLink. This is able to run a hello world c program in x86 windows successfully. Implemented - COFF object loader - Static local symbols - Absolute symbols - External symbols - Weak external symbols - Common symbols - COFF jitlink-check support - All COMDAT selection type execpt largest - Implicit symobl size calculation - Rel32 relocation with PLT stub. - IMAGE_REL_AMD64_ADDR32NB relocation Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D128968
-
Craig Topper authored
To convert CTLZ to popcount we do x = x | (x >> 1); x = x | (x >> 2); ... x = x | (x >>16); x = x | (x >>32); // for 64-bit input return popcount(~x); This smears the most significant set bit across all of the bits below it then inverts the remaining 0s and does a population count. To support non-power of 2 types, the last shift amount must be more than half of the size of the type. For i15, the last shift was previously a shift by 4, with this patch we add another shift of 8. Fixes PR56457. Differential Revision: https://reviews.llvm.org/D129431
-
Craig Topper authored
-
YongKang Zhu authored
When `--symbol-ordering-file` is specified, the linker today will always put hot contributions in the middle of cold ones when targeting RISC machine, so to minimize the chances that branch thunks need be generated for hot code calling into cold code. This is not necessary when user specifies an ordering of read-only data (vs. function) symbols, or when output section is small such that no branch thunk would ever be required. The latter is common for mobile apps. For example, among all the native ARM64 libraries in Facebook Instagram App for Android, 80% of them have text section smaller than 64KB and the largest text section seen is less than 8MB, well below the distance that a BRANCH26 can reach. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D128382
-
David Tenty authored
This header need not be included on non-z/OS IBM platforms (and indeed will add nothing when it is), so add a guard. This let's us remove the header without things breaking when shipping libc++ for AIX. Reviewed By: hubert.reinterpretcast, fanbo-meng Differential Revision: https://reviews.llvm.org/D129493
-
Sunil Srivastava authored
Differential Revision: https://reviews.llvm.org/D129404
-
Hans Wennborg authored
Recent CMake versions have started to prefer llvm-mt when using clang-cl, which doesn't work at all when llvm-mt is built without libxml which has been the case so far. See https://github.com/llvm/llvm-project/issues/55817 Differential revision: https://reviews.llvm.org/D129571
-
Pavel Labath authored
We need to check for the error inside the value object to avoid reading garbage through invalid (target) pointers.
-
Aaron Ballman authored
This mostly finishes the DRs in the 200s. There are a few DRs left which will require more thought and work to test.
-
Mitch Phillips authored
-
Yuanfang Chen authored
It is illegal to merge two `llvm.coro.save` calls unless their `llvm.coro.suspend` users are also merged. Marks it "nomerge" for the moment. This reverts D129025. Alternative to D129025, which affects other token type users like WinEH. Reviewed By: ChuanqiXu Differential Revision: https://reviews.llvm.org/D129530
-
Mark de Wever authored
-
Mark de Wever authored
This is a preparation to look at possible performance improvements. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D129421
-
Mark de Wever authored
In our implementation the year is always less than or equal to the class' `max()`. It's unlikely this ever changes since changing the year's range will be an ABI break. A static_assert is added as a guard. This was reported by @philnik. Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D129442
-
Aaron Ballman authored
This addresses the failure with: https://lab.llvm.org/buildbot/#/builders/92/builds/29618
-
Nico Weber authored
-
LLVM GN Syncbot authored
-
Roy Jacobson authored
Some compiler provided type traits like __has_trivial_constructor have been documented as deprecated for quite some time. Still, some people apparently still use them, even though mixing them with concepts and with deleted functions leads to weird results. There's also disagreement about some edge cases between GCC (which Clang claims to follow) and MSVC. This patch adds deprecation warnings for the usage of those builtins, except for __has_trivial_destructor which doesn't have a GCC alternative. I made the warning on by default, so I had to silence it for some tests but it's not too many. Some (decade old) history of issues with those builtins: https://github.com/llvm/llvm-project/issues/18187 https://github.com/llvm/llvm-project/issues/18559 https://github.com/llvm/llvm-project/issues/22161 https://github.com/llvm/llvm-project/issues/33063 The abseil usage of them that triggered me to add this warning: https://github.com/abseil/abseil-cpp/issues/1201 Weird interaction of those builtins with C++20's conditionally trivial special member functions: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106085 Reviewed By: #clang-language-wg, aaron.ballman Differential Revision: https://reviews.llvm.org/D129170
-
Nick Desaulniers authored
Adds support for: * `-mfunction-return=<value>` command line flag, and * `__attribute__((function_return("<value>")))` function attribute Where the supported <value>s are: * keep (disable) * thunk-extern (enable) thunk-extern enables clang to change ret instructions into jmps to an external symbol named __x86_return_thunk, implemented as a new MachineFunctionPass named "x86-return-thunks", keyed off the new IR attribute fn_ret_thunk_extern. The symbol __x86_return_thunk is expected to be provided by the runtime the compiled code is linked against and is not defined by the compiler. Enabling this option alone doesn't provide mitigations without corresponding definitions of __x86_return_thunk! This new MachineFunctionPass is very similar to "x86-lvi-ret". The <value>s "thunk" and "thunk-inline" are currently unsupported. It's not clear yet that they are necessary: whether the thunk pattern they would emit is beneficial or used anywhere. Should the <value>s "thunk" and "thunk-inline" become necessary, x86-return-thunks could probably be merged into x86-retpoline-thunks which has pre-existing machinery for emitting thunks (which could be used to implement the <value> "thunk"). Has been found to build+boot with corresponding Linux kernel patches. This helps the Linux kernel mitigate RETBLEED. * CVE-2022-23816 * CVE-2022-28693 * CVE-2022-29901 See also: * "RETBLEED: Arbitrary Speculative Code Execution with Return Instructions." * AMD SECURITY NOTICE AMD-SN-1037: AMD CPU Branch Type Confusion * TECHNICAL GUIDANCE FOR MITIGATING BRANCH TYPE CONFUSION REVISION 1.0 2022-07-12 * Return Stack Buffer Underflow / Return Stack Buffer Underflow / CVE-2022-29901, CVE-2022-28693 / INTEL-SA-00702 SystemZ may eventually want to support "thunk-extern" and "thunk"; both options are used by the Linux kernel's CONFIG_EXPOLINE. This functionality has been available in GCC since the 8.1 release, and was backported to the 7.3 release. Many thanks for folks that provided discrete review off list due to the embargoed nature of this hardware vulnerability. Many Bothans died to bring us this information. Link: https://www.youtube.com/watch?v=IF6HbCKQHK8 Link: https://github.com/llvm/llvm-project/issues/54404 Link: https://gcc.gnu.org/legacy-ml/gcc-patches/2018-01/msg01197.html Link: https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/advisory-guidance/return-stack-buffer-underflow.html Link: https://arstechnica.com/information-technology/2022/07/intel-and-amd-cpus-vulnerable-to-a-new-speculative-execution-attack/?comments=1 Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce114c866860aa9eae3f50974efc68241186ba60 Link: https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00702.html Link: https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00707.html Reviewed By: aaron.ballman, craig.topper Differential Revision: https://reviews.llvm.org/D129572 -
Chuanqi Xu authored
There were two assertions in DefaultArgStorage::setInherited previously. It requires the DefaultArgument is either empty or an argument value. It would crash if it has a pointer refers to the previous declaration or contains a chain to the previous declaration. But there are edge cases could hit them actually. One is InheritDefaultArguments.cppm that I found recently. Another one is pr31469.cpp, which was created fives years ago. This patch tries to fix the two failures by handling full cases in DefaultArgStorage::setInherited. This is guaranteed to not introduce any breaking change since it lives in the path we wouldn't touch before. And the added assertions for sameness should keep the correctness. Reviewed By: v.g.vassilev Differential Revision: https://reviews.llvm.org/D128974
-
Mariusz Borsa authored
This is to finish the change started by D125816 , D126263 and D126577 (replace SANITIZER_MAC by SANITIZER_APPLE). Dropping definition of SANITIZER_MAC completely, to remove any possible confusion. Differential Revision: https://reviews.llvm.org/D129502
- Jul 12, 2022
-
-
Chuanqi Xu authored
parameters. The current implementation to judge the similarity of TypeConstraint in ASTContext::isSameTemplateParameter is problematic, it couldn't handle the following case: ```C++ template <__integer_like _Tp, C<_Tp> Sentinel> constexpr _Tp operator()(_Tp &&__t, Sentinel &&last) const { return __t; } ``` When we see 2 such declarations from different modules, we would judge their similarity by `ASTContext::isSame*` methods. But problems come for the TypeConstraint. Originally, we would profile each argument one by one. But it is not right. Since the profiling result of `_Tp` would refer to two different template type declarations. So it would get different results. It is right since the `_Tp` in different modules refers to different declarations indeed. So the same declaration in different modules would meet incorrect our-checking results. It is not the thing we want. We want to know if the TypeConstraint have the same expression. Reviewer: vsapsai, ilya-biryukov Differential Revision: https://reviews.llvm.org/D129068
-