Commit Graph

257110 Commits

Author SHA1 Message Date
Adrian Prantl 140a8569ce API gardening: Rename FindAllocaDbgValue to findDbgValue (NFC)
and use have it use SmallVectorImpl.

There is nothing specific about allocas in this function.

llvm-svn: 297643
2017-03-13 17:20:47 +00:00
Craig Topper df5beb2d6f [X86] Add checking of the scale argument to scatter/gather builtins
The only valid values for scale immediate of scatter/gather builtins are 1, 2, 4, or 8. This patch enforces this in the frontend otherwise we generate invalid instruction encodings in the backend.

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

llvm-svn: 297642
2017-03-13 17:16:50 +00:00
Zachary Turner 326b4fe7f7 Use numeric_limits<size_t>::max() instead of size_t(-1).
llvm-svn: 297641
2017-03-13 17:12:37 +00:00
Zachary Turner 4eb8449d6c Fix up some enumerate() callsites in LLDB.
llvm-svn: 297640
2017-03-13 17:12:12 +00:00
Zachary Turner e677a92241 Fix a warning due to signed/unsigned comparison.
llvm-svn: 297639
2017-03-13 16:41:49 +00:00
Peter Collingbourne f8435a9bda ELF: Resolve _end symbols correctly.
Fix a bug introduced in r297313 which caused them to resolve to the end
of the ELF header in PIEs and DSOs.

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

llvm-svn: 297638
2017-03-13 16:40:20 +00:00
Zachary Turner db6310c632 Fix another occurrence of needing to use member accessors.
llvm-svn: 297637
2017-03-13 16:39:00 +00:00
Zachary Turner 368c3fa657 Use the new member accessors of llvm::enumerate.
The value_type is no longer a struct, it's a class whose
members you have to access via a method.

llvm-svn: 297635
2017-03-13 16:32:08 +00:00
Zachary Turner 309a0889a4 [ADT] Improve the genericity of llvm::enumerate().
There were some issues in the implementation of enumerate()
preventing it from being used in various contexts.  These were
all related to the fact that it did not supporter llvm's
iterator_facade_base class.  So this patch adds support for that
and additionally exposes a new helper method to_vector() that
will evaluate an entire range and store the results in a
vector.

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

llvm-svn: 297633
2017-03-13 16:24:10 +00:00
Zachary Turner 37b91512d3 Remove an unused variable.
llvm-svn: 297632
2017-03-13 16:18:08 +00:00
Sam McCall 9c5ebf7039 [include-fixer] Add fuzzy SymbolIndex, where identifier needn't match exactly.
Summary:
Add fuzzy SymbolIndex, where identifier needn't match exactly.

The purpose for this is global autocomplete in clangd. The query will be a
partial identifier up to the cursor, and the results will be suggestions.

It's in include-fixer because:

  - it handles SymbolInfos, actually SymbolIndex is exactly the right interface
  - it's a good harness for lit testing the fuzzy YAML index
  - (Laziness: we can't unit test clangd until reorganizing with a tool/ dir)

Other questionable choices:

  - FuzzySymbolIndex, which just refines the contract of SymbolIndex. This is
    an interface to allow extension to large monorepos (*cough*)
  - an always-true safety check that Identifier == Name is removed from
    SymbolIndexManager, as it's not true for fuzzy matching
  - exposing -db=fuzzyYaml from include-fixer is not a very useful feature, and
    a non-orthogonal ui (fuzziness vs data source). -db=fixed is similar though.

Reviewers: bkramer

Subscribers: cfe-commits, mgorny

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

llvm-svn: 297630
2017-03-13 15:55:59 +00:00
Sanjay Patel 6023a2501c [CGP] add tests for PR31028; NFC
llvm-svn: 297629
2017-03-13 15:45:37 +00:00
Alex Lorenz 6bf4a58b51 [CodeCompletion] Format block parameter placeholders in implicit property
setters using the block type information that's obtained from the property

rdar://12604235

llvm-svn: 297628
2017-03-13 15:43:42 +00:00
Gabor Horvath 27f5ff66cc [ASTImporter] Import fix of GCCAsmStmts w/ missing symbolic operands
Patch by Zoltan Gera!

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

llvm-svn: 297627
2017-03-13 15:32:24 +00:00
Jonathan Roelofs 083b727da9 Delete dead code. NFC
Also has the side-effect of fixing the build on systems with glibc < 2.12

https://reviews.llvm.org/D30844

llvm-svn: 297626
2017-03-13 15:25:01 +00:00
Zachary Turner 407dec59a4 [llvm-pdbdump] Add support for dumping symbols from Yaml -> PDB.
Previously we could round-trip type records from PDB -> Yaml ->
PDB, but for symbols we could only go from PDB -> Yaml.  This
completes the round-tripping for symbols as well.

llvm-svn: 297625
2017-03-13 14:57:45 +00:00
Rafael Espindola 82d55239ea Fix crash when multiple raw_fd_ostreams to stdout are created.
If raw_fd_ostream is constructed with the path of "-", it claims
ownership of the stdout file descriptor. This means that it closes
stdout when it is destroyed. If there are multiple users of
raw_fd_ostream wrapped around stdout, then a crash can occur because
of operations on a closed stream.

An example of this would be running something like "clang -S -o - -MD
-MF - test.cpp". Alternatively, using outs() (which creates a local
version of raw_fd_stream to stdout) anywhere combined with such a
stream usage would cause the crash.

The fix duplicates the stdout file descriptor when used within
raw_fd_ostream, so that only that particular descriptor is closed when
the stream is destroyed.

Patch by James Henderson!

llvm-svn: 297624
2017-03-13 14:45:06 +00:00
Sylvestre Ledru 7d21a3d2c3 [clang-format] Add more examples and fix a bug in the py generation script
Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 297623
2017-03-13 14:42:47 +00:00
George Rimar 78aa270041 [ELF] - Remove unnecessary template. NFC.
llvm-svn: 297622
2017-03-13 14:40:58 +00:00
Diana Picus 94db2e288b [ARM] GlobalISel: Support SP in regbankselect
We used to hit an unreachable in getRegBankFromRegClass when dealing with the
stack pointer. This commit adds support for the GPRsp reg class.

llvm-svn: 297621
2017-03-13 14:28:34 +00:00
Roger Ferrer Ibanez 9f96347488 When diagnosing taking address of packed members skip __unaligned-qualified expressions
Given that we have already explicitly stated in the qualifier that the
expression is __unaligned, it makes little sense to diagnose that the address
of the packed member may not be aligned.

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

llvm-svn: 297620
2017-03-13 13:18:21 +00:00
Gabor Horvath 60eec1ac1b [analyzer] Fix a rare crash for valist check.
It looks like on some host-triples the result of a valist related expr can be
a LazyCompoundVal. Handle that case in the check.

Patch by Abramo Bagnara!

llvm-svn: 297619
2017-03-13 12:48:26 +00:00
Aaron Ballman 345012dfa0 Reverting r297617 because it broke some bots:
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/49970

llvm-svn: 297618
2017-03-13 12:24:51 +00:00
Aaron Ballman f5cba91591 Add support for getting file system permissions and implement sys::fs::permissions to set them.
Patch by James Henderson.

llvm-svn: 297617
2017-03-13 12:17:14 +00:00
Pavel Labath 7163ecb429 Android.rules: Add libc++ support
Summary:
This adds support for building libc++ tests when targetting android. The
tests are still not passing due to several other problems, but this way
we can at least build them.

Reviewers: eugene, EricWF, danalbert

Subscribers: srhines, lldb-commits

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

llvm-svn: 297616
2017-03-13 12:07:48 +00:00
Pavel Labath 6a3b059fb7 Fix windows build broken by r297612
I have got my boolean logic incorrect. Sorry about the spam.

llvm-svn: 297615
2017-03-13 11:23:59 +00:00
Alex Lorenz e39fa57d35 Add -iframeworkwithsysroot compiler option
This commit adds support for a new -iframeworkwithsysroot compiler option which
allows the user to specify a framework path that can be prefixed with the
sysroot. This option is similar to the -iwithsysroot option that exists to
supplement -isystem.

rdar://21316352

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

llvm-svn: 297614
2017-03-13 11:17:41 +00:00
Alex Lorenz c630f349b8 [compiler-rt][builtins] Ignore the deprecated warning for
CFPropertyListCreateFromXMLData that's used in __isOSVersionAtLeast

llvm-svn: 297613
2017-03-13 11:00:44 +00:00
Pavel Labath 5b35d1980c Fix android build
getpwent is not available on android until API level 21, and even then
it is only available when doing a non-static link. Since android's
concept of users is very different from linux, it's doubtful the home
directory resolution would be useful, so I approximate this state by
just not using getpwent on android.

We've had another getpwent occurance in FileSpec for a while -- it
wasn't causing problems because it was stripped out by the linker, but I
disable that also, for consistency's sake.

llvm-svn: 297612
2017-03-13 10:59:23 +00:00
Balaram Makam cacc08bb46 [AArch64] Map Sched Read/Write resources for Falkor.
llvm-svn: 297611
2017-03-13 10:42:17 +00:00
Gil Rapaport 00cb43908c [LV] Set memcheck metadata also for VF==1
This commit is a follow-up on r297580. It fixes the FIXME added temporarily
by that commit to keep the removal of Unroller's specialized version of
scalarizeInstruction() an NFC. See https://reviews.llvm.org/D30715 for details.

llvm-svn: 297610
2017-03-13 10:23:46 +00:00
Pavel Labath 9bd69ad9b8 Fix Linux build for the FileSpec changes
Propagate changes that were made during review, and fix a couple of
warnings while I'm in there.

llvm-svn: 297609
2017-03-13 09:46:15 +00:00
Sjoerd Meijer aea3a990a2 ARMDisassembler: loop over ARM decode tables
Loop over the ARM decode tables; this is a clean-up to reduce some code
duplication.

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

llvm-svn: 297608
2017-03-13 09:41:10 +00:00
Martin Probst b4cdb65e5f clang-format: [JS] do not wrap @see tags.
Summary:
@see is special among JSDoc tags in that it is commonly followed by URLs. The JSDoc spec suggests that users should wrap URLs in an additional {@link url...} tag (@see http://usejsdoc.org/tags-see.html), but this is very commonly violated, with @see being followed by a "naked" URL.

This change special cases all JSDoc lines that contain an @see not to be wrapped to account for that.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 297607
2017-03-13 09:39:23 +00:00
Martin Probst 22b8d26924 clang-format: [JS] allow breaking after non-null assertions.
Summary:
Previously clang-format would not break after any !. However in TypeScript, ! can be used as a post fix operator for non-nullability:
    x.foo()!.bar()!;

With this change, clang-format will wrap after the ! if it is likely a post-fix non null operator.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 297606
2017-03-13 09:14:23 +00:00
Martin Probst b98ab89ebb clang-format: [JS] do not wrap after interface and type.
Summary:
`interface` and `type` are pseudo keywords and cause automatic semicolon
insertion when followed by a line break:

    interface  // gets parsed as a long variable access to "interface"
        VeryLongInterfaceName {

    }

With this change, clang-format not longer wraps after `interface` or `type`.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 297605
2017-03-13 07:10:18 +00:00
Konstantin Zhuravlyov 1867a87c3d AMDGPU/RelocVisitor: Handle R_AMDGPU_ABS64
Test is in the separate patch.

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

llvm-svn: 297604
2017-03-13 06:03:11 +00:00
Craig Topper 7746565754 [AVX-512] Add EVEX2VEX test cases for the cvt instructions fixed in r297599 and r297600.
llvm-svn: 297603
2017-03-13 05:47:56 +00:00
Craig Topper bb4089d260 Revert "[AVX-512] EVEX2VEX, don't reject intrinsic instructions when both have a memory operand. We should just continue to check other operands instead."
This reverts r297596.

There were other issues that were making this not work that have been fixed now. Reverting this results in a more accurate table.

llvm-svn: 297602
2017-03-13 05:34:03 +00:00
Craig Topper 48ba1e2d66 [AVX-512] Add VEX_WIG to VEX vcvtsd2ss/vcvtss2sd intrinsic instructions so they can be correctly matched by EVEX2VEX table generation.
llvm-svn: 297601
2017-03-13 05:14:47 +00:00
Craig Topper 08b413acf2 [AVX-512] Use sse_loadf32/f64 for vcvtss2sd and vcvtsd2ss intrinsic patterns.
llvm-svn: 297600
2017-03-13 05:14:44 +00:00
Craig Topper 5a63ca2ad2 [AVX-512] Use sse_load_f64/f32 in VCVTSS2SI/VCVTSD2SI patterns.
llvm-svn: 297599
2017-03-13 03:59:06 +00:00
Zachary Turner 1f8753479e Use LLVM for file / directory enumeration.
FileSpec::EnumerateDirectory has a bunch of platform-specific
gunk in it for posix and non-posix platforms. We can get rid
of all this by using LLVM's easy-to-use directory iterators.

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

llvm-svn: 297598
2017-03-13 02:44:39 +00:00
Zachary Turner 2cc5a18dc2 Resubmit "Make file / directory completion work properly on Windows."
This fixes the compilation failures with the original patch.

llvm-svn: 297597
2017-03-13 00:41:01 +00:00
Craig Topper 166085f0f2 [AVX-512] EVEX2VEX, don't reject intrinsic instructions when both have a memory operand. We should just continue to check other operands instead.
This exposed that we have several intrinsic instructions that have identical TSFlags to other instructions. We should merge their patterns and kill of the duplicate. I'll fix that in a follow up patch.

llvm-svn: 297596
2017-03-13 00:36:49 +00:00
Craig Topper 9fc4135cc2 [X86] Minor formatting tweaks in EVEX to VEX tables. NFC
llvm-svn: 297595
2017-03-13 00:36:46 +00:00
Craig Topper 111b2d6997 [X86] Remove unused SDTypeProfile. NFC
llvm-svn: 297594
2017-03-12 23:05:03 +00:00
Craig Topper 2b92542908 [X86] Lower SSE/AVX cmpps/pd intrinsics directly to X86ISD::CMPP SDNodes.
This allows us to remove a duplicate set of patterns.

llvm-svn: 297593
2017-03-12 23:05:00 +00:00
Aaron Ballman 9d36551d7e Allow the nonnull attribute to be inherited as a parameter in the redefinition of a function. Fixes PR30828.
Patch by Matt Bettinson.

llvm-svn: 297592
2017-03-12 22:30:07 +00:00
Craig Topper 7d56c8315b [AVX-512] Fix the valid immediates for the scatter/gather prefetch intrinsics.
The immediate should be 1 or 2, not 0 or 1. This was found while adding bounds checking to clang. In fact the existing clang builtin test failed if we ran it all the way to assembly.

llvm-svn: 297591
2017-03-12 22:29:12 +00:00