Commit Graph

453478 Commits

Author SHA1 Message Date
Peter Klausler
bdbebef828 [flang] Warn about inconsistent implicit interfaces
When a global procedure has no explicit interface, emit warnings
when its references are inconsistent implicit procedure interfaces.

Differential Revision: https://reviews.llvm.org/D145097
2023-03-02 15:16:13 -08:00
Alex Langford
ff65a58667 [llvm] Add missing header guards in LogicCombine.h and LogicalExpr.h
These files were added in 97dcbea63e but
it looks like they are missing header guards. This breaks module builds.
2023-03-02 15:13:36 -08:00
Marco Elver
7ecd2a23f5 [SelectionDAG] Fix missing lambda capture
Move MaxDepth into the lambda, since it is not needed outside. This
fixes some compilers that complain about missing capture:

  error C3493: 'MaxDepth' cannot be implicitly captured because no
  default capture mode has been specified

Fixes: f693932fbe ("[SelectionDAG] Transitively copy NodeExtraInfo on RAUW")
2023-03-02 23:47:36 +01:00
Aditya Nandakumar
00e55531df [GISel][CSE][NFC]: Handle mutual recursion when inserting node
GISel's CSE mechanism lazily inserts instructions into the CSE List
to improve on efficiency as well as efficacy of CSE
(for allowing partially built instructions to be fully built).

There's unfortunately a mutual recursion via
 `handleRecordedInsts -> handleRecordedInst -> insertNode-> handleRecordedInsts`.

So this change simply records that we're already draining this list so we can just bail out on the recursion.

No changes to codegen are expected as we're still draining/handling the temporary
list via pop_back and we should get the same sequence of instructions
whether we call pop_back in a loop at the top level or recursive.

https://reviews.llvm.org/D145006

reviewed by: dsanders
2023-03-02 14:42:38 -08:00
Raman Tenneti
b98c1906d6 [libc][NFC] Switch use of errno in src/time and test/src/time to libc_errno.
Switch use of errno in src/time and test/src/time to libc_errno.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D145192
2023-03-02 14:41:19 -08:00
Jason Molenda
7e770f9c17 Revert "Add SBValue::GetValueAsAddress API for removing non-addressing metadata"
Revert while I investigate two CI bot failures;
the more important is the lldb-arm-ubuntu where
the FixAddress is removing the 0th bit so we're
adding the `actual=` decorator on a string pointer,

```
Got output:
(char *) strptr = 0x00400817 (actual=0x400816) ptr = [{ },{H}]
```

in TestDataFormatterSmartArray.py line 229.

This reverts commit 4d635be2db.
2023-03-02 14:36:37 -08:00
Philip Reames
00854cb52d [ASAN] Autogen masked load/store test coverage [nfc]
I also removed two runlines which added no additional coverage.  No test in the file has both loads and stores, thus the two configurations duplicate the disabled configuration.
2023-03-02 14:33:00 -08:00
Derek Schuff
41e31466af [WebAssembly] Implement build-id feature
Implement the --build-id flag similarly to ELF, and generate a build_id
section according to the WebAssembly tool convention specified in
https://github.com/WebAssembly/tool-conventions/pull/183

The default style ("fast" aka "tree") hashes the contents of the output
and (unlike ELF) generates a v5 UUID based on the hash (using a random
namespace).
It also supports generating a random v4 UUID, a sha1 hash,
and a user-specified string (as ELF does).

Differential Revision: https://reviews.llvm.org/D107662
2023-03-02 14:19:06 -08:00
Amara Emerson
1e1f1195a8 [AArch64] Fix crash in LowerBUILD_VECTOR trying to create invalid EXTRACT_SUBVECTOR.
rdar://106096671

Differential Revision: https://reviews.llvm.org/D145185
2023-03-02 14:10:29 -08:00
Marco Elver
f693932fbe [SelectionDAG] Transitively copy NodeExtraInfo on RAUW
During legalization of the SelectionDAG, some nodes are replaced with
arch-specific nodes. These may be complex nodes, where the root node no
longer corresponds to the node that should carry the extra info.

Fix the issue by copying extra info to the new node and all its new
transitive operands during RAUW. See code comments for more details.

This fixes the remaining pcsections-atomics.ll tests on X86.

v2: Optimize copyExtraInfo() deep copy. For now we assume that only
NodeExtraInfo that have PCSections set require deep copy. Furthermore,
limit the depth of graph search while pre-populating the visited set,
assuming the to-be-replaced subgraph 'From' has limited complexity. An
assertion catches if the maximum depth needs to be increased.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D144677
2023-03-02 23:07:19 +01:00
Peter Klausler
057b6fb61f [flang] Fix CONTIGUOUS attribute for construct entities
Currently, the selector of a construct entity (e.g., ASSOCIATE(x=>a(1:20)))
is inheriting the CONTIGUOUS attribute from its associated variable
even if it has subscripts that make it noncontiguous (a(1:20:2)).
Add construct entities to the dynamic contiguity predicate instead.

Differential Revision: https://reviews.llvm.org/D145114
2023-03-02 14:06:37 -08:00
Philip Reames
51b2f214df [ASAN] Simplify masked load/store test [nfc]
Only use of the globals was to load a pointer, we can just pass in a pointer instead.
2023-03-02 14:06:16 -08:00
Michael Jones
803437db15 [libc][obvious] Fix errno includes in unistd
Minor typo swapped quotes for angle brackets. This patch moves
everything to quotes.

Differential Revision: https://reviews.llvm.org/D145188
2023-03-02 14:04:53 -08:00
Jordan Rupprecht
6db44e52ce [Linux] Add kernel.yama.ptrace_scope note when ptrace fails to attach.
A common reason for LLDB failing to attach to an already-running process on Linux is the Yama security module: https://www.kernel.org/doc/Documentation/security/Yama.txt. This patch adds an explaination and suggested fix when it detects that case happening.

This was previously proposed in D106226, but hasn't been updated in a while. The last request was to put the check in a target-specific location, which is the approach this patch takes. I believe Yama only exists on Linux, so it's put in that package.

This has no end-to-end test because I'm not sure how to set `ptrace_scope` in a test environment -- if there are suggestions on how to do that, I'd be happy to add it. (Also, setting it to `3` is comically irreversible). I tested this locally.

Reviewed By: DavidSpickett, labath

Differential Revision: https://reviews.llvm.org/D144904
2023-03-02 13:51:30 -08:00
Jan Svoboda
9679075a1a [clang][deps] NFC: Simplify worker loop
This patch simplifies the loop inside each worker by extracting index retrieval into a lambda function.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D145101
2023-03-02 13:50:08 -08:00
Peter Klausler
a183668ac6 [flang] Move check for statement function in BLOCK construct
A BLOCK construct may not contain a statement function definition;
but it may of course contain an assignment statement with an array
element on its left-hand side that looks like a statement function
definition.  These misparsed statement functions are converted
into assignment statements during semantics once it is clear what
they are.  Move the C1107 check for a statement function definition
in a block construct into declaration checking, which is where it
probably should have been in the first place anyway.

Differential Revision: https://reviews.llvm.org/D145112
2023-03-02 13:48:09 -08:00
Jakub Kuderski
f254acf571 [ADT] Clean up enumerate implementation. NFC.
*  Remove unnecessary member functions.
*  Fix code sample.

This is in preparation for landing future changes in https://reviews.llvm.org/D144503.

Reviewed By: zero9178

Differential Revision: https://reviews.llvm.org/D145025
2023-03-02 16:44:52 -05:00
Luís Marques
6190356914 Revert "[Support] Implement findModulesAndOffsets on Apple 64-bit platforms"
This reverts commit b8b8aa6f06.
It broke AIX.
2023-03-02 21:44:34 +00:00
Jan Svoboda
8640545008 [clang][deps] Preserve input ordering in the full output
This patch makes sure the ordering of TUs in the input CDB is preserved in the full output. Previously, the results were pushed into a global vector, potentially out-of-order and then sorted by the input file name. This is non-deterministic when the CDB contains multiple entries with the same input file. This patch fixes that by pre-allocating the output vector and writing directly to the position corresponding to the current input. This also eliminates one critical section.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D145098
2023-03-02 13:42:11 -08:00
Michael Jones
8350494a61 [libc] disable integration tests when using gcc
The integration tests were failing to build under GCC due to missing
compile options for using LLVM's libc++ and compiler-rt.

This should unblock https://github.com/llvm/llvm-project/issues/60467

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D145128
2023-03-02 13:39:55 -08:00
Jason Molenda
4d635be2db Add SBValue::GetValueAsAddress API for removing non-addressing metadata
On target where metadata is stored in bits that aren't used for
virtual addressing -- AArch64 Top Byte Ignore and pointer authentication
are two examples -- an SBValue object representing a pointer will
return the address with metadata for SBValue::GetValueAsUnsigned.
Users may want to get the virtual address without the metadata;
this new method gives them a way to do this.

Differential Revision: https://reviews.llvm.org/D142792
2023-03-02 13:32:37 -08:00
Kazu Hirata
2010269c0f [mlir] Use std::optional instead of llvm::Optional (NFC) 2023-03-02 13:19:42 -08:00
Aart Bik
250f6899c3 [mlir][sparse] convenience util to test for "sparse" op
Reviewed By: cota

Differential Revision: https://reviews.llvm.org/D145176
2023-03-02 13:08:50 -08:00
Nick Desaulniers
71a28fb74b [Docs] update MemorySSA for opaque ptrs
Reviewed By: asbirlea, nikic

Differential Revision: https://reviews.llvm.org/D145130
2023-03-02 12:58:58 -08:00
Med Ismail Bennani
ab81fc29d9 [lldb/Interpreter] Fix build failures in ScriptInterpreterLua
This patch should fix the build failures in the Lua ScriptedInterpreter
introduced by 9a9fce1fed.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-02 12:46:34 -08:00
Med Ismail Bennani
b970e725d8 Revert "[lldb/Interpreter] Fix build failures in ScriptInterpreterLua"
This reverts commit 6de18eb050.
2023-03-02 12:46:18 -08:00
Med Ismail Bennani
6de18eb050 [lldb/Interpreter] Fix build failures in ScriptInterpreterLua
This patch should fix the build failures in the Lua ScriptedInterpreter
introduced by 9a9fce1fed.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-02 12:44:45 -08:00
Chia-hung Duan
daaef4c499 Revert "Revert "Revert "[scudo] Only prepare PageMap entry for partial region"""
ScudoReleaseTest.ReleaseFreeMemoryToOSAndroid failed on Fuchsia

This reverts commit c6ef6bbd8d.
2023-03-02 20:37:55 +00:00
Ed Maste
5295fe4e98 [libc++][chrono] XFAIL hh_mm_ss formatter test on FreeBSD
This test did not exist when I added the previous set of XFAILs (and the
libc++ FreeBSD CI runner is not yet active).

Reviewed by: Mordante

Differential Revision: https://reviews.llvm.org/D145120
2023-03-02 15:30:16 -05:00
Bill Wendling
554ba99695 Revert "[Clang] Refactor "Designators" into a unified implementation [NFC]"
This reverts commit 3c07db5f58.

This caused https://github.com/llvm/llvm-project/issues/61118. Reverting
to ensure this is a pure NFC change.
2023-03-02 12:09:29 -08:00
Craig Topper
06c6b787b2 [SelectionDAG][AArch64] Constant fold in SelectionDAG::getVScale if VScaleMin==VScaleMax.
Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D145113
2023-03-02 12:02:38 -08:00
Sean Maher
d14e7ee3d1 [clang-format] Add -j to clang-format-diff to speed up formatting
This patch changes the implementation of clang-format-diff.py to
start up many clang-format processes in parallel in order to speed
up clang-format-diff.py by several orders of magnitude on large
patches.

Differential Revision: https://reviews.llvm.org/D141230
2023-03-02 11:59:11 -08:00
Aaron Ballman
5680b75703 [C2x] Add tests for WG14 N3035 and update the C status page
The paper was making minor corrections to the standard that Clang had
already implemented. This adds (most of) the test coverage for the
paper and claims support. In my testing, we supported this in Clang 15.
2023-03-02 14:36:50 -05:00
Nemanja Ivanovic
59cd692454 [PowerPC] Recognize long CPU name for -mtune in Clang
There are two ways of specifying a CPU on PowerPC:
power<N> and pwr<N>. Clang/LLVM traditionally
supports the latter and Clang replaces the former
with the latter when passing it to the back end for
the -mcpu= option. However, when the -mtune= option
was introduced, this replacement was not implemented for it.

This leaves us in an inconsistent state of accepting
both forms for -mcpu= and and only the latter for
-mtune=. Furthermore, it leaves us incompatible with
GCC which only understands the power<N> version for
both options.

This patch just adds the same handling for the long
names for -mtune= as already exists for -mcpu=.

Differential revision: https://reviews.llvm.org/D144967
2023-03-02 14:29:40 -05:00
Philip Reames
1fb6cc7ee1 [test][ASAN] Add test coverage for (fixed) vector load and stores 2023-03-02 11:15:14 -08:00
Siva Chandra Reddy
54faf22f7b [libc][NFC] Move all developer docs into a sub-directory docs/dev. 2023-03-02 10:59:49 -08:00
Alexey Bataev
931bba2bc3 [SLP][NFC]Add a test with reused scalars in 3 tree nodes with different
VF, NFC.
2023-03-02 10:50:03 -08:00
Philip Reames
67dab19453 [ASAN] Rename TypeSize to TypeStoreSize [mostly NFC]
This is a mechanical prep change for scalable vector support.  All it does is move the point of TypeSize to unsigned (i.e. the unsafe cast) closer to point of use.
2023-03-02 10:47:28 -08:00
Peter Klausler
8489f17713 [flang][runtime] Handle explicit-length character padding & truncation in Assign()
When the left-hand side of an allocatable assignment has an explicit character length,
rather than a deferred length that might imply reallocation, handle any discrepancy
in lengths via truncation or blank padding.

Differential Revision: https://reviews.llvm.org/D145111
2023-03-02 10:33:59 -08:00
Peter Klausler
a3c6a7d53d [flang] Stricter interface compatibility checking for TBP overrides
The compiler currently ignores attributes for PASS dummy arguments that
are incompatible between a type-bound procedure in an extended type and
the binding of the same name that it overrides in an ancestor type,
if any.  Strengthen this checking so that discrepancies between attributes
and intents are caught, and add some tests.

Differential Revision: https://reviews.llvm.org/D145110
2023-03-02 10:20:33 -08:00
Peter Klausler
2216c4c6a4 [flang] Catch name conflict between generic TBP and inherited non-generic
A generic procedure binding in an extended derived type may not have the
same name as a symbol inherited from an ancestor type unless that inherited
symbol is also a generic TBP.  Since generic names can be things like
"ASSIGNMENT(=)", name resolution doesn't use OkToAddComponent() for
generic TBPs, which would have caught this error as it does for other
symbols in derived types, so it must be special-cased.

Differential Revision: https://reviews.llvm.org/D145109
2023-03-02 10:10:37 -08:00
Peter Klausler
69e2665c8b [flang] BIND(C,NAME=...) corrections
The Fortran standard's various restrictions on the use of BIND(C)
often depend more on the presence or absence of an explicit NAME=
specification rather than on its value, but semantics and module
file generation aren't making distinctions between explicit NAME=
specifications that happen to match the default name and declarations
that don't have NAME=.  Tweak semantics and module file generation
to conform, and also complain when named BIND(C) attributes are
erroneously applied to entities that can't support them, like
ABSTRACT interfaces.

Differential Revision: https://reviews.llvm.org/D145107
2023-03-02 10:10:06 -08:00
Louis Dionne
33cf401222 [libc++][NFC] Reformat aligned_storage specialization macro 2023-03-02 13:05:15 -05:00
Peter Klausler
bd87f2df4a [flang] Enforce prohibition against empty interoperable arrays
Fortran doesn't allow a BIND(C) variable or a component of a BIND(C)
type to be an array with no elements.

Differential Revision: https://reviews.llvm.org/D145106
2023-03-02 09:55:08 -08:00
Peter Klausler
7020180226 [flang] A TBP override may not make a public binding private
When a procedure binding in a derived type has PRIVATE accessibility,
it may not be an override of a type-bound procedure that is accessible.

Differential Revision: https://reviews.llvm.org/D145104
2023-03-02 09:51:21 -08:00
Peter Klausler
e86bf46825 [flang] Disallow intrinsics and statement functions from generics
Generic interfaces are not permitted to have intrinsic procedures or
statement functions as specific procedures.

Differential Revision: https://reviews.llvm.org/D145103
2023-03-02 09:50:49 -08:00
Kiran Chandramohan
0ca86a42f0 [Flang][OpenMP] Improved reduction clause TODO message
Provide the name of the construct and the clause info (reduction)
in the TODO mesage.

Reviewed By: DavidTruby

Differential Revision: https://reviews.llvm.org/D145061
2023-03-02 17:46:36 +00:00
Peter Klausler
5be7f8a666 [flang] Catch attempt to misuse an abstract procedure in a generic interface
A procedure defined in an ABSTRACT INTERFACE may not appear as
a specific procedure in a generic interface.

Differential Revision: https://reviews.llvm.org/D145102
2023-03-02 09:43:00 -08:00
Peter Klausler
41b5f37185 [flang] Warn about violations of an obscure requirement (15.6.4 p2)
The Fortran 2018 standard, perhaps as an attempt to prevent ambiguity
in  older compilers, requires that a statement function appear in an
explicit type declaration statement if its name is also accessible
from a host scope.  F18 processes the specification parts of inner
procedures first, so we don't need this requirement to prevent
ambiguity, and can only really check it retrospectively after name
resolution.  Emit a portability warning when appropriate.

Differential Revision: https://reviews.llvm.org/D145100
2023-03-02 09:42:27 -08:00
Louis Dionne
2765fe8a61 [libc++][NFC] Fix typo in documentation 2023-03-02 12:42:15 -05:00