Age | Commit message (Collapse) | Author | Files | Lines |
|
(cherry picked from commit 3db1ade368e538ba795486eea4923e331a8dde5a)
|
|
This change fixes a compiler crash that was introduced in https://reviews.llvm.org/D103611: `Sema::BuildVAArgExpr` attempted to retrieve a corresponding signed type for `bool` by calling `ASTContext::getCorrespondingSignedType`.
rdar://86580370
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D116272
(cherry picked from commit c033f0d9b1c7816b0488a939475d48a100e4dcab)
|
|
When performing CFG based analyses, don't forget to check the child
statements of an asm goto, such as the expressions used for
inputs+outputs.
Fixes: https://github.com/llvm/llvm-project/issues/51024
Fixes: https://github.com/ClangBuiltLinux/linux/issues/1439
Reviewed By: void, jyknight, jyu2, efriedma
Differential Revision: https://reviews.llvm.org/D116059
(cherry picked from commit 3a604fdbcd5fd9ca41f6659692bb4ad2151c3cf4)
|
|
As reported in https://bugs.freebsd.org/260078, the gnutls Makefiles
pass -Wa,-march=all to compile a number of assembly files. Clang does
not support this -march value, but because of a mistake in handling
the arguments, an unitialized Arg pointer is dereferenced, which can
cause a segfault.
Work around this by adding a check if the local WaMArch variable is
initialized, and if so, using its value in the diagnostic message.
Reviewed By: tschuett
Differential Revision: https://reviews.llvm.org/D114677
(cherry picked from commit df08b2fe8b35cb63dfb3b49738a3494b9b4e6f8e)
|
|
Since XLC only ever shipped on PowerPC AIX and Linux, it is not reasonable to
provide the compatibility macros on any target other than those two. This patch
restricts those macros to AIX/Linux.
Differential revision: https://reviews.llvm.org/D110213
(cherry picked from commit c9539f957f57c0c2c59dab98f25215f241d4debf)
|
|
Support for builtin setjmp/longjmp was removed by https://reviews.llvm.org/D51487. An
error should be created when compiling C code using __builtin_setjmp or __builtin_longjmp.
Reviewed By: dcederman
Differential Revision: https://reviews.llvm.org/D108901
(cherry picked from commit eeb4266f8137c232f0f218a727dd12b5d4f52adc)
|
|
A series of unary operators and casts may obscure the variable we're
trying to analyze. Ignore them for the uninitialized value analysis.
Other checks determine if the unary operators result in a valid l-value.
Link: https://github.com/ClangBuiltLinux/linux/issues/1521
Reviewed By: nickdesaulniers
Differential Revision: https://reviews.llvm.org/D114848
(cherry picked from commit c4582a689c2c74e0635309979176c7ada086f066)
|
|
The C11 atomics part was wrong.
(cherry picked from commit 95e6e1cc923d6b88ebb4ac5e8f0887c2c77476cc)
|
|
bug 51926 identified an issue where a dangling comma caused the cell count to be to off by one
Differential Revision: https://reviews.llvm.org/D110481
(cherry picked from commit a36227cb2b6a14fc30bfd303328d1d1abb632010)
|
|
Otherwise we may end up with an inconsistent redeclarations of the standard
library functions if _FORTIFY_SOURCE is in effect.
https://bugs.llvm.org/show_bug.cgi?id=47869
Differential Revision: https://reviews.llvm.org/D110781
(cherry picked from commit 29e00b29f76adb15a51c1ccd6c1fdb6fce5f4d7b)
|
|
`[[clang::fallthrough]]` has meaning for the CFG, but all other
StmtAttrs we currently have don't. So omit them, as AttributedStatements
with children cause several issues and there's no benefit in including
them.
Fixes PR52103 and PR49454. See PR52103 for details.
Differential Revision: https://reviews.llvm.org/D111568
(cherry picked from commit c74ab84ea23f497ac83501473220cd9cfefe81e8)
|
|
C# behaviour to change
LLVM 13.0.0-rc2 shows change of behaviour in enum and interface BraceWrapping (likely before we simply didn't wrap) but may be related to {D99840}
Logged as https://bugs.llvm.org/show_bug.cgi?id=51640
This change ensure AfterEnum works for
`internal|public|protected|private enum A {` in the same way as it works for `enum A {` in C++
A similar issue was also observed with `interface` in C#
Reviewed By: krasimir, owenpan
Differential Revision: https://reviews.llvm.org/D108810
(cherry picked from commit ed367b9dff10ee1df9ac1984eb2ad7544da7ab06)
|
|
This patches fixes https://bugs.llvm.org/show_bug.cgi?id=51404
Some builds use custom resource directory for clang, therefore the test
cannot assume default resource directory for clang. Use -resource-dir
to force it.
Differential Revision: https://reviews.llvm.org/D111726
(cherry picked from commit 1439df00fc5e6dfffeb6a99e3537f6de2e539785)
|
|
|
|
See PR51862.
The consumers of the Elidable flag in CXXConstructExpr assume that
an elidable construction just goes through a single copy/move construction,
so that the source object is immediately passed as an argument and is the same
type as the parameter itself.
With the implementation of P2266 and after some adjustments to the
implementation of P1825, we started (correctly, as per standard)
allowing more cases where the copy initialization goes through
user defined conversions.
With this patch we stop using this flag in NRVO contexts, to preserve code
that relies on that assumption.
This causes no known functional changes, we just stop firing some asserts
in a cople of included test cases.
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D109800
(cherry picked from commit d9308aa39b236064a680ca57178af3c731e13e49)
|
|
Differential Revision: https://reviews.llvm.org/D108912
|
|
Previously in D104261 we warned about dropping locks from back edges,
this is the corresponding change for exclusive/shared joins. If we're
entering the loop with an exclusive change, which is then relaxed to a
shared lock before we loop back, we have already analyzed the loop body
with the stronger exclusive lock and thus might have false positives.
There is a minor non-observable change: we modify the exit lock set of a
function, but since that isn't used further it doesn't change anything.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D106713
(cherry picked from commit 9b889f826ff587e9758c80823419512d502e457d)
|
|
Differential Revision: https://reviews.llvm.org/D109349
(cherry picked from commit b588f5d665aa01fe88921fe2ffb7256fdedfbfb0)
|
|
There needs to be a blank line after ".. code-block:: <lang>".
|
|
After D94315 we add the `NoInline` attribute to the outlined function to handle
data environments in the OpenMP if clause. This conflicted with the `AlwaysInline`
attribute added to the outlined function. for better performance in D106799.
The data environments should ideally not require NoInline, but for now this
fixes PR51349.
Reviewed By: mikerice
Differential Revision: https://reviews.llvm.org/D107649
(cherry picked from commit 41a6b50c25961addc04438b567ee1f4ef9e40f98)
|
|
See PR51842.
This fixes an assert firing in the static analyzer, triggered by implicit moves
in blocks in C mode:
This also simplifies the AST a little bit when compiling non C++ code,
as the xvalue implicit casts are not inserted.
We keep and test that the nrvo flag is still being set on the VarDecls,
as that is still a bit beneficial while not really making anything
more complicated.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: NoQ
Differential Revision: https://reviews.llvm.org/D109654
(cherry picked from commit 2d6829bbbe6877920d9be1db93b9f3fc85b43d10)
|
|
This is essentially what D106813 was supposed to do but did not.
Differential revision: https://reviews.llvm.org/D108919
(cherry picked from commit c9948e9254fbb6ea00f66c7b4542311d21e060be)
|
|
Differential Revision: https://reviews.llvm.org/D109642
|
|
Commits 58494c856a15, f6bc614546e1, and 0fc27ef19670 added special
handlings for K&R C function definitions and caused some
JavaScript/TypeScript regressions which were addressed in D107267,
D108538, and D108620. This patch would have prevented these known
regressions and will fix any unknown ones.
Differential Revision: https://reviews.llvm.org/D109582
(cherry picked from commit 3205dd3d59b3cc36f96b7eff6387de8d2f42825f)
|
|
Update a section of OpenCLSupport page to reflect the latest
development in OpenCL 3.0 support for release 13.
Differential Revision: https://reviews.llvm.org/D109320
(cherry picked from commit cff03d5fc48700b73ae863d4f25e780e74dff33e)
|
|
Major OpenCL functionality added in release 13.
Differential Revision: https://reviews.llvm.org/D109327
|
|
Clean up the detection of parameter declarations in K&R C function
definitions. Also make it more precise by requiring the second
token after the r_paren to be either a star or keyword/identifier.
Differential Revision: https://reviews.llvm.org/D108094
(cherry picked from commmit 643f2be7b6afd91d9f0d6df89cd3391835763112)
|
|
This is a follow-up to https://reviews.llvm.org/D107950 which
missed user-defined types in K&R C.
Differential Revision: https://reviews.llvm.org/D107961
(cherry picked from commit f6928cf45516503deb48f8175a982becc579dc8c)
|
|
After
https://github.com/llvm/llvm-project/commit/9da70ab3d43c79116f80fc06aa7cf517374ce42c
we saw a few regressions around trailing attribute definitions and in
typedefs (examples in the added test cases). There's some tension
distinguishing K&R definitions from attributes at the parser level,
where we have to decide if we need to put the type of the K&R definition
on a new unwrapped line before we have access to the rest of the line,
so we're scanning backwards and looking for a pattern like f(a, b). But
this type of pattern could also be an attribute macro, or the whole
declaration could be a typedef itself. I updated the code to check for a
typedef at the beginning of the line and to not consider raw identifiers
as possible first K&R declaration (but treated as an attribute macro
instead). This is not 100% correct heuristic, but I think it should be
reasonably good in practice, where we'll:
* likely be in some very C-ish code when using K&R style (e.g., stuff
that uses `struct name a;` instead of `name a;`
* likely be in some very C++-ish code when using attributes
* unlikely mix up the two in the same declaration.
Ideally, we should only decide to add the unwrapped line before the K&R
declaration after we've scanned the rest of the line an noticed the
variable declarations and the semicolon, but the way the parser is
organized I don't see a good way to do this in the current parser, which
only has good context for the previously visited tokens. I also tried
not emitting an unwrapped line there and trying to resolve the situation
later in the token annotator and the continuation indenter, and that
approach seems promising, but I couldn't make it to work without
messing up a bunch of other cases in unit tests.
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D107950
(cherry picked from commit 45934922fa88b7542c8bcd86889d062fb78efdda)
|
|
A follow-up to
https://github.com/llvm/llvm-project/commit/f6bc614546e169bb1b17a29c422ebace038e6c62
where we handle the case where the semicolon is followed by a trailing
comment.
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D107907
(cherry picked from commit 0fc27ef19670676689d3317948c81eb171bb25f8)
|
|
https://reviews.llvm.org/D105964 updated the detection of function
definitions. It had the unfortunate effect to start marking object
definitions with attribute-like macros as function definitions.
This addresses this issue.
Reviewed By: owenpan
Differential Revision: https://reviews.llvm.org/D107269
(cherry picked from commit f6bc614546e169bb1b17a29c422ebace038e6c62)
|
|
Following nvptx approach, this patch uses complex function
definitions from complex_cmath.h. With this patch, ovo passes
23/34 complex mathematical test cases.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D109344
(cherry picked from commit 12dcbf913c49db839b3669db0dcacd5de25facde)
|
|
See PR48617.
When assigning the new template arguments to the new TypeLoc, we were looping
on the argument count of the original TypeLoc instead of the new one,
which can be different when packs are present.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D109406
(cherry picked from commit 68b9d8ed7abe4046992ae1557990edfbb3a772bc)
|
|
This was an accidental behaviour change in D106789 and this patch
restores it back to original state.
Differential Revision: https://reviews.llvm.org/D109361
(cherry picked from commit 73c00d40bd49ae022f6fbba7200f05facb533e3b)
|
|
(cherry picked from commit bce178a5ecf10df762cbda59c7f60cca8e52ce3a)
|
|
(cherry picked from commit d8cd7806310c51af912a647a6ca46de62ff13214)
|
|
Per the contract of ReadLateParsedTemplates, we should not be returning
the same results multiple times. No functionality change intended, other
than to runtime.
Thanks to Luboš Luňák for identifying the cause of the regression!
(cherry picked from commit 6eda66b0a9f793c65852aa94430ae9bd891bcf63)
|
|
See PR51708.
Attempting copy elision in dependent contexts with invalid variable,
such as a variable with incomplete type, would cause a crash when attempting
to calculate it's alignment.
The fix is to just skip this optimization on invalid VarDecl, as otherwise this
provides no benefit to error recovery: This functionality does not try to
diagnose anything, it only calculates a flag which will affect where the
variable will be allocated during codegen.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: rtrieu
Differential Revision: https://reviews.llvm.org/D109191
(cherry picked from commit d98c34f4d7950f531661ba3f498222ccf6239a0f)
|
|
(cherry picked from commit 775ab780fd2a23cfc80ace571938ddd21d080173)
|
|
(cherry picked from commit b989662eb000efb54b91b8c82d2b2713e2da20fc)
|
|
Differential Revision: https://reviews.llvm.org/D109244
(cherry picked from commit 466451c6616272d8c779618b92b0ae80f394a795)
|
|
Reference types in the return or parameter position did cause the OpenMP
declare variant overload reasoning to give up. We should allow them as
we allow any other type.
This should fix the bug reported on the mailing list:
https://lists.llvm.org/pipermail/openmp-dev/2021-August/004094.html
Reviewed By: ABataev, pdhaliwal
Differential Revision: https://reviews.llvm.org/D108774
(cherry picked from commit 2930c839a5877356db6966409f4f9f2cdbcf3a07)
|
|
|
|
Differential Revision: https://reviews.llvm.org/D109023
|
|
Currently, it is a bit buried in the file even if this is
pretty important for distro.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D108533
|
|
Fixes PR51626.
The M68k requires that all instruction, word and long word reads are
aligned to word boundaries. From the 68020 onwards, there is a
performance benefit from aligning long words to long word boundaries.
The M68k uses the same data layout for pointers and integers.
In line with this, this commit updates the pointer data layout to
match the layout already set for 32-bit integers: 32:16:32.
Differential Revision: https://reviews.llvm.org/D108792
(cherry picked from commit 8d3f112f0cdbed2311aead86bcd72e763ad55255)
|
|
-DLLVM_ENABLE_NEW_PASS_MANAGER=off
LLVM_ENABLE_NEW_PASS_MANAGER is set to ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER, so
-DLLVM_ENABLE_NEW_PASS_MANAGER=off has no effect.
Change the cache variable to LLVM_ENABLE_NEW_PASS_MANAGER instead.
A user opting out the new PM needs to switch from
-DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=off to
-DLLVM_ENABLE_NEW_PASS_MANAGER=off.
Also give a warning that -DLLVM_ENABLE_NEW_PASS_MANAGER=off is deprecated.
Reviewed By: aeubanks, phosek
Differential Revision: https://reviews.llvm.org/D108775
(cherry picked from commit a42bd1b560524905d3b9aebcb658cf6dc9521d26)
|
|
|
|
Asm is a gnu extension for C, so at present -fopenmp -std=c99
and similar fail to compile on nvptx, bug 51344
Changing to `__asm__` or `__asm` works for openmp, all three appear to work
for cuda. Suggesting `__asm__` here as `__asm` is used by MSVC with different
syntax, so this should make for better error diagnostics if the header is
passed to a compiler other than clang.
Reviewed By: tra, emankov
Differential Revision: https://reviews.llvm.org/D107492
(cherry picked from commit 509854b69cea0c9261ac21ceb22012a53e7a800b)
|
|
Fixes miscompile of calls into ocml. Bug 51445.
The stack variable `double __tmp` is moved to dynamically allocated shared
memory by CGOpenMPRuntimeGPU. This is usually fine, but when the variable
is passed to a function that is explicitly annotated address_space(5) then
allocating the variable off-stack leads to a miscompile in the back end,
which cannot decide to move the variable back to the stack from shared.
This could be fixed by removing the AS(5) annotation from the math library
or by explicitly marking the variables as thread_mem_alloc. The cast to
AS(5) is still a no-op once IR is reached.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D107971
(cherry picked from commit dbd7bad9ad9bc32538e324417c23387bf4ac7747)
|