Commit Graph

313947 Commits

Author SHA1 Message Date
Adrian Prantl 3cc634d093 Fix undefined behavior in DWARFASTParser::ParseChildArrayInfo()
PR40827: https://bugs.llvm.org/show_bug.cgi?id=40827
<rdar://problem/48729057>

llvm-svn: 358137
2019-04-10 21:18:44 +00:00
Erik Pilkington de051dfe02 Fix a test, NFC
This test was duplicated, and the last declaration had some syntax errors since
the invalid attribute caused the @implementation to be skipped by the parser.

llvm-svn: 358136
2019-04-10 21:18:21 +00:00
Jonas Devlieghere 8b3af63b89 [NFC] Remove ASCII lines from comments
A lot of comments in LLDB are surrounded by an ASCII line to delimit the
begging and end of the comment.

Its use is not really consistent across the code base, sometimes the
lines are longer, sometimes they are shorter and sometimes they are
omitted. Furthermore, it looks kind of weird with the 80 column limit,
where the comment actually extends past the line, but not by much.
Furthermore, when /// is used for Doxygen comments, it looks
particularly odd. And when // is used, it incorrectly gives the
impression that it's actually a Doxygen comment.

I assume these lines were added to improve distinguishing between
comments and code. However, given that todays editors and IDEs do a
great job at highlighting comments, I think it's worth to drop this for
the sake of consistency. The alternative is fixing all the
inconsistencies, which would create a lot more churn.

Differential revision: https://reviews.llvm.org/D60508

llvm-svn: 358135
2019-04-10 20:48:55 +00:00
Dmitri Gribenko 66b6bb1766 Check i < FD->getNumParams() before querying
Summary:
As was already stated in a previous comment, the parameter isn't
necessarily referring to one of the DeclContext's parameter. We
should check the index is within the range to avoid out-of-boundary
access.

Reviewers: gribozavr, rsmith, lebedev.ri

Reviewed By: gribozavr, rsmith

Subscribers: lebedev.ri, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D60055

Patch by Violet.

llvm-svn: 358134
2019-04-10 20:25:07 +00:00
Jan Korous 6644d014dd [clang][ASTContext] Try to exit early before loading serialized comments from AST files
Loading external comments is expensive. This change probably doesn't apply to common cases but is almost for free and would save some work in case none of the declaration needs external comments to be loaded.

Differential Revision: https://reviews.llvm.org/D60493

llvm-svn: 358133
2019-04-10 20:23:33 +00:00
John McCall 827aeb461c Add IRGen APIs to fetch ctor/dtor helper functions for non-trivial structs.
Patch by Tony Allevato!

llvm-svn: 358132
2019-04-10 19:57:20 +00:00
Louis Dionne 3dee12e4a5 [pstl] Move to single underscore-capital for macros and include guards
Summary: Per the LLVM convention.

Reviewers: rodgert

Subscribers: jkorous, dexonsmith, jdoerfert, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60521

llvm-svn: 358131
2019-04-10 19:51:40 +00:00
Louis Dionne 0352f201dd [pstl] Fix incorrect forward declaration of __pattern_unique_copy
The forward declaration didn't take an execution policy, but the
definition does.

llvm-svn: 358130
2019-04-10 19:48:18 +00:00
Louis Dionne 6d6fbc86c8 [pstl] Add missing forward declarations for equal
We added the 4-iterator variants of std::equal in r357613, but we
forgot to add the corresponding forward declarations.

llvm-svn: 358129
2019-04-10 19:35:42 +00:00
David Green deb3342018 [ARM] Add an extra test for constant hoist. NFC
llvm-svn: 358128
2019-04-10 19:18:58 +00:00
Saleem Abdulrasool a73936a50f clangd-fuzzer: repair the build
The inclusion of private headers of clangd percolates into the fuzzer.

llvm-svn: 358127
2019-04-10 19:16:14 +00:00
Alexey Bataev 5c4273620d [OPENMP]Improve detection of number of teams, threads in target
regions.

Added more complex analysis for number of teams and number of threads in
the target regions, also merged related common code between CGOpenMPRuntime
and CGOpenMPRuntimeNVPTX classes.

llvm-svn: 358126
2019-04-10 19:11:33 +00:00
John McCall 103556279f Fix for different build configurations.
llvm-svn: 358125
2019-04-10 19:11:32 +00:00
Craig Topper cacb70c94b [X86] Add test case for LEA formation regression seen with D60358. NFC
If we have an (add X, (and (aext (shl Y, C1)), C2)), we can pull the shift through and+aext to fold into an LEA with the.
Assuming C1 is small enough and C2 masks off all of the extend bits.

This pattern showed up in D60358. And we need to handle it to prevent a regression.

llvm-svn: 358124
2019-04-10 19:09:06 +00:00
Craig Topper 87a8f9761e [X86] Replace some if statements in isel address matching that should never be true with asserts. And move them earlier before we looked through operands that don't change size. NFC
These ifs were ensuring we don't have to handle types larger than 64 bits probably because we use getZExtValue in several places below them.

None of the callers of this code pass types larger than 64-bits so we can just assert instead of branching in release code.

I've also moved them earlier since we're just looking through operations that don't effect bit width.

This is prep work for some refactoring I plan to do to the (and (shl)) handling code.

llvm-svn: 358123
2019-04-10 19:08:59 +00:00
Nick Desaulniers ad8f3a1440 [X86AsmPrinter] refactor to limit use of Modifier. NFC
Summary:
The Modifier memory operands is used in 2 cases of memory references
(H & P ExtraCodes). Rather than pass around the likely nullptr Modifier,
refactor the handling of the Modifier out from printOperand().

The refactorings in this patch:
- Don't forward declare printOperand, move its definition up.
  - The diff makes it look like there's a change to printPCRelImm
    (narrator: there's not).
- Create printModifiedOperand()
  - Move logic for Modifier to there from printOperand
  - Use printModifiedOperand in 3 call sites that actually create
    Modifiers.
- Remove now unused Modifier parameter from printOperand
- Remove default parameter from printLeaMemReference as it only has 1
  call site that explicitly passes a parameter.
- Remove default parameter from printMemReference, make call lone call
  site explicitly pass nullptr.
- Drop Modifier parameter from printIntelMemReference, as Intel style
  memory references don't support the Modifiers in question.

This will allow future changes to printOperand() to make it a pure virtual
method on the base AsmPrinter class, allowing for more generic handling
of some architecture generic constraints. X86AsmPrinter was the only
derived class of AsmPrinter to have additional parameters on its
printOperand function.

Reviewers: craig.topper, echristo

Reviewed By: echristo

Subscribers: hiraditya, llvm-commits, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60526

llvm-svn: 358122
2019-04-10 19:01:44 +00:00
Louis Dionne e3e24ad25f Fix header inclusion order failures
Summary: See https://bugs.llvm.org/show_bug.cgi?id=41432

Subscribers: libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60525

llvm-svn: 358121
2019-04-10 18:52:24 +00:00
Ali Tamur 59a0e04701 [llvm] Non-functional change: declared a local variable as const.
llvm-svn: 358120
2019-04-10 18:30:03 +00:00
Zachary Turner 5a736c9bbf [PDB Docs] Start documenting CodeView Type Records.
This puts the general layout of the document in place and fully
describes 1 simple type record.  Followups will fill out more
pieces.

llvm-svn: 358119
2019-04-10 18:26:51 +00:00
Roman Lebedev dc67659ba5 [X86] X86ScheduleBdVer2: use !listsplat operator to cleanup loadres calculation
The problem is that one can't concatenate an empty list
(implied all-ones) with non-empty list here. The result
will be the non-empty list, and it won't match the length
of the ExePorts list.

The problems begin when LoadRes != 1 here,
which is the case in PdWriteResYMMPair,
and more importantly i think it will be the case for PdWriteResExPair.

llvm-svn: 358118
2019-04-10 18:26:42 +00:00
Roman Lebedev 5d9f656bb7 [TableGen] Introduce !listsplat 'binary' operator
Summary:
```
``!listsplat(a, size)``
    A list value that contains the value ``a`` ``size`` times.
    Example: ``!listsplat(0, 2)`` results in ``[0, 0]``.
```

I plan to use this in X86ScheduleBdVer2.td for LoadRes handling.

This is a little bit controversial because unlike every other binary operator
the types aren't identical.

Reviewers: stoklund, javed.absar, nhaehnle, craig.topper

Reviewed By: javed.absar

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60367

llvm-svn: 358117
2019-04-10 18:26:36 +00:00
Roman Lebedev 163157378e [kate] Add '!mul' operator that was introduced in D58775
llvm-svn: 358116
2019-04-10 18:26:23 +00:00
John McCall 7ae29f5742 Fix an off-by-one mistake in IRGen's copy-construction
special cases in the presence of zero-length arrays.

Patch by Joran Bigalet!

llvm-svn: 358115
2019-04-10 18:07:18 +00:00
David Green 4e3fd7757a [ARM] Add an extra constant hoisting test. NFC
This adds a simple extra test for constant hoisting to show it's
usefulness with constant addresses like those seen in memory
mapped registers in embedded systems.

llvm-svn: 358114
2019-04-10 18:05:57 +00:00
David Green 0861c87b06 Revert rL357745: [SelectionDAG] Compute known bits of CopyFromReg
Certain optimisations from ConstantHoisting and CGP rely on Selection DAG not
seeing through to the constant in other blocks. Revert this patch while we come
up with a better way to handle that.

I will try to follow this up with some better tests.

llvm-svn: 358113
2019-04-10 18:00:41 +00:00
Nico Weber 5f6eb1817a llvm-undname: Fix another crash-on-invalid
This fixes a regression from https://reviews.llvm.org/D60354. We used to

  SymbolNode *Symbol = demangleEncodedSymbol(MangledName, QN);
  if (Symbol) {
    Symbol->Name = QN;
  }

but changed that to
  SymbolNode *Symbol = demangleEncodedSymbol(MangledName, QN);
  if (Error)
    return nullptr;
  Symbol->Name = QN;

and one branch somewhere returned a nullptr without setting Error.

Looking at the code changed in r340083 and r340710 that branch looks
like a remnant from an earlier attempt to demangle RTTI descriptors
that has since been rewritten -- so just remove this branch. It
shouldn't change behavior for correctly mangled symbols.

llvm-svn: 358112
2019-04-10 17:31:34 +00:00
Matt Arsenault 2064e45ce3 GlobalISel: Move computeValueLLTs
Call lowering should use this directly instead of going through the
EVT version, but more work is needed to deal with this (mostly the
passing of the IR type pointer instead of the relevant properties in
ArgInfo).

llvm-svn: 358111
2019-04-10 17:27:56 +00:00
Matt Arsenault 0aab99902b GlobalISel: Fix invoke lowering creating invalid type registers
Unlike the call handling, this wasn't checking for void results and
creating a register with the invalid LLT

llvm-svn: 358110
2019-04-10 17:27:55 +00:00
Matt Arsenault 7187272b2b GlobalISel: Support legalizing G_CONSTANT with irregular breakdown
llvm-svn: 358109
2019-04-10 17:27:53 +00:00
Craig Topper 35fe07916a [AArch64] Teach getTestBitOperand to look through ANY_EXTENDS
This patch teach getTestBitOperand to look through ANY_EXTENDs when the extended bits aren't used. The test case changed here is based what D60358 did to test16 in tbz-tbnz.ll. So this patch will avoid that regression.

Differential Revision: https://reviews.llvm.org/D60482

llvm-svn: 358108
2019-04-10 17:27:29 +00:00
Saleem Abdulrasool 6e84a09ee9 build: add binary dir to the unittests
Missed part of the change to make clangd build on Darwin.  Fixes the build after
SVN r358103.

llvm-svn: 358107
2019-04-10 17:25:14 +00:00
Louis Dionne fa4b0b08ea [libc++abi] Create a macro for the 32 bit guard setting on ARM platforms
Summary:
The goal is to use a descriptive name for this feature, instead of just
using __arm__.

Reviewers: EricWF

Subscribers: javed.absar, kristof.beyls, christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60520

llvm-svn: 358106
2019-04-10 17:12:06 +00:00
Matt Arsenault 9e0eeba569 GlobalISel: Handle odd breakdowns for bit ops
llvm-svn: 358105
2019-04-10 17:07:56 +00:00
John McCall 8b36ac818c Don't emit an unreachable return block.
Patch by Brad Moody.

llvm-svn: 358104
2019-04-10 17:03:09 +00:00
Saleem Abdulrasool e1b9b9dc15 clangd: fix the build with XPC
`Transport.h` does not include `Features.inc`.  However, since it is used in a
subdirectory, it cannot directly include the header as it is not available.
Include `Features.inc` in `ClangdLSPServer.h` prior to the inclusion of
`Transport.h` which will provide the interfaces in `ClangdMain.cpp` where the
symbol `newXPCTransport` will not be defined due to it being preprocessed away
since the configuration is not passed along to the initial inclusion.

llvm-svn: 358103
2019-04-10 16:48:52 +00:00
Nick Desaulniers b9a00cb504 add FIXME: as per echristo
llvm-svn: 358102
2019-04-10 16:38:44 +00:00
Nick Desaulniers 5277b3ff25 [AsmPrinter] refactor to remove remove AsmVariant. NFC
Summary:
The InlineAsm::AsmDialect is only required for X86; no architecture
makes use of it and as such it gets passed around between arch-specific
and general code while being unused for all architectures but X86.

Since the AsmDialect is queried from a MachineInstr, which we also pass
around, remove the additional AsmDialect parameter and query for it deep
in the X86AsmPrinter only when needed/as late as possible.

This refactor should help later planned refactors to AsmPrinter, as this
difference in the X86AsmPrinter makes it harder to make AsmPrinter more
generic.

Reviewers: craig.topper

Subscribers: jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, sbc100, jgravelle-google, eraman, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, llvm-commits, peter.smith, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60488

llvm-svn: 358101
2019-04-10 16:38:43 +00:00
Nikita Popov 0a8228fd28 [InstCombine] Handle ssubo always overflow
Following D60483 and D60497, this adds support for AlwaysOverflows
handling for ssubo. This is the last case we can handle right now.

Differential Revision: https://reviews.llvm.org/D60518

llvm-svn: 358100
2019-04-10 16:32:15 +00:00
Nikita Popov 7a543c3758 [InstCombine] ssubo X, C -> saddo X, -C
ssubo X, C is equivalent to saddo X, -C. Make the transformation in
InstCombine and allow the logic implemented for saddo to fold prior
usages of add nsw or sub nsw with constants.

Patch by Dan Robertson.

Differential Revision: https://reviews.llvm.org/D60061

llvm-svn: 358099
2019-04-10 16:27:36 +00:00
Sam McCall 2d02c6df6b [clangd] Fix non-indexing of builtin functions like printf when the TU is C
llvm-svn: 358098
2019-04-10 16:26:58 +00:00
Sander de Smalen 0e66db5d77 Improve compile-time performance in computeKnownBitsFromAssume.
This patch changes the order of pattern matching by first testing
a compare instruction's predicate, before doing the pattern
match for the whole expression tree.

Patch by Paul Walker.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D60504

llvm-svn: 358097
2019-04-10 16:24:48 +00:00
Simon Pilgrim 37d8d55823 [X86][AVX] getTargetConstantBitsFromNode - extract bits from X86ISD::SUBV_BROADCAST
llvm-svn: 358096
2019-04-10 16:24:47 +00:00
Nikita Popov ef23e88480 [InstCombine] Handle saddo always overflow
Followup to D60483: Handle AlwaysOverflow conditions for saddo as
well.

Differential Revision: https://reviews.llvm.org/D60497

llvm-svn: 358095
2019-04-10 16:18:01 +00:00
Fangrui Song 9ff3afbea7 [clangd] Use #if CLANGD_BUILD_XPC because it may be defined as 0
llvm-svn: 358094
2019-04-10 15:45:54 +00:00
Saleem Abdulrasool aef7247adb clangd: repair the build after SVN r358091
Fix the name of the variable being checked.  NFCI.

llvm-svn: 358093
2019-04-10 15:45:05 +00:00
Alexander Kornienko 8eae988b89 Fix a typo
llvm-svn: 358092
2019-04-10 15:42:53 +00:00
Sam McCall b814e57ffb [clangd] Don't insert extra namespace qualifiers when Sema gets lost.
Summary:
There are cases where Sema can't tell that "foo" in foo::Bar is a
namespace qualifier, like in incomplete macro expansions.

After this patch, if sema reports no specifier but it looks like there's one in
the source code, then we take it into account.

Reworked structure and comments in getQueryScopes to try to fight
creeping complexity - unsure if I succeeded.

I made the test harder (the original version also passes).

Reviewers: ioeric

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D60503

llvm-svn: 358091
2019-04-10 15:16:54 +00:00
Sam Clegg 0d9f609d82 [WebAssembly] Assign GOT entries symbols used in data relocations
Differential Revision: https://reviews.llvm.org/D60492

llvm-svn: 358090
2019-04-10 15:06:17 +00:00
Fangrui Song ae6c9403d1 [MachineOutliner] Replace ostringstream based string concatenation with Twine
This makes my libLLVMCodeGen.so.9svn 4936 bytes smaller.

While here, delete unused #include <map>

llvm-svn: 358089
2019-04-10 14:52:37 +00:00
Jonas Devlieghere 6a7412a893 [testsuite] Split Obj-C foundation test
TestObjCMethods2.py was the third-longest running test on Darwin. By
splitting it up, lit can exploit parallelism to reduce the total wall
clock time.

llvm-svn: 358088
2019-04-10 14:30:00 +00:00