Commit Graph

94563 Commits

Author SHA1 Message Date
Alex Lorenz 79e09af1d6 [clang] Fix the begin location of concepts specialization expression
The concept specialization expression should start at the location of
the  nested qualifiers when it has nested qualifiers.
This ensures that libclang reports correct source ranges that include
all subexpressions when visiting the expression.

Differential Revision: https://reviews.llvm.org/D126332
2022-05-25 12:39:21 -07:00
Christian Sigg c4bc416418 [LLVM] Add rcp.approx.ftz.f32 intrinsic
Split out from https://reviews.llvm.org/D126158.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D126369
2022-05-25 21:05:20 +02:00
James Y Knight 997b072e10 C++ DR2394: Const-default-constructible for members.
Const class members may be initialized with a defaulted default
constructor under the same conditions it would be allowed for a const
object elsewhere.

Differential Revision: https://reviews.llvm.org/D126170
2022-05-25 14:20:11 -04:00
Daniel Grumberg 504736cedf [clang][extract-api] Don't emit symbols prefixed with an underscore
These symbols are understood to not be used for client API consumption
by convention so they should not appear in the generated symbol graph.

Differential Revision: https://reviews.llvm.org/D125678
2022-05-25 19:02:18 +01:00
Aaron Ballman 9368bf9023 Removing this as part of the revert done in 69da3b6aea
This appears to have been added in a follow-up commit that I missed.
2022-05-25 13:45:17 -04:00
Aaron Ballman 69da3b6aea Revert "[OpenMP] atomic compare fail : Parser & AST support"
This reverts commit 232bf8189e.

It broke the sanitize buildbot: https://lab.llvm.org/buildbot/#/builders/5/builds/24074

It also reproduces on Windows debug builds as a crash.
2022-05-25 13:34:34 -04:00
Mike Rice ba3f85390b [OpenMP] Add diagnostic for unterminated 'omp [begin] declare target'
Warns when end-of-file is reached without seeing all matching
'omp end declare target' directives. The diagnostic shows the
location of the related begin directive.

Differential Revision: https://reviews.llvm.org/D126331
2022-05-25 10:34:07 -07:00
Joseph Huber 8a1984c25e [Clang][Docs] Document `-Xoffload-linker` flag
Summary:
I added the `-Xoffload-linker` flag and did not provide additional
documentation. This patch adds it.
2022-05-25 13:33:10 -04:00
Martin Boehme 6f4644d194 [clang] Don't parse MS attributes in `ParseExportDeclaration()`.
As @rsmith commented on https://reviews.llvm.org/D111548: "That looks like it's
simply a bug as far as I can tell, and that call can be removed. MS attributes
will be parsed as part of the decl specifier sequence as needed and don't need
to be parsed as declaration attributes."

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D126062
2022-05-25 17:15:41 +02:00
Paul Robinson d8dda57ae7 [PS5] Default to -fno-rtti 2022-05-25 06:48:21 -07:00
Haojian Wu a17fc7fd86 Fix unused-variable warning, NFC. 2022-05-25 15:25:03 +02:00
Haojian Wu c673d67bc7 [AST] Dont invalidate a ref-type var decl if it has no initializer.
This would allow more AST nodes being preserved for broken code, and
have a more consistent valid bit for ref-type var decl (currently, a
ref-type var decl with a broken initializer is valid).

Per https://reviews.llvm.org/D76831#1973053, the initializer of a variable
should play no part in its "invalid" bit.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D122935
2022-05-25 15:14:35 +02:00
Aaron Ballman f96aa834d7 Test C DR conformance (part three of many)
This adds more of the tests for the first 100 DRs in C and updates
their status on the status page.
2022-05-25 08:18:16 -04:00
Anastasia Stulova 730dc4e9bc [Clang] Added options for integrated backend.
Following the new flow for external object code emission,
provide flags to switch between integrated and external
backend similar to the integrated assembler options.

SPIR-V target is the only user of this functionality at
this point.

This patch also updated SPIR-V documentation to clarify
that integrated object code emission for SPIR-V is an
experimental feature.

Differential Revision: https://reviews.llvm.org/D125679
2022-05-25 12:07:33 +01:00
Sven van Haastregt 0d7f8d42fd [OpenCL] Remove argument names from async copy builtins
This simplifies completeness comparisons against OpenCLBuiltins.td and
also makes the header no longer "claim" the argument name identifiers.

Continues the direction set out in D119560.
2022-05-25 10:05:25 +01:00
Gabor Marton f75bc5bfc8 [analyzer] Fix symbol simplification assertion failure
Fixes https://github.com/llvm/llvm-project/issues/55546

The assertion mentioned in the issue is triggered because an
inconsistency is formed in the Sym->Class and Class->Sym relations. A
simpler but similar inconsistency is demonstrated here:
https://reviews.llvm.org/D114887 .

Previously in `removeMember`, we didn't remove the old symbol's
Sym->Class relation. Back then, we explained it with the following two
bullet points:
> 1) This way constraints for the old symbol can still be found via it's
> equivalence class that it used to be the member of.
> 2) Performance and resource reasons. We can spare one removal and thus one
> additional tree in the forest of `ClassMap`.

This patch do remove the old symbol's Sym->Class relation in order to
keep the Sym->Class relation consistent with the Class->Sym relations.
Point 2) above has negligible performance impact, empirical measurements
do not show any noticeable difference in the run-time. Point 1) above
seems to be a not well justified statement. This is because we cannot
create a new symbol that would be equal to the old symbol after the
simplification had happened. The reason for this is that the SValBuilder
uses the available constant constraints for each sub-symbol.

Differential Revision: https://reviews.llvm.org/D126281
2022-05-25 10:55:50 +02:00
Adrian Kuegel 9698a445c6 Fix warning by handling OMPC_fail in switch statement. 2022-05-25 09:33:41 +02:00
Sunil Kuravinakop ca27f3e3b2 [Clang][OpenMP] Support for omp nothing
Patch to support "#pragma omp nothing"

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D123286
2022-05-24 23:59:31 -05:00
Sunil Kuravinakop 232bf8189e [OpenMP] atomic compare fail : Parser & AST support
This is a support for " #pragma omp atomic compare fail ". It has Parser & AST support for now.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D123235
2022-05-24 23:56:42 -05:00
David Blaikie e59f648d69 Move GCC-compatible pod-packing change to v15/old behavior available at v14 and below
Since this didn't make it into the v14 release - anyone requesting the
v14 ABI shouldn't get this GCC-compatible change that isn't backwards
compatible with v14 Clang.

Differential Revision: https://reviews.llvm.org/D126334
2022-05-25 03:03:27 +00:00
Chuanqi Xu a1ffba8d52 [C++20] [Coroutines] Conform the updates for CWG issue 2585
According to the updates in CWG issue 2585
https://cplusplus.github.io/CWG/issues/2585.html, we shouldn't find an
allocation function with (size, p0, …, pn) in global scope.

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D126187
2022-05-25 10:31:26 +08:00
owenca bebf7bdf9a [clang-format][NFC] Insert/remove braces in clang/lib/Format/
Differential Revision: https://reviews.llvm.org/D126157
2022-05-24 19:06:04 -07:00
Mike Rice 239094cdee [OpenMP] Add codegen for 'omp_all_memory' reserved locator.
This creates an entry with address=nullptr and flag=0x80.
When an 'omp_all_memory' entry is specified any other 'out' or
'inout' entries are not needed and are not passed to the runtime.

Differential Revision: https://reviews.llvm.org/D126321
2022-05-24 15:26:23 -07:00
Yitzhak Mandelbaum 2f93bbb9cd [clang][dataflow] Relax `Environment` comparison operation.
Ignore `MemberLocToStruct` in environment comparison. As an ancillary data
structure, including it is redundant. We also can generate environments which
differ in their `MemberLocToStruct` but are otherwise equivalent.

Differential Revision: https://reviews.llvm.org/D126314
2022-05-24 20:58:18 +00:00
Alex Lorenz 1b34f1e996 [clang][test] mark tests added in ee8524087c as unsupported on AIX
These tests are failing on the PPC64 AIX CI bot, but it's unclear why,
as they pass on other CI jobs.
I marked them as unsupported on AIX for now while investigating the failure.
2022-05-24 13:39:37 -07:00
Yitzhak Mandelbaum 6eb9e0f5eb [clang][dataflow] Make limit on fixpoint-algorithm iterations proportional to size of CFG.
Currently, the maximum number of iterations of the loop for finding the fixpoint
of the dataflow analysis is set at 2^16. When things go wrong in an analysis,
this can be far too large.  This patch changes the limit to be proportional to
the size of the CFG, which will generally be far smaller than 2^16 (while still
maintaining 2^16 as the absolute limit).

Differential Revision: https://reviews.llvm.org/D126316
2022-05-24 20:13:55 +00:00
Saleem Abdulrasool b159108bc5 Sema: adjust assertion to account for deduced types
Previous changes for the BTF attributes introduced a new sub-tree
visitation.  That uncovered that when accessing the typespec location we
would assert that the type specification is either a type declaration or
`typename`.  However, `typename` was explicitly permitted.  This change
predates the introduction of newer deduced type representations such as
`__underlying_type` from C++ and the addition of the GNU `__typeof__`
expression.

Thanks to aaron.ballman for the valuable discussion and pointer to
`isTypeRep`.

Differential Revision: https://reviews.llvm.org/D126093
Reviewed By: aaron.ballman, yonghong-song
2022-05-24 17:49:44 +00:00
Joseph Huber 3723868d9e [OpenMP] Fix file arguments for embedding bitcode in the linker wrapper
Summary:
The linker wrapper supports embedding bitcode images instead of linked
device images to facilitate JIT in the device runtime. However, we were
incorrectly passing in the file twice when this option was set. This
patch makes sure we only use the intermediate result of the LTO pass and
don't add the final output to the full job.

In the future we will want to add both of these andle handle that
accoridngly to allow the runtime to either use the AoT compiled version
or JIT compile the bitcode version if availible.
2022-05-24 13:45:52 -04:00
Mike Rice 9ba937112f [OpenMP] Add parsing/sema support for omp_all_memory reserved locator
Adds support for the reserved locator 'omp_all_memory' for use
in depend clauses with 'out' or 'inout' dependence-types.

Differential Revision: https://reviews.llvm.org/D125828
2022-05-24 10:28:59 -07:00
Paul Robinson 4a3e2aff5f Reland "[PS5] Verify defaults to -fno-stack-size-section"
This reverts commit efebb27b74.
Fixes typos (accidentally omitted %s from some RUN lines).
2022-05-24 10:09:39 -07:00
Alex Lorenz ee8524087c [libclang] add supporting for indexing/visiting C++ concepts
This commit builds upon recently added indexing support for C++ concepts
from https://reviews.llvm.org/D124441 by extending libclang to
support indexing and visiting concepts, constraints and requires
expressions as well.

Differential Revision: https://reviews.llvm.org/D126031
2022-05-24 10:02:53 -07:00
Paul Robinson efebb27b74 Revert "[PS5] Verify defaults to -fno-stack-size-section"
This reverts commit 28432b0f65.

Caused some unexpected buildbot failures.
2022-05-24 10:00:33 -07:00
Paul Robinson 28432b0f65 [PS5] Verify defaults to -fno-stack-size-section 2022-05-24 09:47:37 -07:00
Cyndy Ishida a1a14e817e [Clang] Avoid misleading 'conflicting types' diagnostic with no-prototype decls.
Clang has recently started diagnosing prototype redeclaration errors like [rG385e7df33046](https://reviews.llvm.org/rG385e7df33046d7292612ee1e3ac00a59d8bc0441)

This flagged legitimate issues in a codebase but was confusing to resolve because it actually conflicted with a function declaration from a system header and not from the one emitted with "note: ".

This patch updates the error handling to use the canonical declaration's source location instead to avoid misleading errors like the one described.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D126258
2022-05-24 08:43:31 -07:00
Joseph Huber f37101983f [OpenMP] Add `-Xoffload-linker` to forward input to the device linker
We use the clang-linker-wrapper to perform device linking of embedded
offloading object files. This is done by generating those jobs inside of
the linker-wrapper itself. This patch adds an argument in Clang and the
linker-wrapper that allows users to forward input to the device linking
phase. This can either be done for every device linker, or for a
specific target triple. We use the `-Xoffload-linker <arg>` and the
`-Xoffload-linker-<triple> <arg>` syntax to accomplish this.

Reviewed By: markdewing, tra

Differential Revision: https://reviews.llvm.org/D126226
2022-05-24 09:11:02 -04:00
Ivan Kosarev be4eaf10ee [Clang][CodeGen] Fix the cmse-clear-return.c test.
Caught with D125604.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D126191
2022-05-24 12:49:42 +01:00
Anastasia Stulova d61ded1034 [OpenCL] Make -cl-ext a driver option.
For generic targets such as SPIR-V clang sets all OpenCL
extensions/features as supported by default. However
concrete targets are unlikely to support all extensions
features, which creates a problem when such generic SPIR-V
binary is compiled for a specific target later on.

To allow compile time diagnostics for unsupported features
this flag is now being exposed in the clang driver.

Differential Revision: https://reviews.llvm.org/D125243
2022-05-24 11:34:19 +01:00
Kito Cheng b166aa833e [RISCV][NFC] Change interface of RVVIntrinsic::getSuffixStr
This NFC patch is splited from D111617.

Using llvm::ArrayRef rather than llvm::SmallVector, ArrayRef is more generic
interface that could accept both llvm::ArrayRef and llvm::SmallVector.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D125893
2022-05-24 17:24:32 +08:00
usama hameed ca81abcfd7 updated canResolveToExpr to accept both statements and expressions. Removed unnecessary code 2022-05-23 20:18:49 -07:00
usama hameed 63ecb7dcc8 bugfix in InfiniteLoopCheck to not print warnings for unevaluated loops
Added a separate check for unevaluated statements. Updated InfiniteLoopCheck to use new check

Differential Revision: https://reviews.llvm.org/D126246
2022-05-23 20:18:49 -07:00
usama hameed 602682225a bugfix in InfiniteLoopCheck to not print warnings for unevaluated loops
Differential Revision: https://reviews.llvm.org/D126034
2022-05-23 20:18:48 -07:00
Vitaly Buka 4f89ff3fc7 [test][clang] Move -O3 in command line 2022-05-23 15:57:14 -07:00
Paul Robinson 217531f12b [PS5] Make driver's PIC behavior match PS4
The new test is a copy of the corresponding PS4 test, with the triple
etc updated, because there's currently no good way to make one lit test
"iterate" with multiple targets.
2022-05-23 12:50:22 -07:00
Stephen Long 4f1e64b54f [MSVC, ARM64] Add __readx18 intrinsics
https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170

  unsigned char __readx18byte(unsigned long)
  unsigned short __readx18word(unsigned long)
  unsigned long __readx18dword(unsigned long)
  unsigned __int64 __readx18qword(unsigned long)

Given the lack of documentation of the intrinsics, we chose to align the offset with just
`CharUnits::One()` when calling `IRBuilderBase::CreateAlignedLoad()`

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D126024
2022-05-23 10:59:12 -07:00
Paul Robinson dbd1ba28a3 [PS5] Disable a test, same as PS4 2022-05-23 10:43:26 -07:00
Nathan Sidwell a1dcfb75ea [clang] Module global init mangling
C++20 modules require emission of an initializer function, which is
called by importers of the module.  This implements the mangling for
that function.  It is the one place the ABI exposes partition names in
symbols -- but fortunately only needed by other TUs of that same module.

Reviewed By: bruno

Differential Revision: https://reviews.llvm.org/D122741
2022-05-23 09:03:10 -07:00
Stephen Long 3e0be5610f [MSVC, ARM64] Add __writex18 intrinsics
https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170

  void __writex18byte(unsigned long, unsigned char)
  void __writex18word(unsigned long, unsigned short)
  void __writex18dword(unsigned long, unsigned long)
  void __writex18qword(unsigned long, unsigned __int64)

Given the lack of documentation of the intrinsics, we chose to align the offset with just
`CharUnits::One()` when calling `IRBuilderBase::CreateAlignedStore()`.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D126023
2022-05-23 07:01:11 -07:00
Timm Bäder 0eccc92fa0 Revert "[clang][driver] Dynamically select gcc-toolset/devtoolset version"
This reverts commit 8717b492df.

The new unittest fails on Windows buildbots, e.g.
https://lab.llvm.org/buildbot/#/builders/119/builds/8647
2022-05-23 15:22:27 +02:00
Sylvestre Ledru 6f4dc5dae6 Add support of the next Ubuntu (Ubuntu 22.10 - Kinetic Kudu) 2022-05-23 13:49:34 +02:00
Sylvestre Ledru a02000611a Add support of the next Debian (Debian 13 - Trixie) 2022-05-23 13:47:13 +02:00