| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GPRs on RV64
Summary:
This patch fixed the error of counting the remaining FPRs. Complex floating-point
values should be passed by two FPRs for the hard-float ABI. If no two FPRs are
available, it should be passed via a 64-bit GPR (fp+fp). `ArgFPRsLeft` is only
decreased one while the type is complex floating-point. It causes two floating-point
values in the complex are passed separately by two GPRs.
Reviewers: asb, luismarques, lenary
Reviewed By: asb
Subscribers: rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, s.egerton, pzheng, sameer.abuasal, apazos, evandro, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79770
(cherry picked from commit 7ee479a760e0a4402b4eb7fb6168768a44f66945)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
D68391 added tests that check scenarios where no RISC-V GCC toolchain is
supposed to be detected. When running the tests on RISC-V hosts the system's
GCC toolchain will be detected, and the tests will fail. This patch adds a
`--gcc-toolchain` option pointing to a path where no GCC toolchain is
present, ensuring that the tests are run under the expected conditions, and
therefore are able to pass in all test environments.
Differential Revision: https://reviews.llvm.org/D75061
(cherry picked from commit 91f7f0d8e3ef2b6be07bc9621de075ff11c730c9)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Gadgets
Adds a new data structure, ImmutableGraph, and uses RDF to find LVI gadgets and add them to a MachineGadgetGraph.
More specifically, a new X86 machine pass finds Load Value Injection (LVI) gadgets consisting of a load from memory (i.e., SOURCE), and any operation that may transmit the value loaded from memory over a covert channel, or use the value loaded from memory to determine a branch/call target (i.e., SINK).
Also adds a new target feature to X86: +lvi-load-hardening
The feature can be added via the clang CLI using -mlvi-hardening.
Differential Revision: https://reviews.llvm.org/D75936
|
|
|
|
|
|
| |
not enabled with LVI-CFI
Differential Revision: https://reviews.llvm.org/D77427
|
|
|
|
|
|
|
|
|
| |
Injection (LVI) Gadgets"
This reverts commit c74dd640fd740c6928f66a39c7c15a014af3f66f.
Reverting to address coding standard issues raised in post-commit
review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Gadgets
Adds a new data structure, ImmutableGraph, and uses RDF to find LVI gadgets and add them to a MachineGadgetGraph.
More specifically, a new X86 machine pass finds Load Value Injection (LVI) gadgets consisting of a load from memory (i.e., SOURCE), and any operation that may transmit the value loaded from memory over a covert channel, or use the value loaded from memory to determine a branch/call target (i.e., SINK).
Also adds a new target feature to X86: +lvi-load-hardening
The feature can be added via the clang CLI using -mlvi-hardening.
Differential Revision: https://reviews.llvm.org/D75936
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This pass replaces each indirect call/jump with a direct call to a thunk that looks like:
lfence
jmpq *%r11
This ensures that if the value in register %r11 was loaded from memory, then
the value in %r11 is (architecturally) correct prior to the jump.
Also adds a new target feature to X86: +lvi-cfi
("cfi" meaning control-flow integrity)
The feature can be added via clang CLI using -mlvi-cfi.
This is an alternate implementation to https://reviews.llvm.org/D75934 That merges the thunk insertion functionality with the existing X86 retpoline code.
Differential Revision: https://reviews.llvm.org/D76812
|
|
|
|
|
|
|
| |
D80647 did not fix https://bugs.llvm.org/show_bug.cgi?id=46076
This is the fix.
(cherry picked from commit b9c6871a9570975827dc0bbeb39131c99c8daf8e)
|
|
|
|
|
|
|
|
|
|
| |
Fixes https://bugs.llvm.org/show_bug.cgi?id=46076
Reviewed By: nickdesaulniers, pcc
Differential Revision: https://reviews.llvm.org/D80647
(cherry picked from commit a2a3e9f0a6e91103a0d1fa73086dbdf109c48f69)
|
|
|
|
|
|
|
|
|
|
|
|
| |
We currently emit incorrect codegen for this constraint because we set it as a
constraint that allows registers. This will cause the value to be copied to the
stack and that address to be passed as the address. This is not what we want.
Fixes: https://bugs.llvm.org/show_bug.cgi?id=42762
Differential revision: https://reviews.llvm.org/D77542
(cherry picked from commit aede24ecaa08db806fb173faf2de9cff95df8cee)
|
|
|
|
|
|
|
|
|
|
|
| |
This is the first checkin to support Marvell ThunderX3T110.
Initial definition of the micro-ops of the instructions in ThunderX3T110
is included.
Differential Revision: https://reviews.llvm.org/D78129
(cherry picked from commit 382d3a85e2a9269569e7fb8caa487d7ef57900c6)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fix https://github.com/clangd/clangd/issues/293
Reviewers: sammccall
Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D76320
(cherry picked from commit bd763e2cf7c1d84bab95064cc5cbe542b227b025)
|
|
|
|
|
|
| |
with an invalid scope specifier.
(cherry picked from commit 44c3a63c74dddeef17e424ec76bd90c8582d8a3c)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixes https://github.com/clangd/clangd/issues/309
Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77194
(cherry picked from commit 8b3b7556e9ab6084e9fd337d64dac1c165867d32)
|
|
|
|
|
|
| |
of array new expressions with runtime bound.
(cherry picked from commit 9a7eda1bece887ca9af085d79fe6e4fb8826dcda)
|
|
|
|
|
|
|
|
|
|
|
| |
In cases where we have multiple decls of an inline builtin, we may need
to go hunting for the one with a definition when setting function
attributes.
An additional test-case was provided on
https://github.com/ClangBuiltLinux/linux/issues/979
(cherry picked from commit 94908088a831141cfbdd15fc5837dccf30cfeeb6)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are some inline builtin definitions that we can't emit
(isTriviallyRecursive & callers go into why). Marking these
nobuiltin is only useful if we actually emit the body, so don't mark
these as such unless we _do_ plan on emitting that.
This suboptimality was encountered in Linux (see some discussion on
D71082, and https://github.com/ClangBuiltLinux/linux/issues/979).
Differential Revision: https://reviews.llvm.org/D78162
(cherry picked from commit 2dd17ff08165e6118e70f00e22b2c36d2d4e0a9a)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
initializers
Summary:
We extend the behavior for local functions and methods of local classes
to lambdas in variable initializers. The initializer is not a separate
scope, but we treat it as such.
We also remove the (faulty) instantiation of default arguments in
TreeTransform::TransformLambdaExpr, because it doesn't do proper
initialization, and if it did, we would do it twice (and thus also emit
eventual errors twice).
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D76038
(cherry picked from commit f43859a099fa3587123717be941fa63ba8d0d4f2)
|
|
|
|
|
|
|
|
| |
Reviewed By: nickdesaulniers
Differential Revision: https://reviews.llvm.org/D79495
(cherry picked from commit 57a1c1be53aeea521747dd2f4b0097831341bea5)
|
|
|
|
|
|
|
| |
This comes up when substituting into an already-substituted template
argument during constraint satisfaction checking.
(cherry picked from commit b20ab412bf838a8a87e5cc1c8c6399c3c9255354)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FinishThunk, and the invariant of setting and then unsetting
CurCodeDecl, was added in 7f416cc42638 (2015). The invariant didn't
exist when I added this musttail codepath in ab2090d10765 (2014).
Recently in 28328c3771, I started using this codepath on non-Windows
platforms, and users reported problems during release testing (PR44987).
The issue was already present for users of EH on i686-windows-msvc, so I
added a test for that case as well.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D76444
(cherry picked from commit ce5173c0e174870934d1b3a026f631d996136191)
|
|
|
|
|
|
|
|
|
| |
This fixes an issue with clang issuing a warning about unknown CUDA SDK if it's
detected during non-CUDA compilation.
Differential Revision: https://reviews.llvm.org/D76030
(cherry picked from commit eb2ba2ea953b5ea73cdbb598f77470bde1c6a011)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
annotates an invalid template-id
TryAnnotateTypeConstraint could annotate a template-id which doesn't end up being a type-constraint,
in which case control flow would incorrectly flow into ParseImplicitInt.
Reenter the loop in this case.
Enable relevant tests for C++20. This required disabling typo-correction during TryAnnotateTypeConstraint
and changing a test case which is broken due to a separate bug (will be reported and handled separately).
(cherry picked from commit 19fccc52ff2c1da1f93d9317c34769bd9bab8ac8)
|
|
|
|
|
|
|
|
|
| |
We would assign the incorrect DeclContext when transforming the RequiresExprBodyDecl, causing incorrect
handling of 'this' inside RequiresExprBodyDecls (bug #45162).
Assign the current context as the DeclContext of the transformed decl.
(cherry picked from commit 9769e1ee9acc33638449b50ac394b5ee2d4efb60)
|
|
|
|
|
|
|
|
|
| |
RequiresExprBodyDecl"
We're not planning more release candidates for 10.0.0 at the moment, so
reverting for now.
This reverts commit 9e0bd5ec03cbc8d53048e92ddf7fd25bca17e912.
|
|
|
|
|
|
|
|
|
| |
annotates an invalid template-id"
We're not planning more release candidates for 10.0.0 at the moment, so
reverting for now.
This reverts commit 135744ce689569e7c64033bb5812572d3000239b.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
annotates an invalid template-id
TryAnnotateTypeConstraint could annotate a template-id which doesn't end up being a type-constraint,
in which case control flow would incorrectly flow into ParseImplicitInt.
Reenter the loop in this case.
Enable relevant tests for C++20. This required disabling typo-correction during TryAnnotateTypeConstraint
and changing a test case which is broken due to a separate bug (will be reported and handled separately).
(cherry picked from commit 19fccc52ff2c1da1f93d9317c34769bd9bab8ac8)
|
|
|
|
|
|
|
|
|
| |
We would assign the incorrect DeclContext when transforming the RequiresExprBodyDecl, causing incorrect
handling of 'this' inside RequiresExprBodyDecls (bug #45162).
Assign the current context as the DeclContext of the transformed decl.
(cherry picked from commit 9769e1ee9acc33638449b50ac394b5ee2d4efb60)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a dependent context.
This matches the GCC behavior.
We track the enclosing template depth when determining whether a
statement expression is within a dependent context; there doesn't appear
to be any other reliable way to determine this.
We previously assumed they were neither value- nor
instantiation-dependent under any circumstances, which would lead to
crashes and other misbehavior.
(cherry picked from commit 5c845c1c50ac89a6f12557d1571678f3d1432478)
|
|
|
|
|
|
|
|
|
| |
appear in"
This turned out to cause problems, and was reverted on master together
with its follow-up change in 66addf8e803618758457e4d578c5084e322ca448.
This reverts commit 3a843031a5ad83a00d2603f623881cb2b2bf719d.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
deduction guides.
Previously if an implicit deduction guide had a default argument with a
cleanup, we'd leave the 'pending cleanup' flag set after declaring the
implicit guide. But it turns out that there's no reason to even
substitute into the default argument when declaring an implicit
deduction guide: we only need to record that the default argument
exists, not what it is, since we never actually form a call to a
deduction guide.
(cherry picked from commit 6d894afdea433879f54e5ba07e827db006645b7b)
|
|
|
|
|
|
|
|
|
| |
isSameEntity was missing constraints checking, causing constrained overloads
to not travel well accross serialization. (bug #45115)
Add constraints checking to isSameEntity.
(cherry picked from commit 7fb562c1ab373a3d4e14003e40556791ec032bab)
|
|
|
|
|
|
|
|
|
|
|
| |
GetContainedInventedTypeParmVisitor
GetContainedInventedTypeParmVisitor would not account for the case where TemplateTypeParmType::getDecl() is
nullptr, causing bug #45102.
Add the nullptr check.
(cherry picked from commit 865456d589e093582acaafd17d58ad1c0cce66af)
|
|
|
|
|
|
|
|
|
|
| |
dependent contexts.
We previously assumed they were neither value- nor
instantiation-dependent under any circumstances, which would lead to
crashes and other misbehavior.
(cherry picked from commit bdad0a1b79273733df9acc1be4e992fa5d70ec56)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and follow-ups:
a2ca1c2d "build: disable zlib by default on Windows"
2181bf40 "[CMake] Link against ZLIB::ZLIB"
1079c68a "Attempt to fix ZLIB CMake logic on Windows"
This changed the output of llvm-config --system-libs, and more
importantly it broke stand-alone builds. Instead of piling on more fix
attempts, let's revert this to reduce the risk of more breakages.
(cherry picked from commit 916be8fd6a0a0feea4cefcbeb0c22c65848d7a2e)
|
|
|
|
|
|
|
|
| |
This caused PR44953. See also the discussion on D74846.
This reverts commit cbc9d22e49b434b6ceb2eb94b67079d02e0a7b74.
(cherry picked from commit 7ea9a6e0220da36ff2fd1fbc29c2755be23e5166)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code in llvmorg-10-init-12188-g25ce33a6e4f is a breaking change for
users of older linkers who don't pass a version parameter, which
prevents a drop-in clang upgrade. Old tools can't know about what future
tools will do, so as a general principle the burden should be new tools
to be compatible by default. Also, for comparison, none of the other
tests of Version within AddLinkArgs add any new behaviors unless the
version is explicitly specified. Therefore, this patch changes the
-platform_version behavior from opt-out to opt-in.
Patch by David Major!
Differential revision: https://reviews.llvm.org/D74784
(cherry picked from commit 5122e828701c88f8d53ee881bc68f3904454d154)
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D75121
(cherry picked from commit 41a6612ea8afc5254e4de3aca55628d37f0be433)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes PR44896. For IR input files, option fdiscard-value-names
should be ignored as we need named values in loadModule().
Commit 60d3947922 sets this option after loadModule() where valued names
already created. This creates an inconsistent state in setNameImpl()
that leads to a seg fault.
This patch forces fdiscard-value-names to be false for IR input files.
This patch also emits a warning of "ignoring -fdiscard-value-names" if
option fdiscard-value-names is explictly enabled in the commandline for
IR input files.
Differential Revision: https://reviews.llvm.org/D74878
(cherry picked from commit 11857d49948b845dcfd7c7f78595095e3add012d)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
user interface and documentation, and update __cplusplus for C++20.
WG21 considers the C++20 standard to be finished (even though it still
has some more steps to pass through in the ISO process).
The old flag names are accepted for compatibility, as usual, and we
still have lots of references to C++2a in comments and identifiers;
those can be cleaned up separately.
(cherry picked from commit 24ad121582454e625bdad125c90d9ac0dae948c8)
|
|
|
|
|
|
| |
deduction.
(cherry picked from commit 34bd51f4b1d9f489e61becb662bdc72bb56dd277)
|
|
|
|
|
|
|
|
|
|
| |
As discussed in https://reviews.llvm.org/D74447, this patch disables integrated-cc1 behavior if there's more than one job to be executed. This is meant to limit memory bloating, given that currently jobs don't clean up after execution (-disable-free is always active in cc1 mode).
I see this behavior as temporary until release 10.0 ships (to ease merging of this patch), then we'll reevaluate the situation, see if D74447 makes more sense on the long term.
Differential Revision: https://reviews.llvm.org/D74490
(cherry picked from commit 20f1abe306d030e99f56185a3aa077ffadf59b8a)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a longstanding bug that seems to have been hidden by
a combination of (1) the normal flow being to deserialize the
interface before deserializing its parameter and (2) a precise
ordering of work that was apparently recently disturbed,
perhaps by my abstract-serialization work or Bruno's ObjC
module merging work.
Fixes rdar://59153545.
(cherry picked from commit 77b2ffc498e92cce7546d191f6712a3046300501)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is a follow up to 878a24ee244a24. Name of bitfields
with value-dependent width should be set as type-dependent. This
patch adds the required value-dependency check and sets the
type-dependency accordingly.
Patch fixes PR44886
Differential revision: https://reviews.llvm.org/D72242
(cherry picked from commit a58017e5cae5be948fd1913b68d46553e87aa622)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
deduced
We previously checked the constraints of instantiated function templates even in cases where
PartialOverloading was true and not all template arguments have been deduced, which caused crashes
in clangd (bug 44714).
We now check if all arguments have been deduced before checking constraints in partial overloading
scenarios.
(cherry picked from commit 5fef14d932fe602bf998b8fb8a809ff85ca1e245)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Address space conversion changes pointer representation.
This commit disallows such conversions when they are not
legal i.e. for the nested pointers even with compatible
address spaces. Because the address space conversion in
the nested levels can't be generated to modify the pointers
correctly. The behavior implemented is as follows:
- Any implicit conversions of nested pointers with different
address spaces is rejected.
- Any conversion of address spaces in nested pointers in safe
casts (e.g. const_cast or static_cast) is rejected.
- Conversion in low level C-style or reinterpret_cast is accepted
but with a warning (this aligns with OpenCL C behavior).
Fixes PR39674
Differential Revision: https://reviews.llvm.org/D73360
(cherry picked from commit 6064f426a18304e16b51cc79e74c9c2d55ef5a9c)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
llvm::report_fatal_error() generate preprocessed source + reproducer.sh again.
Added a test for #pragma clang __debug llvm_fatal_error to test for the original issue.
Added llvm::sys::Process::Exit() and replaced ::exit() in places where it was appropriate. This new function would call the current CrashRecoveryContext if one is running on the same thread; or call ::exit() otherwise.
Fixes PR44705.
Differential Revision: https://reviews.llvm.org/D73742
(cherry picked from commit faace365088a2a3a4cb1050a9facfc34a7a56577)
|
|
|
|
|
|
|
|
|
|
|
| |
crashing when generating crash diagnostics when '#pragma clang __debug ..."
This re-lands commits f41ec709d9d388dc43469e6ac7f51b6313f7e4af (https://reviews.llvm.org/D74076)
and commit 5fedc2b410853a6aef05e8edf19ebfc4e071e28f (https://reviews.llvm.org/D74070)
The previous build break was caused by '#pragma clang __debug llvm_unreachable' used in a non-assert build. Move it to a separate test in crash-report-with-asserts.c.
(cherry picked from commit 75f09b54429bee17a96e2ba7a2ac0f0a8a7f7e74)
|
|
|
|
|
|
|
|
| |
It should now produce valid HTML again.
Differential Revision: https://reviews.llvm.org/D73993
(cherry picked from commit 482e236e569e8324f70778af1eb756923cd490dc)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
type-constraints
We would incorrectly check whether the type-constraint had already been initialized, causing us
to ignore the invented template type constraints entirely.
Also, TemplateParameterList would store incorrect information about invented type parameters
when it observed them before their type-constraint was initialized, so we recreate it after
initializing the function type of an abbreviated template.
(cherry picked from commit 38fd69995fc5a6f16e0aa132a46e5ccdbc2eebb3)
|