Commit Graph

341140 Commits

Author SHA1 Message Date
Kamil Rytarowski 3a200f3f2e [compiler-rt] Fix build on NetBSD 9.99.44
Fix build on >= 9.99.44 after the removal of urio(4).
Add compat code for the device as NetBSD-9.0 is supported.
2020-01-31 14:57:20 +01:00
Jay Foad 31e29d4afe AMDGPU/GlobalISel: Make use of MachineIRBuilder helper functions. NFC. 2020-01-31 13:53:39 +00:00
Pavel Labath 877963a35a [lldb/DWARF] Delete some dead code in SymbolFileDWARF
- m_debug_loc(lists) are unused since the relevant logic was moved to
  DWARFContext.
- const versions of DebugInfo(), DebugAbbrev() are not used, and they
  are dangerous to use as they do not initialize the relevant objects.
2020-01-31 14:47:25 +01:00
serge-sans-paille fd09f12f32 Implement -fsemantic-interposition
First attempt at implementing -fsemantic-interposition.

Rely on GlobalValue::isInterposable that already captures most of the expected
behavior.

Rely on a ModuleFlag to state whether we should respect SemanticInterposition or
not. The default remains no.

So this should be a no-op if -fsemantic-interposition isn't used, and if it is,
isInterposable being already used in most optimisation, they should honor it
properly.

Note that it only impacts architecture compiled with -fPIC and no pie.

Differential Revision: https://reviews.llvm.org/D72829
2020-01-31 14:02:33 +01:00
Sjoerd Meijer 24f0b6b6d8 [llvm-objdump] avoid crash disassembling unknown instruction
Disassembly of instructions can fail when llvm-objdump is not given the right set of
architecture features, for example when the source is compiled with:

  clang -march=..+ext1+ext2

and disassembly is attempted with:

  llvm-objdump -mattr=+ext1

This patch avoids further analysing unknown instructions (as was happening
before) when disassembly has failed.

Differential Revision: https://reviews.llvm.org/D73531
2020-01-31 12:41:31 +00:00
Raphael Isemann 09217b60fc [lldb][NFC] Add a CompilerDecl->clang::Decl conversion function to ClangUtil
This automatically does the type checking for the cast.
2020-01-31 13:20:02 +01:00
Raphael Isemann 1ccc702912 [lldb][NFC] Remove unnecessary ClangASTImporter checks in ClangASTSource
A ClangASTSource always has a ClangASTImporter. Let's remove these sporadic
checks with a single assert during construction. They were added originally
for the modern-type-lookup mode that didn't use a ClangASTImporter in there.
2020-01-31 13:17:08 +01:00
Raphael Isemann 19f1ce6735 [lldb][NFC] Remove ParserVars::m_parser_type member that was never read
We only assign values to this member but never read it. Also the
type in there has no side effects so let's just remove it.
2020-01-31 12:54:01 +01:00
Kerry McLaughlin 69558c8487 [AArch64][SVE] Add remaining SVE2 intrinsics for uniform DSP operations
Summary:
Implements the following intrinsics:

 - @llvm.aarch64.sve.[s|u]qadd
 - @llvm.aarch64.sve.[s|u]qsub
 - @llvm.aarch64.sve.suqadd
 - @llvm.aarch64.sve.usqadd
 - @llvm.aarch64.sve.[s|u]qsubr
 - @llvm.aarch64.sve.[s|u]rshl
 - @llvm.aarch64.sve.[s|u]qshl
 - @llvm.aarch64.sve.[s|u]qrshl
 - @llvm.aarch64.sve.[s|u]rshr
 - @llvm.aarch64.sve.sqshlu
 - @llvm.aarch64.sve.sri
 - @llvm.aarch64.sve.sli
 - @llvm.aarch64.sve.[s|u]sra
 - @llvm.aarch64.sve.[s|u]rsra
 - @llvm.aarch64.sve.[s|u]aba

Reviewers: efriedma, sdesmalen, dancgr, cameron.mcinally, c-rhodes, rengolin

Reviewed By: sdesmalen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73551
2020-01-31 10:51:57 +00:00
Marek Kurdej e93e58c6c4 Reland [libc++] [P0325] Implement to_array from LFTS with updates.
Fixed expected errors and notes.

Summary:
This patch implements https://wg21.link/P0325.

Reviewers: EricWF, mclow.lists, ldionne, lichray

Reviewed By: ldionne, lichray

Subscribers: lichray, dexonsmith, zoecarver, christof, ldionne, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D69882
2020-01-31 11:47:18 +01:00
Sam Parker e014de3a16 [NFC][ARM] Add test 2020-01-31 10:32:15 +00:00
Georgii Rymar 0654005ab2 [llvm-readobj] - Don't crash when dumping invalid dynamic relocation.
Currently when we dump dynamic relocation with use of
DT_RELA/DT_RELASZ/DT_RELAENT tags, we crash when a symbol index
is larger than the number of dynamic symbols or
when there is no dynamic symbol table.

This patch adds test cases and fixes the issues.

Differential revision: https://reviews.llvm.org/D73560
2020-01-31 13:20:51 +03:00
Stephan Herhut 84695dd4d7 Fix conversion of loops to GPU with no block/thread dimensions.
Summary:
The current code assumes that one always maps at least one loop to block
dimensions and at least one loop to thread dimensions. If either is not
the case, a loop would get mapped twice.

Differential Revision: https://reviews.llvm.org/D73685
2020-01-31 11:00:28 +01:00
Georgii Rymar cf6037b561 [llvm-readobj][test] - Cleanup testing of the --sections command line option.
We have the `ELF\sections.test` to test --sections.

`ELF\sections.test` uses precompiled objects, it has a bug (does not test -s alias properly).
Also, we test machine specific section types in `ELF\machine-specific-section-types.test`,
so we probably do not need to test `--sections` for a MIPS object in `ELF\sections.test`.
I think it is enough to test ELF32 and ELF64 (we do not test ELF64 in this test).

`Object/readobj-shared-object.test` also tests how llvm-readobj handles
`--sections`. It is location is wrong, it is not complete, it uses precompiled binaries
and it duplicates the `ELF\sections.test` partially (it tests both ELF32 and ELF64).

We have `ELF\readelf-s-alias.test` that tests the `-s` alias for `--sections` in llvm-readobj
and `-s` as an alias for `--symbols` in llvm-readelf.
There is no need to have a separate test for such things.
The test for the `-s` alias for `--sections` can be included into the `ELF\sections.test`.
And the test for `-s` for llvm-readelf is already included into `ELF\symbols.test`.

So, this patch:
1) Removes `Object/readobj-shared-object.test`.
2) Removes `ELF\readelf-s-alias.test`
3) Rewrites the `ELF\sections.test`.
4) Removes ELF/Inputs/trivial.obj.elf-mipsel.

Differential revision: https://reviews.llvm.org/D73686
2020-01-31 12:58:12 +03:00
Markus Böck 3f6a2f1ec5 [Support] Wrap extern TLS variable in getter function
This patch wraps an external thread local storage variable inside of a
getter function and makes it have internal linkage. This allows LLVM to
be built with BUILD_SHARED_LIBS on windows with MinGW. Additionally it
allows Clang versions prior to 10 to compile current trunk for MinGW.

Differential Revision: https://reviews.llvm.org/D73639
2020-01-31 11:32:36 +02:00
LLVM GN Syncbot bf8357d420 [gn build] Port 16a0313ee3 2020-01-31 09:18:27 +00:00
Raphael Isemann 99e63f5825 [lldb] Print the command output when 'expect' fails even if a custom msg is passed
Currently if 'expect' fails and a custom msg is supplied, then lldbtest
will not print the actual command output. This makes it impossible to know
why the test actually failed. This just prints the command output even
if the msg parameter was supplied.
2020-01-31 10:16:46 +01:00
Guillaume Chatelet 85314e9b7a [libc] Add utils for memory functions
Summary: This patch adds a few low level functions needed to build libc memory functions.

Reviewers: sivachandra, jfb

Subscribers: mgorny, MaskRay, tschuett, libc-commits, ckennelly

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D73472
2020-01-31 10:15:02 +01:00
Igor Kudrin 16a0313ee3 [DWARF] Add support for 64-bit DWARF in .debug_names.
Differential Revision: https://reviews.llvm.org/D72900
2020-01-31 16:12:35 +07:00
Marek Kurdej 5e7017273f Revert "[libc++] [P0325] Implement to_array from LFTS with updates."
This reverts commit 86aae78268.

A test is failing on "Release" build without assertions enabled (Fedora 31 on x86_64).
2020-01-31 09:45:50 +01:00
Raphael Isemann 46ca55f2a2 [lldb][NFC] Add safe Decl->CompilerDecl conversion function TypeSystemClang
This adds a conversion function from clang::Decl to CompilerDecl. It checks
that the TypeSystemClang in the CompilerDecl actually fits to the clang::Decl
AST during creation, thus preventing the creation of CompilerDecl instances with
inconsistent state.
2020-01-31 09:44:24 +01:00
Raphael Isemann 48acece15d [lldb][NFC] Cleanup ClangASTImporter::LayoutInfo 2020-01-31 09:06:09 +01:00
Sebastian Neubauer adc0217416 Fix typo
Summary: Fix typo

Subscribers: jvesely, nhaehnle, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73458
2020-01-31 08:48:22 +01:00
Tim Shen 3ccaac3cdd [mlir] Add MemRefTypeBuilder and refactor some MemRefType::get().
The refactored MemRefType::get() calls all intend to clone from another
memref type, with some modifications. In fact, some calls dropped memory space
during the cloning. Migrate them to the cloning API so that nothing gets
dropped if they are not explicitly listed.

It's close to NFC but not quite, as it helps with propagating memory spaces in
some places.

Differential Revision: https://reviews.llvm.org/D73296
2020-01-30 23:30:46 -08:00
Alex Langford 381e81a048 [lldb][NFCI] Remove UserExpression::GetJITModule
UserExpression::GetJITModule was used to support an option in
UserExpression::Evaluate that let you hold onto the JIT Module used during
the expression evaluation. This was only actually used in one spot --
REPL::IOHandlerInputComplete. That method didn't actually take use the
JIT module it got back, so this feature was not used in practice.
This means that we can delete the support in UserExpression::Evaluate
and delete the UserExpression::GetJITModule method entirely.
2020-01-30 23:20:19 -08:00
Alex Langford 22b044877d [lldb][NFCI] Remove unused LanguageType parameters
These parameters are unused in these methods, and some of them only had a
LanguageType parameter to pipe to other methods that don't use it
either.
2020-01-30 21:57:23 -08:00
Jonas Devlieghere 196b31f9f1 [lldb/Lit] Fix UnboundLocalError when reaching a timeout.
Fixes the UnboundLocalError for the local variables out, err and
exitCode when a timeout is hit.
2020-01-30 21:23:58 -08:00
Jonas Devlieghere a5f479473b [SmallString] Use data() instead of begin() (NFC)
Both begin() and data() do the same thing for the SmallString case, but
the std::string and llvm::StringRef constructors that are being called
are defined as taking a pointer and size.

Addresses Craig Topper's feedback in https://reviews.llvm.org/D73640
2020-01-30 20:15:38 -08:00
Quentin Colombet cfebd77742 [GISel][KnownBits] Fix a bug where we could run out of stack space
One of the exit criteria of computeKnownBits is whether we reach the max
recursive call depth. Before this patch we would check that the
depth is exactly equal to max depth to exit.

Depth may get bigger than max depth if it gets passed to a different
GISelKnownBits object.
This may happen when say a generic part uses a GISelKnownBits object
with some max depth, but then we hit TL.computeKnownBitsForTargetInstr
which creates a new GISelKnownBits object with a different and smaller
depth. In that situation, when we hit the max depth check for the first
time in the target specific GISelKnownBits object, depth may already
be bigger than the current max depth. Hence we would continue to compute
the known bits, until we ran through the full depth of the chain of
computation or ran out of stack space.

For instance, let say we have
GISelKnownBits Info(/*MaxDepth*/ = 10);
Info.getKnownBits(Foo)
// 9 recursive calls to computeKnownBitsImpl.
// Then we hit a target specific instruction.
// The target specific GISelKnownBits does this:
  GISelKnownBits TargetSpecificInfo(/*MaxDepth*/ = 6)
  TargetSpecificInfo.computeKnownBitsImpl() // <-- next max depth checks would
                                            // always return false.

This commit does not have any test case, none of the in-tree targets
use computeKnownBitsForTargetInstr.
2020-01-30 19:30:39 -08:00
Richard Smith 1db66e705f PR44627: Consider reversing == and <=> candidates found by ADL. 2020-01-30 18:41:54 -08:00
Pierre Habouzit c6cf3602e2 Revert "[objc_direct] Small updates to help with adoption."
This reverts commit bebb8e2596.

Pushed by accident, not yet reviewed
2020-01-30 18:21:25 -08:00
Pierre Habouzit bebb8e2596 [objc_direct] Small updates to help with adoption.
Add fixits for messaging self in MRR or using super, as the intent is
clear, and it turns out people do that a lot more than expected.

Allow for objc_direct_members on main interfaces, it's extremely useful
for internal only classes, and proves to be quite annoying for adoption.

Add some better warnings around properties direct/non-direct clashes (it
was done for methods but properties were a miss).

Radar-Id: rdar://problem/58355212
Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
2020-01-30 18:17:45 -08:00
Pierre Habouzit 6eb969b7c5 [objc_direct] fix codegen for mismatched Decl/Impl return types
For non direct methods, the codegen uses the type of the Implementation.
Because Objective-C rules allow some differences between the Declaration
and Implementation return types, when the Implementation is in this
translation unit, the type of the Implementation should be preferred to
emit the Function over the Declaration.

Radar-Id: rdar://problem/58797748
Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
Differential Revision: https://reviews.llvm.org/D73208
2020-01-30 18:17:45 -08:00
Alex Langford 31905c2bbb [lldb][NFCI] Delete commented out code 2020-01-30 18:02:36 -08:00
Fangrui Song 200ac6c3d8 [llvm-objcopy][test] Fix tests when path contains "bar"
Differential Revision: https://reviews.llvm.org/D72358
2020-01-30 17:56:12 -08:00
Fangrui Song 5b22bcc2b7 [X86][ELF] Prefer to lower MC_GlobalAddress operands to .Lfoo$local
For a MC_GlobalAddress reference to a dso_local external GlobalValue with a definition, emit .Lfoo$local to avoid a relocation.

-fno-pic and -fpie can infer dso_local but -fpic cannot.  In the future,
we can explore the possibility of inferring dso_local with -fpic. As the
description of D73228 says, LLVM's existing IPO optimization behaviors
(like -fno-semantic-interposition) and a previous assembly behavior give
us enough license to be aggressive here.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D73230
2020-01-30 17:52:35 -08:00
Saar Raz 980517b353 [Concepts] Check function constraints before deducing auto return type
A constrained function with an auto return type would have it's definition
instantiated in order to deduce the auto return type before the constraints
are checked.

Move the constraints check after the return type deduction.
2020-01-31 03:51:26 +02:00
Richard Smith 5ae6554a1d PR41991: Accept attributes on defaulted and deleted friends.
Attributes are permitted on friend definitions, but we only checked for
a proper function body, not for the =default / =delete cases.
2020-01-30 17:42:17 -08:00
Richard Smith 1f3f8c369a PR44721: Don't consider overloaded operators for built-in comparisons
when building a defaulted comparison.

As a convenient way of asking whether `x @ y` is valid and building it,
we previouly always performed overload resolution and built an
overloaded expression, which would both end up picking a builtin
operator candidate when given a non-overloadable type. But that's not
quite right, because it can result in our finding a user-declared
operator overload, which we should never do when applying operators
non-overloadable types.

Handle this more correctly: skip overload resolution when building
`x @ y` if the operands are not overloadable. But still perform overload
resolution (considering only builtin candidates) when checking validity,
as we don't have any other good way to ask whether a binary operator
expression would be valid.
2020-01-30 17:16:50 -08:00
Richard Smith d28763cad0 Replace 'AllowExplicit' bool with an enum. No functionality change.
In passing, split it up into three values (no explicit functions /
explicit conversion functions only / any explicit functions) in
preparation for using that in a future change.
2020-01-30 17:16:50 -08:00
Leonard Chan 2d3174c4df [SafeStack][DebugInfo] Insert DW_OP_deref in correct location
This patch addresses the issue found in https://bugs.llvm.org/show_bug.cgi?id=44585
where a DW_OP_deref was placed at the end of a dwarf expression, resulting in corrupt
symbols when debugging.

This is an attempt to reland with a few fixes for buildbot since I
haven't merged from master in a bit.

Differential Revision: https://reviews.llvm.org/D73526
2020-01-30 17:09:42 -08:00
Martijn Vels 282b803b62 White space only change: reflow a comment in basic_string
Summary: This change reflows a comment line. This change serves as a no-op test commit

Reviewers: mclow.lists, ldionne, EricWF

Subscribers: dexonsmith, christof, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D73552
2020-01-30 19:55:48 -05:00
Alex Langford e1451a724d [lldb][NFCI] Rename variable in ValueObject 2020-01-30 16:53:01 -08:00
Amara Emerson 84bd851108 [GlobalISel][IRTranslator] When translating vector geps, splat the base pointer if required.
We can have geps that have a scalar base pointer, and a vector index value, which
means that the base pointer must be splatted into a vector of pointers.

This fixes crashes on arm64 GlobalISel with optimizations enabled.
2020-01-30 16:27:27 -08:00
Leonard Chan 3b23453b6c Revert "[SafeStack][DebugInfo] Insert DW_OP_deref in correct location"
This reverts commit fff6a1b0f1.

This was breaking a bunch of buildbots.
2020-01-30 16:18:41 -08:00
Mehdi Amini 5f940220bf MSVC Buggy version detection: turn pre-processor error into CMake configuration time check
This allows consumer to override in a cleaner way while still prevent
them from hitting bug without knowing they run an unsupported
configuration.

Recommit after fix by Christopher Tetreault to add parens and ${} to
cmake check to work around CMake configure time "unknown arguments
specified" issue

Differential Revision: https://reviews.llvm.org/D73677
Differential Revision: https://reviews.llvm.org/D73751
2020-01-31 00:11:55 +00:00
Hector Diaz 45e3f6660c Auto-completion bug fix for dot operator
Summary:
There was a bug on LLDB VSCode where there was the following behavior:

//Code

```
struct foo {
    int bar:
};
...
foo my_foo = {10};
```

Trying to auto-complete my_foo.b with my_foo.bar resulted instead with my_foo.my_foo.bar

This diff fixes this bug and adds some tests to check correct behavior.

It also fixes the same bug using the arrow operator (->) when user manually requests completions.
TODO: Fix bug where no recommended completions are automatically shown with arrow operator

{F11249959}

{F11249958}

Reviewers: wallace

Reviewed By: wallace

Subscribers: teemperor, labath, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D73506
2020-01-30 16:02:58 -08:00
Leonard Chan fff6a1b0f1 [SafeStack][DebugInfo] Insert DW_OP_deref in correct location
This patch addresses the issue found in https://bugs.llvm.org/show_bug.cgi?id=44585
where a DW_OP_deref was placed at the end of a dwarf expression, resulting in
corrupt symbols when debugging.

Differential Revision: https://reviews.llvm.org/D73526
2020-01-30 15:58:37 -08:00
Jonas Devlieghere 457a6d49d5 [lldb/Reproducers] Fix typo in CMake so we actually replay.
The CMakeLists.txt had a typo which meant that check-lldb-repro was
capturing twice instead of capturing and then replaying. This also
uncovered a missing import in lldb-repro.py. This patch fixes both
issues.
2020-01-30 15:51:29 -08:00
Jonas Devlieghere 58c4fa2c53 [lldb/Reproducers] Use LLDB_RECORD_DUMMY for GetStopDescription
GetStopDescription writes to a const char* with a given length. However,
the reproducer instrumentation serialized the char pointer and length
separately.

To serialize the string, we naively look for the first null byte to
determine its length. This can lead to the method overwriting the input
buffer when the assumed string length is smaller than the actual number
of bytes written by GetStopDescription.

The real solution is to have a custom serializer that takes both
arguments into account. However, given that these are output parameters,
they don't affect replay. If the string is passed as input later, it's
is recorded as such. Therefore I've replaced the instrumentation macro
with LLDB_RECORD_DUMMY which skips the serialization.
2020-01-30 15:40:58 -08:00