Commit Graph

332871 Commits

Author SHA1 Message Date
Pavel Labath 38870af859 [lldb] Remove FileSpec->CompileUnit inheritance
Summary:
CompileUnit is a complicated class. Having it be implicitly convertible
to a FileSpec makes reasoning about it even harder.

This patch replaces the inheritance by a simple member and an accessor
function. This avoid the need for casting in places where one needed to
force a CompileUnit to be treated as a FileSpec, and does not add much
verbosity elsewhere.

It also fixes a bug where we were wrongly comparing CompileUnit& and a
CompileUnit*, which compiled due to a combination of this inheritance
and the FileSpec*->FileSpec implicit constructor.

Reviewers: teemperor, JDevlieghere, jdoerfert

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70827
2019-11-29 11:44:45 +01:00
Victor Campos e478385e77 [ARM] Fix instruction selection for ARMISD::CMOV with f16 type
Summary:
In the cases where the CMOV (f16) SDNode is used with condition codes
LT, LE, VC or NE, it is successfully selected into a VSEL instruction.

In the remaining cases, however, instruction selection fails since VSEL
does not support other condition codes.

This patch handles such cases by using the single-precision version of
the VMOV instruction.

Reviewers: ostannard, dmgreen

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70667
2019-11-29 10:40:37 +00:00
Ilya Biryukov e702bdb859 [Syntax] Build SimpleDeclaration node that groups multiple declarators
Summary:
Also remove the temporary TopLevelDeclaration node and add
UnknownDeclaration to represent other unknown nodes.

See the follow-up change for building more top-level declarations.
Adding declarators is also pretty involved and will be done in another
follow-up patch.

Reviewers: gribozavr2

Reviewed By: gribozavr2

Subscribers: merge_guards_bot, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70787
2019-11-29 11:39:45 +01:00
Raphael Isemann a48b5e2474 [lldb][NFC] Fix header guard comment in ThreadSafeDenseMap.h 2019-11-29 11:34:18 +01:00
Ilya Biryukov 4b24ab181a [AST] Remove unused and undefined `TypeLoc::IgnoreMacroDefinitions` function. NFC
Looks like an accidental leftover from the older version of the code.
2019-11-29 11:21:07 +01:00
Sam McCall 407ac2eb5f [clangd] Log cc1 args at verbose level.
Summary: This will help debugging driver issues.

Reviewers: kbobyrev

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70832
2019-11-29 11:00:01 +01:00
Haojian Wu 66ab932fcc [clangd] Correct the file path in Edit::replacements when generating the rename edit.
Summary:
The file path was set to the file content previously, and it isn't
covered by normal clangd & unittest code path (as we only uses the
offset, length, replacement text).

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70828
2019-11-29 10:12:56 +01:00
Ilya Biryukov 302cb3bc3d [Syntax] Add a comment explaining the pointer keys in std::map<Token*, ...>. NFC 2019-11-29 09:49:24 +01:00
Ilya Biryukov def65bb4f5 [Syntax] Remove unused parameter from `TreeBuilder::markChildToken`. NFC 2019-11-29 09:45:06 +01:00
Georgii Rymar 99adf047c8 [llvm-readelf][test] - Update comment in elf-verdef-invalid.test. NFC.
It was suggested to change it during review of D70810,
but I've forgotten to update it before commit.
2019-11-29 11:38:27 +03:00
Georgii Rymar 7ab1481361 [llvm-readelf/llvm-readobj] - Check version of SHT_GNU_verdef section entries when dumping.
Elfxx_Verdef contains the following field:

vd_version
Version revision. This field shall be set to 1.
(https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html)

Our code should check the struct version for correctness. This patch does that.
(This will help to simplify or eliminate ELFDumper<ELFT>::LoadVersionDefs() which
has it's own logic to parse version definitions for no reason. It checks the
struct version currently).

Differential revision: https://reviews.llvm.org/D70810
2019-11-29 11:09:56 +03:00
David Zarzycki 06e5ebf8db
[libcxx] Add -Wno-deprecated-copy to the test config 2019-11-29 09:57:51 +02:00
Georgii Rymar 13cbcf1c1a [yaml2obj] - Add a way to describe content of the SHT_GNU_verneed section with "Content".
There is no way to set raw content for SHT_GNU_verneed section.
This patch implements it.

Differential revision: https://reviews.llvm.org/D70816
2019-11-29 10:50:00 +03:00
Hideto Ueno 6c742fdbf4 [Attributor] Deduce dereferenceable based on accessed bytes map
Summary:
This patch introduces the deduction based on load/store instructions whose pointer operand is a non-inbounds GEP instruction.
For example if we have,
```
void f(int *u){
 u[0] = 0;
 u[1] = 1;
 u[2] = 2;
}
```
then u must be dereferenceable(12).

This patch is inspired by D64258

Reviewers: jdoerfert, spatel, hfinkel, RKSimon, sstefan1, xbolva00, dtemirbulatov

Reviewed By: jdoerfert

Subscribers: jfb, lebedev.ri, xbolva00, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70714
2019-11-29 06:55:58 +00:00
Hideto Ueno dfedae5001 [Attributor] Remove dereferenceable_or_null when nonull is present
Summary: This patch prevents the simultaneous presence of `dereferenceable` and `dereferenceable_or_null` attribute

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70789
2019-11-29 06:45:07 +00:00
Fangrui Song b0e979724f [PassInstrumentation] Remove excess newline for the new pass manager
This also removes excess newline for the legacy pass manager when -filter-print-funcs is specified.
2019-11-28 17:20:17 -08:00
Nico Weber 5190cf8ffd gn build: Add a toggle for building against the commandline tools SDK on macOS 2019-11-28 19:30:34 -05:00
Craig Topper 2f3e8cb313 [LegalizeTypes] Add strict FP support to SoftenFloatRes_FP_ROUND. Fix mistake in SoftenFloatRes_FP_EXTEND.
These will be needed for ARM fp-instrinsics.ll which is currently
XFAILed.

One of the getOperand calls in SoftenFloatRes_FP_EXTEND was not
taking strict FP into account. It only affected the call
to setTypeListBeforeSoften which only has an effect on some targets.
2019-11-28 15:32:09 -08:00
Craig Topper 68ddf434c0 [LegalizeTypes] In SoftenFloatRes_FNEG, always generate integer arithmetic, never fall back to using fsub.
We would previously fallback if the type wasn't f32/f64/f128. But
I don't think any of the other floating point types ever go through
the softening code anyway. So this code is dead.
2019-11-28 15:30:34 -08:00
Craig Topper 2485fa7739 [LegalizeTypes] Use SoftenFloatRes_Unary in SoftenFloatRes_FCBRT to reduce code.
We don't have a STRICT_CBRT ISD opcode, but we can still
use SoftenFloatRes_Unary to simplify some code.
2019-11-28 15:30:34 -08:00
Amaury Séchet ca818f4550 [DAGCombiner] Peek through vector concats when trying to combine shuffles.
Summary: This combine showed up as needed when exploring the regression when processing the DAG in topological order.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68195
2019-11-28 23:57:29 +01:00
Bryan Chan 4d3198e243 [OpenMP] build offload plugins before testing them
Summary:
"make check-all" or "make check-libomptarget" would attempt to run offloading
tests before the offload plugins are built. This patch corrects that by adding
dependencies to the libomptarget CMake rules.

Reviewers: jdoerfert

Subscribers: mgorny, guansong, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D70803
2019-11-28 17:43:56 -05:00
Fangrui Song 4adddbd8ad [LegacyPassManager] Simplify FunctionPass::assignPassManager
And make it clear the parameter PreferredType is unused for FunctionPass.
2019-11-28 14:06:55 -08:00
Alexandre Ganea 1abd4c94d7 [Clang] Bypass distro detection on non-Linux hosts
Skip distro detection when we're not running on Linux, or when the target triple is not Linux. This saves a few OS calls for each invocation of clang.exe.

Differential Revision: https://reviews.llvm.org/D70467
2019-11-28 17:02:06 -05:00
Fangrui Song a7abe6eac0 [LegacyPassManager] Simplify PMStack pop 2019-11-28 13:48:26 -08:00
Lang Hames 674df13b5f [ORC][JITLink] Add support for weak references, and improve handling of static
libraries.

This patch substantially updates ORCv2's lookup API in order to support weak
references, and to better support static archives. Key changes:

-- Each symbol being looked for is now associated with a SymbolLookupFlags
   value. If the associated value is SymbolLookupFlags::RequiredSymbol then
   the symbol must be defined in one of the JITDylibs being searched (or be
   able to be generated in one of these JITDylibs via an attached definition
   generator) or the lookup will fail with an error. If the associated value is
   SymbolLookupFlags::WeaklyReferencedSymbol then the symbol is permitted to be
   undefined, in which case it will simply not appear in the resulting
   SymbolMap if the rest of the lookup succeeds.

   Since lookup now requires these flags for each symbol, the lookup method now
   takes an instance of a new SymbolLookupSet type rather than a SymbolNameSet.
   SymbolLookupSet is a vector-backed set of (name, flags) pairs. Clients are
   responsible for ensuring that the set property (i.e. unique elements) holds,
   though this is usually simple and SymbolLookupSet provides convenience
   methods to support this.

-- Lookups now have an associated LookupKind value, which is either
   LookupKind::Static or LookupKind::DLSym. Definition generators can inspect
   the lookup kind when determining whether or not to generate new definitions.
   The StaticLibraryDefinitionGenerator is updated to only pull in new objects
   from the archive if the lookup kind is Static. This allows lookup to be
   re-used to emulate dlsym for JIT'd symbols without pulling in new objects
   from archives (which would not happen in a normal dlsym call).

-- JITLink is updated to allow externals to be assigned weak linkage, and
   weak externals now use the SymbolLookupFlags::WeaklyReferencedSymbol value
   for lookups. Unresolved weak references will be assigned the default value of
   zero.

Since this patch was modifying the lookup API anyway, it alo replaces all of the
"MatchNonExported" boolean arguments with a "JITDylibLookupFlags" enum for
readability. If a JITDylib's associated value is
JITDylibLookupFlags::MatchExportedSymbolsOnly then the lookup will only
match against exported (non-hidden) symbols in that JITDylib. If a JITDylib's
associated value is JITDylibLookupFlags::MatchAllSymbols then the lookup will
match against any symbol defined in the JITDylib.
2019-11-28 13:30:49 -08:00
Simon Atanasyan f4d32ae75b [mips] Check that features required by built-ins are enabled
Now Clang does not check that features required by built-in functions
are enabled. That causes errors in the backend reported in PR44018.

This patch fixes this bug by checking that required features
are enabled.

This should fix PR44018.

Differential Revision: https://reviews.llvm.org/D70808
2019-11-29 00:23:00 +03:00
Florian Hahn ec3efcf11f [IVDescriptors] Skip FOR where we have multiple sink points for now.
This fixes a crash with instructions where multiple operands are
first-order-recurrences.
2019-11-28 22:18:47 +01:00
Konrad Kleine c671639af6 [lldb] NFC: refactor CompileUnit::ResolveSymbolContext
Summary:
I found the above named method hard to read because it had

a) many nested blocks,
b) one return statement at the end with some logic involved,
c) a duplicated while-loop with just small differences in it.

I decided to refactor this function by employing an early exit strategy.
In order to capture the logic in the return statement and to not have it
repeated more than once I chose to implement a very small lamda function
that captures all the variables it needs.
I also replaced the two while-loops with just one.

This is a non-functional change (NFC).

Reviewers: jdoerfert, teemperor

Reviewed By: teemperor

Subscribers: labath, teemperor, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70774
2019-11-28 21:37:31 +01:00
Alexandre Ganea bdad3ec75a [LLDB] On Windows, force error message formatting to English
This fixes the Utility/StatusTest.ErrorWin32 unit test on non-English locales.

Differential Revision: https://reviews.llvm.org/D70442
2019-11-28 14:15:13 -05:00
Alexandre Ganea b4dfc5508f [LLDB] Fix wrong argument in CommandObjectThreadStepWithTypeAndScope
Differential Revision: https://reviews.llvm.org/D70448
2019-11-28 14:00:56 -05:00
Austin Kerbow 256ad954a9 AMDGPU: Reuse carry out register during FI elimination
Summary:
Pre gfx9 we need to scavenge a 64-bit SGPR to use as the carry out for an Add.
If only one SGPR was available this crashed when trying to scavenge another
32bit SGPR to materialize the offset.

Instead, reuse a 32-bit SGPR from the carry out as the offset register.

Also prefer to use vcc for the unused carry out when it is available.

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70614
2019-11-28 10:13:48 -08:00
Simon Tatham acd7fe8636 [AArch64][v8.3a] Don't emit LDRA '[xN]!' alias in disassembly.
Summary:
In rG643ac6c0420b, the syntax `ldraa x1, [x0]!` was added as an alias
for `ldraa x1, [x0, #0]!`. That syntax is less obvious in meaning, and
also will not be accepted by assemblers that haven't been updated yet.
So it would be better not to emit it as the preferred disassembly for
that instruction.

This change lowers the EmitPriority of the new alias so that the more
explicit syntax `[x0, #0]!` is preferred by the disassembler. The new
syntax is still accepted by the assembler.

Reviewers: ab, ostannard

Reviewed By: ostannard

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70813
2019-11-28 15:31:59 +00:00
Miloš Stojanović ed864745c9 [OpenMP][test] Fix test on MIPS-based buildbots
On MIPS `zeroext` or `signext` can appear in the output.

Differential Revision: https://reviews.llvm.org/D70820
2019-11-28 16:18:55 +01:00
Raphael Isemann c2dd84e396 [lldb][NFC] Remove CompilerDeclContext::IsClang
This method is only used in ClangASTContext.

Also removes the includes we only needed for the ClangASTContext RTTI check
in the CompilerDecl[Context].cpp files.
2019-11-28 15:54:11 +01:00
Raphael Isemann f39277c1d3 [lldb][NFC] Remove unused variable in ClangASTSource::CompleteType
Now that CompilerDeclContext is a trivial class, Clang started warning
that this unused variable is in fact unused. Let's remove it.
2019-11-28 15:32:56 +01:00
Raphael Isemann e0203b25af [lldb][NFC] Simplify CompilerDecl and CompilerDeclContext initialization 2019-11-28 15:27:54 +01:00
Raphael Isemann 3cd8ba0e37 [lldb][NFC] Remove unused CompilerDecl::IsClang 2019-11-28 15:11:37 +01:00
Pavel Labath b18e190b7c [lldb] refactor FileSpec::Equal
The logic of this function was quite hard to follow. Replace it with a
much simpler, equivalent, implementation.
2019-11-28 14:33:25 +01:00
Pavel Labath bf716eb807 [lldb] Add FileSpec::Equal unit tests
this is in preparation of a refactor of this method.
2019-11-28 14:31:52 +01:00
Pavel Labath d1a561d446 [lldb] Simplify and improve FileSpecTest
Summary:
A most of these tests create FileSpecs with a hardcoded style. Add
utility functions which create a file spec of a given style to simplify
things.

While in there add SCOPED_TRACE messages to tests which loop over
multiple inputs to ensure it's clear which of the inputs failed.

Reviewers: teemperor

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70814
2019-11-28 14:31:29 +01:00
Raphael Isemann 50e2ffa18d Revert "[lldb] NFC: refactor CompileUnit::ResolveSymbolContext"
This reverts commit 373e2a4f69.

This broke breakpoint setting.
2019-11-28 14:25:46 +01:00
Benjamin Kramer 66237889a7 [include-fixer] Python 3 support for clang-include-fixer.py
Patch by Yannick Brehon!
2019-11-28 14:22:21 +01:00
Raphael Isemann 42c857aa47 [lldb][NFC] Remove unused STLUtil include and STLUtil.h header 2019-11-28 14:11:35 +01:00
Raphael Isemann a54ef8af89 [lldb][NFC] Use llvm::StringRef instead of C-strings as multimap key 2019-11-28 14:05:47 +01:00
Konrad Kleine 373e2a4f69 [lldb] NFC: refactor CompileUnit::ResolveSymbolContext
Summary:
I found the above named method hard to read because it had

a) many nested blocks and
b) one return statement at the end with some logic involved.

I decided to refactor this function by employing an early exit strategy.
In order to capture the logic in the return statement and to not have it
repeated more than once I chose to implement a very small lamda function
that captures all the variables it needs.

This is a non-functional change (NFC).

Reviewers: jdoerfert

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70774
2019-11-28 14:00:38 +01:00
Haojian Wu 3c3aca245e [clangd] Don't perform rename when the refs result from index is incomplete.
Summary:
Also do an early return if the number of affected files > limit to save
some unnecessary FileURI computations.

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70811
2019-11-28 13:56:19 +01:00
Raphael Isemann 2e3c040ee0 [lldb][NFC] Remove unused CStringToDIEMap typedef 2019-11-28 13:33:19 +01:00
Haojian Wu 2330cee82f [clangd] Prefer the left character if the character on the right of the cursor is semicolon.
Summary: This would make go-to-def works on the cases like int A = abc^;

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70807
2019-11-28 13:15:10 +01:00
Haojian Wu 08cce03a6d [clangd] Tweak the no-index error message for rename, NFC.
Summary: The current error message doesn't fit well for cross-file rename.

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70809
2019-11-28 13:03:28 +01:00