Alexandre Ganea [Fri, 29 Nov 2019 15:52:13 +0000 (10:52 -0500)]
[CIndex] Fix annotate-deep-statements test when using a Debug build
Differential Revision: https://reviews.llvm.org/D70149
Sam McCall [Wed, 20 Nov 2019 22:25:17 +0000 (23:25 +0100)]
[clangd] Rethink how SelectionTree deals with macros and #includes.
Summary:
The exclusive-claim model is successful at resolving conflicts over tokens
between parent/child or siblings. However claims at the spelled-token
level do the wrong thing for macro expansions, where siblings can be
equally associated with the macro invocation.
Moreover, any model that only uses the endpoints in a range can fail when
a macro invocation occurs inside the node.
To address this, we use the existing TokenBuffer in more depth.
Claims are expressed in terms of expanded tokens, so there is no need to worry
about macros, includes etc.
Once we know which expanded tokens were claimed, they are mapped onto
spelled tokens for hit-testing.
This mapping is fairly flexible, currently the handling of macros is
pretty simple (map macro args onto spellings, other macro expansions onto the
macro name token).
This mapping is in principle token-by-token for correctness (though
there's some batching for performance).
The aggregation of the selection enum is now more principled as we need to be
able to aggregate several hit-test results together.
For simplicity i removed the ability to determine selectedness of TUDecl.
(That was originally implemented in
90a5bf92ff97b1, but doesn't seem to be very
important or worth the complexity any longer).
The expandedTokens(SourceLocation) helper could be added locally, but seems to
make sense on TokenBuffer.
Fixes https://github.com/clangd/clangd/issues/202
Fixes https://github.com/clangd/clangd/issues/126
Reviewers: hokein
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits, ilya-biryukov
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70512
Martin Storsjö [Tue, 15 Oct 2019 21:08:28 +0000 (00:08 +0300)]
[LLDB] [ARM] Use r11 as frame pointer on Windows on ARM
Extend EmulateMOVRdRm to identify "mov r11, sp" in thumb mode as
setting the frame pointer, if r11 is the frame pointer register.
Differential Revision: https://reviews.llvm.org/D70797
Raphael Isemann [Fri, 29 Nov 2019 13:08:01 +0000 (14:08 +0100)]
[lldb][NFC] Remove unused ClangASTContext::GetBasicType(ConstString)
Raphael Isemann [Fri, 29 Nov 2019 12:43:23 +0000 (13:43 +0100)]
[lldb][NFC] Remove ClangASTContext::GetBuiltinTypeForEncodingAndBitSize overload
Raphael Isemann [Fri, 29 Nov 2019 12:02:41 +0000 (13:02 +0100)]
[lldb][NFC] Explicitly ask for a ClangASTContext in ClangASTSource
ClangASTSource currently takes a clang::ASTContext and keeps that
around, but a lot of LLDB's functionality for doing operations
on a clang::ASTContext is in its ClangASTContext twin class. We
currently constantly recompute the respective ClangASTContext
from the clang::ASTContext while we instead could just pass and
store a ClangASTContext in the ClangASTSource. This also allows
us to get rid of a bunch of unreachable error checking for cases
where recomputation fails for some reason.
Bjorn Pettersson [Fri, 29 Nov 2019 12:24:13 +0000 (13:24 +0100)]
[InstCombine] Run the cast.ll test a twice, now also testing little endian. NFC
Some tests in test/Transforms/InstCombine/cast.ll depend on
endianness. Added a second run line to run the tests with both
big and little endian. In the past we only compiled for big
endian, and then it was hard to see if any big endian bugfixes
would impact the little endian result etc.
Raphael Isemann [Fri, 29 Nov 2019 11:40:19 +0000 (12:40 +0100)]
[lldb][NFC] Early exit in ClangASTContext::CreateInstance
Pavel Labath [Fri, 29 Nov 2019 11:48:25 +0000 (12:48 +0100)]
[lldb] Fix windows build for 38870af
Raphael Isemann [Fri, 29 Nov 2019 11:26:33 +0000 (12:26 +0100)]
[lldb][NFC] Simplify regex_chars in CommandCompletions
Raphael Isemann [Fri, 29 Nov 2019 11:05:47 +0000 (12:05 +0100)]
[lldb][NFC] Remove dead logging code from DWARFASTParserClang::CompleteRecordType
This code is behind a `if (log)` that is always a nullptr as the initializer
was commented out. One could uncomment the initializer code, but then this logging
code just leads to a deadlock as it tries to aquire the module lock.
This removes the logging code until I get this working again.
Sam McCall [Fri, 29 Nov 2019 11:05:00 +0000 (12:05 +0100)]
[clangd] Fix 407ac2e, which was broken and committed too soon
Pavel Labath [Thu, 28 Nov 2019 15:22:44 +0000 (16:22 +0100)]
[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
Victor Campos [Tue, 19 Nov 2019 09:55:16 +0000 (09:55 +0000)]
[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
Ilya Biryukov [Fri, 29 Nov 2019 10:32:58 +0000 (11:32 +0100)]
[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
Raphael Isemann [Fri, 29 Nov 2019 10:34:18 +0000 (11:34 +0100)]
[lldb][NFC] Fix header guard comment in ThreadSafeDenseMap.h
Ilya Biryukov [Fri, 29 Nov 2019 10:10:01 +0000 (11:10 +0100)]
[AST] Remove unused and undefined `TypeLoc::IgnoreMacroDefinitions` function. NFC
Looks like an accidental leftover from the older version of the code.
Sam McCall [Thu, 28 Nov 2019 18:22:50 +0000 (19:22 +0100)]
[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
Haojian Wu [Thu, 28 Nov 2019 15:48:49 +0000 (16:48 +0100)]
[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
Ilya Biryukov [Fri, 29 Nov 2019 08:48:00 +0000 (09:48 +0100)]
[Syntax] Add a comment explaining the pointer keys in std::map<Token*, ...>. NFC
Ilya Biryukov [Fri, 29 Nov 2019 08:44:25 +0000 (09:44 +0100)]
[Syntax] Remove unused parameter from `TreeBuilder::markChildToken`. NFC
Georgii Rymar [Fri, 29 Nov 2019 08:38:27 +0000 (11:38 +0300)]
[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.
Georgii Rymar [Thu, 28 Nov 2019 10:20:25 +0000 (13:20 +0300)]
[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
David Zarzycki [Fri, 29 Nov 2019 07:22:56 +0000 (09:22 +0200)]
[libcxx] Add -Wno-deprecated-copy to the test config
Georgii Rymar [Thu, 28 Nov 2019 13:27:01 +0000 (16:27 +0300)]
[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
Hideto Ueno [Fri, 29 Nov 2019 06:55:58 +0000 (06:55 +0000)]
[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
Hideto Ueno [Fri, 29 Nov 2019 06:45:07 +0000 (06:45 +0000)]
[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
Fangrui Song [Fri, 29 Nov 2019 00:42:27 +0000 (16:42 -0800)]
[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.
Nico Weber [Fri, 29 Nov 2019 00:30:21 +0000 (19:30 -0500)]
gn build: Add a toggle for building against the commandline tools SDK on macOS
Craig Topper [Thu, 28 Nov 2019 23:28:27 +0000 (15:28 -0800)]
[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.
Craig Topper [Thu, 28 Nov 2019 19:36:55 +0000 (11:36 -0800)]
[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.
Craig Topper [Thu, 28 Nov 2019 18:40:50 +0000 (10:40 -0800)]
[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.
Amaury Séchet [Fri, 22 Nov 2019 22:39:18 +0000 (23:39 +0100)]
[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
Bryan Chan [Thu, 28 Nov 2019 07:46:18 +0000 (02:46 -0500)]
[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
Fangrui Song [Thu, 28 Nov 2019 22:00:12 +0000 (14:00 -0800)]
[LegacyPassManager] Simplify FunctionPass::assignPassManager
And make it clear the parameter PreferredType is unused for FunctionPass.
Alexandre Ganea [Thu, 28 Nov 2019 20:56:00 +0000 (15:56 -0500)]
[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
Fangrui Song [Thu, 28 Nov 2019 21:34:32 +0000 (13:34 -0800)]
[LegacyPassManager] Simplify PMStack pop
Lang Hames [Tue, 26 Nov 2019 05:57:27 +0000 (21:57 -0800)]
[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.
Simon Atanasyan [Wed, 27 Nov 2019 16:09:50 +0000 (19:09 +0300)]
[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
Florian Hahn [Thu, 28 Nov 2019 21:08:05 +0000 (22:08 +0100)]
[IVDescriptors] Skip FOR where we have multiple sink points for now.
This fixes a crash with instructions where multiple operands are
first-order-recurrences.
Konrad Kleine [Thu, 28 Nov 2019 15:54:15 +0000 (16:54 +0100)]
[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
Alexandre Ganea [Thu, 28 Nov 2019 19:15:13 +0000 (14:15 -0500)]
[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
Alexandre Ganea [Thu, 28 Nov 2019 16:16:55 +0000 (11:16 -0500)]
[LLDB] Fix wrong argument in CommandObjectThreadStepWithTypeAndScope
Differential Revision: https://reviews.llvm.org/D70448
Austin Kerbow [Fri, 22 Nov 2019 20:25:13 +0000 (12:25 -0800)]
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
Simon Tatham [Thu, 28 Nov 2019 15:31:41 +0000 (15:31 +0000)]
[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
Miloš Stojanović [Thu, 28 Nov 2019 15:18:28 +0000 (16:18 +0100)]
[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
Raphael Isemann [Thu, 28 Nov 2019 14:43:26 +0000 (15:43 +0100)]
[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.
Raphael Isemann [Thu, 28 Nov 2019 14:29:09 +0000 (15:29 +0100)]
[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.
Raphael Isemann [Thu, 28 Nov 2019 14:14:24 +0000 (15:14 +0100)]
[lldb][NFC] Simplify CompilerDecl and CompilerDeclContext initialization
Raphael Isemann [Thu, 28 Nov 2019 14:05:10 +0000 (15:05 +0100)]
[lldb][NFC] Remove unused CompilerDecl::IsClang
Pavel Labath [Thu, 28 Nov 2019 12:48:05 +0000 (13:48 +0100)]
[lldb] refactor FileSpec::Equal
The logic of this function was quite hard to follow. Replace it with a
much simpler, equivalent, implementation.
Pavel Labath [Thu, 28 Nov 2019 12:47:58 +0000 (13:47 +0100)]
[lldb] Add FileSpec::Equal unit tests
this is in preparation of a refactor of this method.
Pavel Labath [Thu, 28 Nov 2019 12:30:39 +0000 (13:30 +0100)]
[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
Raphael Isemann [Thu, 28 Nov 2019 13:25:46 +0000 (14:25 +0100)]
Revert "[lldb] NFC: refactor CompileUnit::ResolveSymbolContext"
This reverts commit
373e2a4f69d623e59329ff801f261d8b299e12d2.
This broke breakpoint setting.
Benjamin Kramer [Thu, 28 Nov 2019 13:21:33 +0000 (14:21 +0100)]
[include-fixer] Python 3 support for clang-include-fixer.py
Patch by Yannick Brehon!
Raphael Isemann [Thu, 28 Nov 2019 13:07:44 +0000 (14:07 +0100)]
[lldb][NFC] Remove unused STLUtil include and STLUtil.h header
Raphael Isemann [Thu, 28 Nov 2019 12:41:18 +0000 (13:41 +0100)]
[lldb][NFC] Use llvm::StringRef instead of C-strings as multimap key
Konrad Kleine [Wed, 27 Nov 2019 09:57:06 +0000 (10:57 +0100)]
[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
Haojian Wu [Thu, 28 Nov 2019 11:47:32 +0000 (12:47 +0100)]
[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
Raphael Isemann [Thu, 28 Nov 2019 12:27:25 +0000 (13:27 +0100)]
[lldb][NFC] Remove unused CStringToDIEMap typedef
Haojian Wu [Thu, 28 Nov 2019 10:24:04 +0000 (11:24 +0100)]
[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
Haojian Wu [Thu, 28 Nov 2019 10:39:48 +0000 (11:39 +0100)]
[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
Raphael Isemann [Thu, 28 Nov 2019 11:45:47 +0000 (12:45 +0100)]
[lldb][NFC] Remove forward declaration of PrivateAutoCompleteMembers
That's declared directly above the actual definition, so it serves no use.
Raphael Isemann [Thu, 28 Nov 2019 11:24:08 +0000 (12:24 +0100)]
[lldb][NFC] Make GetAsCXXRecordDecl static
All other casting functions there are static, so this should
be too.
Martin Storsjö [Thu, 28 Nov 2019 11:18:15 +0000 (13:18 +0200)]
[LLDB] [test] Add a missing "REQUIRES: arm" line
David Stuttard [Thu, 21 Nov 2019 11:31:41 +0000 (11:31 +0000)]
AMDGPU: Fix lit test checks with dag option
Summary:
I was seeing some failures on a test with slightly different instruction
ordering. Adding in some DAG directives solved the issue.
Change-Id: If5a3d3969055fb19279943bd45161bb70a3dabce
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70531
Raphael Isemann [Thu, 28 Nov 2019 09:33:36 +0000 (10:33 +0100)]
[lldb][NFC] Split up DWARFASTParserClang::CompleteTypeFromDWARF
Moving the different parts into their own functions without any additional
cleanup/refactoring, so this is NFC.
Georgii Rymar [Wed, 27 Nov 2019 10:45:04 +0000 (13:45 +0300)]
[llvm-readelf] - Make GNU style dumping of invalid SHT_GNU_verdef be consistent with LLVM style.
When we dump SHT_GNU_verdef section that has sh_link that references a non-existent section,
llvm-readobj reports a warning and continues dump, but llvm-readelf fails with a error.
This patch fixes the issue and opens road for futher follow-ups for
improving the printGNUVersionSectionProlog().
Differential revision: https://reviews.llvm.org/D70776
Martin Storsjö [Tue, 15 Oct 2019 21:05:06 +0000 (00:05 +0300)]
[LLDB] Always interpret arm instructions as thumb on windows
Windows on ARM always uses thumb mode, and doesn't have most of the
mechanisms that are used in e.g. ELF for distinguishing between arm
and thumb.
Differential Revision: https://reviews.llvm.org/D70796
Martin Storsjö [Tue, 15 Oct 2019 21:01:15 +0000 (00:01 +0300)]
[LLDB] [PECOFF] Look for the truncated ".eh_fram" section name
COFF section names can either be stored truncated to 8 chars, in the
section header, or as a longer section name, stored separately in the
string table.
libunwind locates the .eh_frame section by runtime introspection,
which only works for section names stored in the section header (as
the string table isn't mapped at runtime). To support this behaviour,
lld always truncates the section names for sections that will be
mapped, like .eh_frame.
Differential Revision: https://reviews.llvm.org/D70745
Martin Storsjö [Wed, 27 Nov 2019 12:08:01 +0000 (14:08 +0200)]
[LLDB] [PECOFF] Factorize mapping section names to types using StringSwitch. NFCI.
Keep the existing special cases based on combinations of section name,
flags and sizes/offsets.
Differential Revision: https://reviews.llvm.org/D70778
Raphael Isemann [Thu, 28 Nov 2019 09:21:47 +0000 (10:21 +0100)]
[lldb] Remove debugging code used for LLDB_DWARF_DONT_COMPLETE_TYPENAMES
Reviewers: labath, clayborg, shafik
Reviewed By: labath
Subscribers: JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70802
Georgii Rymar [Wed, 27 Nov 2019 15:26:54 +0000 (18:26 +0300)]
[llvm-readelf][llvm-readobj][test] - Cleanup test cases for versioning sections.
Currently we have 2 tests for testing versioning sections:
1) elf-versioninfo.test
2) elf-invalid-versioning.test
The first one currently checks how versioning sections are dumped +
how tools dump invalid SHT_GNU_verdef section.
The second despite of its name contains only tests for invalid SHT_GNU_verneed section.
In this patch I`ve renamed elf-invalid-versioning.test->elf-verneed-invalid.test,
and moved a few tests from elf-versioninfo.test to a new elf-verdef-invalid.test.
It will help to maintain these and a new tests for broken versioning sections.
Differential revision:
Wang, Pengfei [Thu, 28 Nov 2019 06:45:39 +0000 (14:45 +0800)]
[X86][NFC] Rename test file for following changes.
Lang Hames [Thu, 28 Nov 2019 06:25:59 +0000 (22:25 -0800)]
[JITLink] Make sure MachO/x86-64 handles 32-bit signed addends correctly.
These need to be sign extended when loading into Edge addends.
Ehud Katz [Thu, 28 Nov 2019 06:27:50 +0000 (08:27 +0200)]
[InlineCost] Fix infinite loop in indirect call evaluation
Currently every time we encounter an indirect call of a known function,
we try to evaluate the inline cost of that function. In case of a
recursion, that evaluation never stops.
The solution I propose is to evaluate only the indirect call of the
function, while any further indirect calls (of a known function) will be
treated just as direct function calls, which, actually, never tries to
evaluate the call.
Fixes PR35469.
Differential Revision: https://reviews.llvm.org/D69349
Craig Topper [Thu, 28 Nov 2019 06:03:40 +0000 (22:03 -0800)]
[LegalizeTypes] Remove dead code related to softening f16 which we no longer do.
f16 is promoted to f32 if it is not legal on the target.
Found while reviewing what else needed to be done for strict FP in
the softening code.
Craig Topper [Thu, 28 Nov 2019 05:15:36 +0000 (21:15 -0800)]
[LegalTypes][X86] Add SoftenFloatOperand support for STRICT_FP_TO_SINT/STRICT_FP_TO_UINT.
Rui Ueyama [Thu, 28 Nov 2019 04:50:35 +0000 (13:50 +0900)]
Use InitLLVM in clang-tidy
Update clang-tidy to use InitLLVM, like several other llvm tools that
were previously updated. On Windows, this allows clang-tidy to operate
on arguments containing characters which cannot be represented in the
system's ANSI code page such as filenames with Unicode characters.
Fixes bugzilla bug 43751.
Patch by Tristan Labelle.
Differential Revision: https://reviews.llvm.org/D70694
Craig Topper [Thu, 28 Nov 2019 01:44:43 +0000 (17:44 -0800)]
[LegalizeTypes][X86] Add ExpandIntegerResult support for STRICT_FP_TO_SINT/STRICT_FP_TO_UINT.
Craig Topper [Thu, 28 Nov 2019 01:25:26 +0000 (17:25 -0800)]
[X86] Add support for STRICT_FP_TO_UINT/SINT from fp128.
Nico Weber [Thu, 28 Nov 2019 02:12:46 +0000 (21:12 -0500)]
Revert "Revert "gn build: (manually) try to merge
1689ad27af""
This reverts commit
88276ddbfea753ac13da5a64c2020b7b0a06617f.
The original change relanded.
Richard Smith [Thu, 28 Nov 2019 01:54:26 +0000 (17:54 -0800)]
Properly disambiguate between array declarators and array subscript expressions.
Yi Kong [Thu, 21 Nov 2019 22:14:33 +0000 (14:14 -0800)]
Revert "Revert
1689ad27af5 "[builtins] Implement rounding mode support for i386/x86_64""
Don't build specilised fp_mode.c on MSVC since it does not support
inline ASM on x86_64.
This reverts commit
a19f0eec94e195cac676d0d473882b48f4fded90.
Johannes Altmanninger [Fri, 15 Nov 2019 01:12:58 +0000 (02:12 +0100)]
[CodeGen] Fix clang crash on aggregate initialization of array of labels
Summary: Fix PR43700
The ConstantEmitter in AggExprEmitter::EmitArrayInit was initialized
with the CodeGenFunction set to null, which caused the crash.
Also simplify another call, and make the CGF member a const pointer
since it is public but only assigned in the constructor.
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70302
Dávid Bolvanský [Wed, 27 Nov 2019 23:49:26 +0000 (00:49 +0100)]
[ADT] Fixed -Wdeprecated-copy warning. NFCI
Craig Topper [Wed, 27 Nov 2019 23:11:43 +0000 (15:11 -0800)]
[X86] Add SSEPackedSingle/Double execution domain to COMI/UCOMI SSE/AVX instructions.
David Tenty [Wed, 27 Nov 2019 22:17:02 +0000 (17:17 -0500)]
[AIX] Emit TOC entries for ASM printing
Summary:
Emit the correct .toc psuedo op when we change to the TOC and emit
TC entries. Make sure TOC psuedos get the right symbols via overriding
getMCSymbolForTOCPseudoMO on AIX. Add a test for TOC assembly writing
and update tests to include TOC entries.
Also make sure external globals have a csect set and handle external function descriptor (originally authored by Jason Liu) so we can emit TOC entries for them.
Reviewers: DiggerLin, sfertile, Xiangling_L, jasonliu, hubert.reinterpretcast
Reviewed By: jasonliu
Subscribers: arphaman, wuzish, nemanjai, hiraditya, kbarton, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70461
Dávid Bolvanský [Wed, 27 Nov 2019 21:44:43 +0000 (22:44 +0100)]
Revert "[Attributor] Move pass after InstCombine to futher eliminate null pointer checks"
This reverts commit
7ca7d62c6ea1680ec0a1861083669596547fdd6f. Commited accidentally.
Stefan Pintilie [Wed, 27 Nov 2019 21:38:05 +0000 (15:38 -0600)]
[PowerPC] Separate Features that are known to be Power9 specific from Future CPU
The Power 9 CPU has some features that are unlikely to be passed on to future
versions of the CPU. This patch separates this out so that future CPU does not
inherit them.
Differential Revision: https://reviews.llvm.org/D70466
Dávid Bolvanský [Wed, 27 Nov 2019 21:36:29 +0000 (22:36 +0100)]
Try to reenable -Wdeprecated-copy under -Wextra
Dávid Bolvanský [Tue, 26 Nov 2019 19:50:56 +0000 (20:50 +0100)]
[Attributor] Move pass after InstCombine to futher eliminate null pointer checks
Summary: PR44149
Reviewers: jdoerfert
Subscribers: mehdi_amini, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70737
Saleem Abdulrasool [Wed, 27 Nov 2019 20:55:46 +0000 (12:55 -0800)]
build: avoid cached literals being linked against
If the value of the LibXml2 search is cached, it can cause an errant
link against LIBXML2_LIBRARIES-NOTFOUND if libxml2 is not found. Add
a guard against this. Should repair the build bots.
Saleem Abdulrasool [Wed, 27 Nov 2019 20:34:36 +0000 (12:34 -0800)]
build: avoid hardcoding the libxml2 library name
FindLibXml2 will set the LIBXML2_LIBRARIES variable to the libraries that
we must link against. This will be an empty string if libxml2 is not
found. Avoid hardcoding the library name as xml2 in the configuration.
Simplify the usage in the WindowsManifest library.
Stefan Pintilie [Wed, 27 Nov 2019 18:50:23 +0000 (12:50 -0600)]
[PowerPC] Add new Future CPU for PowerPC in LLVM
This is a continuation of D70262
The previous patch as listed above added the future CPU in clang. This patch
adds the future CPU in the PowerPC backend. At this point the patch simply
assumes that a future CPU will have the same characteristics as pwr9. Those
characteristics may change with later patches.
Differential Revision: https://reviews.llvm.org/D70333
Nandor Licker [Mon, 11 Nov 2019 11:13:34 +0000 (11:13 +0000)]
[ConstExprPreter] Removed the flag forcing the use of the interpreter
Summary:
Removed the ```-fforce-experimental-new-constant-interpreter flag```, leaving
only the ```-fexperimental-new-constant-interpreter``` one. The interpreter
now always emits an error on an unsupported feature.
Allowing the interpreter to bail out would require a mapping from APValue to
interpreter memory, which will not be necessary in the final version. It is
more sensible to always emit an error if the interpreter fails.
Reviewers: jfb, Bigcheese, rsmith, dexonsmith
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70071
Craig Topper [Wed, 27 Nov 2019 19:11:41 +0000 (11:11 -0800)]
[CriticalAntiDepBreaker] Teach the regmask clobber check to check if any subregister is preserved before considering the super register clobbered
X86 has some calling conventions where bits 127:0 of a vector register are callee saved, but the upper bits aren't. Previously we could detect that the full ymm register was clobbered when the xmm portion was really preserved. This patch checks the subregisters to make sure they aren't preserved.
Fixes PR44140
Differential Revision: https://reviews.llvm.org/D70699
taewookoh [Wed, 27 Nov 2019 19:17:10 +0000 (11:17 -0800)]
Revert
b19ec1eb3d0c
Summary: This reverts commit
b19ec1eb3d0c as it fails powerpc tests
Subscribers: llvm-commits
Sanjay Patel [Wed, 27 Nov 2019 18:33:11 +0000 (13:33 -0500)]
[x86] make SLM extract vector element more expensive than default
I'm not sure what the effect of this change will be on all of the affected
tests or a larger benchmark, but it fixes the horizontal add/sub problems
noted here:
https://reviews.llvm.org/D59710?vs=227972&id=228095&whitespace=ignore-most#toc
The costs are based on reciprocal throughput numbers in Agner's tables for
PEXTR*; these appear to be very slow ops on Silvermont.
This is a small step towards the larger motivation discussed in PR43605:
https://bugs.llvm.org/show_bug.cgi?id=43605
Also, it seems likely that insert/extract is the source of perf regressions on
other CPUs (up to 30%) that were cited as part of the reason to revert D59710,
so maybe we'll extend the table-based approach to other subtargets.
Differential Revision: https://reviews.llvm.org/D70607
Gabor Horvath [Wed, 27 Nov 2019 18:56:36 +0000 (10:56 -0800)]
[clang-tidy] Fix PR35824
Differential Revision: https://reviews.llvm.org/D46027