platform/upstream/llvm.git
7 years ago[modules] Properly look up the owning module for an instantiation of a merged template.
Richard Smith [Wed, 19 Apr 2017 01:36:43 +0000 (01:36 +0000)]
[modules] Properly look up the owning module for an instantiation of a merged template.

When looking for the template instantiation pattern of a templated entity,
consistently select the definition of the pattern if there is one. This means
we'll pick the same owning module when we start instantiating a template that
we'll later pick when determining which modules are visible during that
instantiation.

llvm-svn: 300650

7 years agoCleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <exception>
Eric Fiselier [Wed, 19 Apr 2017 01:35:58 +0000 (01:35 +0000)]
Cleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <exception>

llvm-svn: 300649

7 years agoCleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <bitset>, <ios>, <locale>, and...
Eric Fiselier [Wed, 19 Apr 2017 01:34:08 +0000 (01:34 +0000)]
Cleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <bitset>, <ios>, <locale>, and <iterator>

llvm-svn: 300648

7 years agoOne more attempt and Windows
Chris Bieneman [Wed, 19 Apr 2017 01:32:08 +0000 (01:32 +0000)]
One more attempt and Windows

This is the last Windows compile error, so... Hit me with your best shot.

llvm-svn: 300647

7 years agoCleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in the functional library
Eric Fiselier [Wed, 19 Apr 2017 01:28:47 +0000 (01:28 +0000)]
Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in the functional library

llvm-svn: 300646

7 years agoCleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in tuple and utility
Eric Fiselier [Wed, 19 Apr 2017 01:23:39 +0000 (01:23 +0000)]
Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in tuple and utility

llvm-svn: 300644

7 years agoCleanup remaining _LIBCPP_HAS_NO_<c++11-feature> usages in container headers
Eric Fiselier [Wed, 19 Apr 2017 01:23:04 +0000 (01:23 +0000)]
Cleanup remaining _LIBCPP_HAS_NO_<c++11-feature> usages in container headers

llvm-svn: 300643

7 years ago[libFuzzer] update -help: mention -exact_artifact_path in help for -minimize_crash...
Kostya Serebryany [Wed, 19 Apr 2017 01:22:04 +0000 (01:22 +0000)]
[libFuzzer] update -help: mention -exact_artifact_path in help for -minimize_crash and -cleanse_crash

llvm-svn: 300642

7 years ago[AVR] Migrate to new MCAsmInfo CodePointerSize
Leslie Zhai [Wed, 19 Apr 2017 01:20:43 +0000 (01:20 +0000)]
[AVR] Migrate to new MCAsmInfo CodePointerSize

Reviewers: dylanmckay, rengolin, kzhuravl, jroelofs

Reviewed By: kzhuravl, jroelofs

Subscribers: kzhuravl, llvm-commits

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

llvm-svn: 300641

7 years agoAnother netbsd build failure...
Chris Bieneman [Wed, 19 Apr 2017 01:17:29 +0000 (01:17 +0000)]
Another netbsd build failure...

llvm-svn: 300640

7 years agoARMFrameLowering: Reserve emergency spill slot for large arguments
Matthias Braun [Wed, 19 Apr 2017 01:16:07 +0000 (01:16 +0000)]
ARMFrameLowering: Reserve emergency spill slot for large arguments

We need to reserve an emergency spill slot in cases with large argument
types that could overflow immediate offsets for FP relative address
calculations.

rdar://31317893

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

llvm-svn: 300639

7 years agoBuildbot wack-a-mole!
Chris Bieneman [Wed, 19 Apr 2017 01:15:17 +0000 (01:15 +0000)]
Buildbot wack-a-mole!

This should fix the netbsd bot I just broke.

llvm-svn: 300638

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in support headers and final tests
Eric Fiselier [Wed, 19 Apr 2017 01:02:49 +0000 (01:02 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in support headers and final tests

llvm-svn: 300637

7 years agoifdefing out the signal handling code on Windows
Chris Bieneman [Wed, 19 Apr 2017 01:00:16 +0000 (01:00 +0000)]
ifdefing out the signal handling code on Windows

*fingers crossed*

This might fix the Window bots, but I really don't know...

llvm-svn: 300636

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in the utilities library
Eric Fiselier [Wed, 19 Apr 2017 00:56:32 +0000 (00:56 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the utilities library

llvm-svn: 300635

7 years ago[DataLayout] Removed default value from a variable that isn't used without being...
Craig Topper [Wed, 19 Apr 2017 00:31:38 +0000 (00:31 +0000)]
[DataLayout] Removed default value from a variable that isn't used without being overwritten. Make variable an enum instead of an int to avoid a cast later. NFC

llvm-svn: 300634

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in the string library.
Eric Fiselier [Wed, 19 Apr 2017 00:28:44 +0000 (00:28 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the string library.

llvm-svn: 300633

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macros in the numeric tests and headers
Eric Fiselier [Wed, 19 Apr 2017 00:23:45 +0000 (00:23 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in the numeric tests and headers

llvm-svn: 300632

7 years ago[XRay][tools] Fix yaml matching to be more permissive
Dean Michael Berris [Wed, 19 Apr 2017 00:10:09 +0000 (00:10 +0000)]
[XRay][tools] Fix yaml matching to be more permissive

Account for a potentially empty function name.

Follow-up to D32153.

llvm-svn: 300631

7 years agoAllow suppressing host and target info in VersionPrinter
Xin Tong [Wed, 19 Apr 2017 00:03:36 +0000 (00:03 +0000)]
Allow suppressing host and target info in VersionPrinter

Summary:
VersionPrinter by default outputs information about the Host CPU
and Default target. Printing this information requires linking in
a large amount of data, such as supported target triples as C
strings, which in turn bloats the binary size.

Enable a new CMake option LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO
which controls printing of the host and target info. This allows
the target triple names to be dead-code stripped. This is a nice
win for LLVM clients that wish to minimize their binary size, such
as graphics drivers.

By default this is ON, so there is no change in the default behavior.
Clients who wish to suppress this printing can do so by setting this
option to off via CMake.

A test app on Linux that uses ParseCommandLineOptions() shows a binary
size reduction of 23KB (from 149K to 126K) for a Release build, and 24KB
(from 135K to 111K) in a MinSizeRel build.

Reviewers: klimek, beanz, bogner, chandlerc, compnerd

Reviewed By: compnerd

Patch by pammon (Peter Ammon) !

Subscribers: llvm-commits

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

llvm-svn: 300630

7 years ago[AVR] Fix the build
Dylan McKay [Tue, 18 Apr 2017 23:53:10 +0000 (23:53 +0000)]
[AVR] Fix the build

'PointerSize' was renamed to 'CodePointerSize'.

llvm-svn: 300629

7 years agoUse less temporary AttributeLists NFC
Reid Kleckner [Tue, 18 Apr 2017 23:50:03 +0000 (23:50 +0000)]
Use less temporary AttributeLists NFC

llvm-svn: 300628

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-features> macro usage in regex
Eric Fiselier [Tue, 18 Apr 2017 23:42:15 +0000 (23:42 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-features> macro usage in regex

llvm-svn: 300627

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library
Eric Fiselier [Tue, 18 Apr 2017 23:38:41 +0000 (23:38 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library

llvm-svn: 300626

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in algorithm
Eric Fiselier [Tue, 18 Apr 2017 23:26:47 +0000 (23:26 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in algorithm

llvm-svn: 300625

7 years ago[XRay][tools] Add option to llvm-xray extract to symbolize functions
Dean Michael Berris [Tue, 18 Apr 2017 23:23:54 +0000 (23:23 +0000)]
[XRay][tools] Add option to llvm-xray extract to symbolize functions

Summary:
This allows us to, if the symbol names are available in the binary, be
able to provide the function name in the YAML output.

Reviewers: dblaikie, pelikan

Subscribers: llvm-commits

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

llvm-svn: 300624

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macros for std::initializer_list
Eric Fiselier [Tue, 18 Apr 2017 23:09:36 +0000 (23:09 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros for std::initializer_list

llvm-svn: 300623

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macros in thread.
Eric Fiselier [Tue, 18 Apr 2017 23:05:08 +0000 (23:05 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in thread.

llvm-svn: 300622

7 years ago[ConstantRange] Optimize APInt creation in getSignedMax/getSignedMin.
Craig Topper [Tue, 18 Apr 2017 23:02:39 +0000 (23:02 +0000)]
[ConstantRange] Optimize APInt creation in getSignedMax/getSignedMin.

We were creating an APInt at the top of these methods that isn't always returned. For ranges wider than 64-bits this results in an allocation and deallocation when its not used.

In getSignedMax we were creating Upper-1 to use in a compare and then creating it again for a return value. The compiler is unable to determine that these can be shared. So help it out and create the Upper-1 in a temporary that can be reused.

This provides a little compile time improvement.

llvm-svn: 300621

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> in std::unordered_map and std::unordered_multimap
Eric Fiselier [Tue, 18 Apr 2017 22:50:56 +0000 (22:50 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in std::unordered_map and std::unordered_multimap

This completes the cleanup of the containers, at least within the tests.

llvm-svn: 300620

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::unordered_set and std::unordere...
Eric Fiselier [Tue, 18 Apr 2017 22:37:32 +0000 (22:37 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::unordered_set and std::unordered_multiset

llvm-svn: 300619

7 years agoDefine HAVE_SIGACTION to 1 in Xcode build
Chris Bieneman [Tue, 18 Apr 2017 22:37:00 +0000 (22:37 +0000)]
Define HAVE_SIGACTION to 1 in Xcode build

This is needed to make the Xcode project build since it doesn't have auto-generated Config header.

llvm-svn: 300618

7 years ago[x86] add tests for potential andn optimization; NFC
Sanjay Patel [Tue, 18 Apr 2017 22:36:59 +0000 (22:36 +0000)]
[x86] add tests for potential andn optimization; NFC

llvm-svn: 300617

7 years ago[coff] fix test for msvclto
Bob Haarman [Tue, 18 Apr 2017 22:29:36 +0000 (22:29 +0000)]
[coff] fix test for msvclto

llvm-svn: 300616

7 years agoInclude time.h, and fix a Darwin warning
Chris Bieneman [Tue, 18 Apr 2017 22:11:13 +0000 (22:11 +0000)]
Include time.h, and fix a Darwin warning

This is a little more cleanup from r300579.

llvm-svn: 300615

7 years agoFix crash in AttributeList::addAttributes, add test
Reid Kleckner [Tue, 18 Apr 2017 22:10:18 +0000 (22:10 +0000)]
Fix crash in AttributeList::addAttributes, add test

llvm-svn: 300614

7 years agoAdd a getPointerOperandType() helper to LoadInst and StoreInst; NFC
Sanjoy Das [Tue, 18 Apr 2017 22:00:54 +0000 (22:00 +0000)]
Add a getPointerOperandType() helper to LoadInst and StoreInst; NFC

I will use this in a later change.

llvm-svn: 300613

7 years ago[coff] use newlines instead of spaces as separators in msvclto response file
Bob Haarman [Tue, 18 Apr 2017 22:00:29 +0000 (22:00 +0000)]
[coff] use newlines instead of spaces as separators in msvclto response file

Summary:
Fixes PR32689: /msvclto creates response files with lines
that are too long for msvc's linker (LNK1170).

Reviewers: hans, rnk, ruiu

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 300612

7 years ago[modules-ts] Fold together -x c++ and -x c++-module at -cc1 level.
Richard Smith [Tue, 18 Apr 2017 21:55:37 +0000 (21:55 +0000)]
[modules-ts] Fold together -x c++ and -x c++-module at -cc1 level.

The driver needs to know whether it's building a module interface or
implementation unit because it affects which outputs it produces and how it
builds the command pipeline. But the frontend doesn't need to know and should
not care: all it needs to know is what action it is being asked to perform on
the input.

(This is in preparation for permitting -emit-obj to be used on a module
interface unit to produce object code without going via a "full" PCM file.)

llvm-svn: 300611

7 years agoFix Windows bot failure
Chris Bieneman [Tue, 18 Apr 2017 21:47:50 +0000 (21:47 +0000)]
Fix Windows bot failure

timespec is not available on Windows, and we should use size_t instead of nfds_t.

llvm-svn: 300610

7 years agoDo not warn about whitespace between ??/ trigraph and newline in line comments if...
Richard Smith [Tue, 18 Apr 2017 21:45:04 +0000 (21:45 +0000)]
Do not warn about whitespace between ??/ trigraph and newline in line comments if trigraphs are disabled in the current language.

llvm-svn: 300609

7 years ago[MemoryBuiltins] Add isMallocOrCallocLikeFn so BasicAA can check for both at the...
Craig Topper [Tue, 18 Apr 2017 21:43:46 +0000 (21:43 +0000)]
[MemoryBuiltins] Add isMallocOrCallocLikeFn so BasicAA can check for both at the same time

BasicAA wants to know if a function is either a malloc or calloc like function. Currently we have to check both separately. This means both calls check if its an intrinsic, query TLI, check the nobuiltin attribute, scan the AllocationFnData, etc.

This patch adds a isMallocOrCallocLikeFn so we can go through all of the checks once per call.

This also changes the one other location I saw that called both together.

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

llvm-svn: 300608

7 years ago[LoopReroll] Prefer hasNUses/hasNUses or more as they're cheaper. NFCI.
Davide Italiano [Tue, 18 Apr 2017 21:42:21 +0000 (21:42 +0000)]
[LoopReroll] Prefer hasNUses/hasNUses or more as they're cheaper. NFCI.

llvm-svn: 300607

7 years agoFixing error on Android build (-Werror)
Chris Bieneman [Tue, 18 Apr 2017 21:35:26 +0000 (21:35 +0000)]
Fixing error on Android build (-Werror)

This is fallout from r300579.

llvm-svn: 300606

7 years agoRemoving unused include
Chris Bieneman [Tue, 18 Apr 2017 21:23:55 +0000 (21:23 +0000)]
Removing unused include

This is causing the Windows bot failures.

llvm-svn: 300605

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> for std::queue and std::priority_queue.
Eric Fiselier [Tue, 18 Apr 2017 21:23:18 +0000 (21:23 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::queue and std::priority_queue.

llvm-svn: 300604

7 years agoDAG: Make mayBeEmittedAsTailCall parameter const
Matt Arsenault [Tue, 18 Apr 2017 21:16:46 +0000 (21:16 +0000)]
DAG: Make mayBeEmittedAsTailCall parameter const

llvm-svn: 300603

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macro uses in std::stack.
Eric Fiselier [Tue, 18 Apr 2017 21:16:26 +0000 (21:16 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macro uses in std::stack.

llvm-svn: 300602

7 years ago[sanitizer] Define lsan-x86 in tests for both i386 and i686.
Evgeniy Stepanov [Tue, 18 Apr 2017 21:10:50 +0000 (21:10 +0000)]
[sanitizer] Define lsan-x86 in tests for both i386 and i686.

llvm-svn: 300601

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimap
Eric Fiselier [Tue, 18 Apr 2017 21:08:06 +0000 (21:08 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimap

llvm-svn: 300600

7 years agoImplement suspended thread register count for darwin
Francis Ricci [Tue, 18 Apr 2017 21:05:11 +0000 (21:05 +0000)]
Implement suspended thread register count for darwin

Reviewers: kubamracek, alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 300599

7 years agoRemove mips64 defines from darwin-specific file
Francis Ricci [Tue, 18 Apr 2017 21:05:09 +0000 (21:05 +0000)]
Remove mips64 defines from darwin-specific file

Reviewers: kubamracek, alekseyshl

Subscribers: llvm-commits, arichardson

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

llvm-svn: 300598

7 years agoFix typo
Matt Arsenault [Tue, 18 Apr 2017 20:59:46 +0000 (20:59 +0000)]
Fix typo

llvm-svn: 300597

7 years agoAMDGPU: Make MFI fields private
Matt Arsenault [Tue, 18 Apr 2017 20:59:40 +0000 (20:59 +0000)]
AMDGPU: Make MFI fields private

llvm-svn: 300596

7 years agoCleanup _LIBCPP_HAS_NO_<c++11-feature> for std::set and std::multiset
Eric Fiselier [Tue, 18 Apr 2017 20:58:03 +0000 (20:58 +0000)]
Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::set and std::multiset

llvm-svn: 300595

7 years agoPR30508: Downgrade error to warning if the umbrella folder doesn't exist.
Vassil Vassilev [Tue, 18 Apr 2017 20:57:29 +0000 (20:57 +0000)]
PR30508: Downgrade error to warning if the umbrella folder doesn't exist.

Patch by Yuka Takahashi (D32119)!

llvm-svn: 300594

7 years agoDon't use abort_on_error for lsan darwin test suite
Francis Ricci [Tue, 18 Apr 2017 20:56:59 +0000 (20:56 +0000)]
Don't use abort_on_error for lsan darwin test suite

Summary:
This option is disabled by our other test suites, and will cause
failures when unit tests abort instead of failing with an error code.
Will also prevent the test suite from being too slow.

Reviewers: kubamracek, alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 300593

7 years agoAllow for setting of global platform-specific lsan options in the test suite
Francis Ricci [Tue, 18 Apr 2017 20:56:56 +0000 (20:56 +0000)]
Allow for setting of global platform-specific lsan options in the test suite

Reviewers: kubamracek, alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 300592

7 years agoThe SubjectMatchRule enum should not be used as a DenseMap key to avoid
Alex Lorenz [Tue, 18 Apr 2017 20:54:23 +0000 (20:54 +0000)]
The SubjectMatchRule enum should not be used as a DenseMap key to avoid
UBSAN 'invalid value' failures

The commit r300556 introduced a UBSAN issue that was caught by
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap. The DenseMap
failed to create an empty/tombstone value as the empty/tombstone values for the
SubjectMatchRule enum were not valid enum constants.

llvm-svn: 300591

7 years ago[CMake] Adding configure-time check for sigaction
Chris Bieneman [Tue, 18 Apr 2017 20:49:09 +0000 (20:49 +0000)]
[CMake] Adding configure-time check for sigaction

Hopefully this will fix the netbsd bot that I broke...

llvm-svn: 300590

7 years agoWriting multi-platform code is hard...
Chris Bieneman [Tue, 18 Apr 2017 20:49:05 +0000 (20:49 +0000)]
Writing multi-platform code is hard...

Fixing another error from r300579.

llvm-svn: 300589

7 years ago[clang-tidy] Address a few late comments.
Haojian Wu [Tue, 18 Apr 2017 20:47:34 +0000 (20:47 +0000)]
[clang-tidy] Address a few late comments.

llvm-svn: 300588

7 years agoFix broken windows build.
Chris Bieneman [Tue, 18 Apr 2017 20:37:05 +0000 (20:37 +0000)]
Fix broken windows build.

This is not ideal, but it should get the bot going again. I'll need to revisit this if we want to get signal handling working on Windows.

llvm-svn: 300587

7 years ago[MemoryBuiltins] Use ImmutableCallSite instead of CallSite to remove a const_cast...
Craig Topper [Tue, 18 Apr 2017 20:17:23 +0000 (20:17 +0000)]
[MemoryBuiltins] Use ImmutableCallSite instead of CallSite to remove a const_cast and const correct. NFCI

llvm-svn: 300585

7 years agoNewGVN: Fix memory congruence verification. The return true should be a return false...
Daniel Berlin [Tue, 18 Apr 2017 20:15:47 +0000 (20:15 +0000)]
NewGVN: Fix memory congruence verification. The return true should be a return false. Merge the appropriate if statements so it doesn't happen again.

llvm-svn: 300584

7 years ago[X86] Keep EXTRACT_VECTOR_ELT result type as f128 for Android x86_64.
Chih-Hung Hsieh [Tue, 18 Apr 2017 20:15:18 +0000 (20:15 +0000)]
[X86] Keep EXTRACT_VECTOR_ELT result type as f128 for Android x86_64.

Android x86_64 target uses f128 type and stores f128 values in %xmm* registers.
SoftenFloatRes_EXTRACT_VECTOR_ELT should not convert result value
from f128 to i128.

Differential Revision: http://reviews.llvm.org/D32102

llvm-svn: 300583

7 years agoFixing bot failure caused by r300579
Chris Bieneman [Tue, 18 Apr 2017 20:08:29 +0000 (20:08 +0000)]
Fixing bot failure caused by r300579

llvm-svn: 300582

7 years ago[test] Silence another unused-typedef warning
Casey Carter [Tue, 18 Apr 2017 20:04:39 +0000 (20:04 +0000)]
[test] Silence another unused-typedef warning

llvm-svn: 300581

7 years agoUpdate DebugServer to support IPv6 over TCP
Chris Bieneman [Tue, 18 Apr 2017 20:01:59 +0000 (20:01 +0000)]
Update DebugServer to support IPv6 over TCP

Summary: This patch adds IPv6 support to debugserver. It follows a similar pattern to the changes proposed for LLDB/Host except that the listen implementation is only with kqueue(2) because debugserver is only supported on Darwin.

Reviewers: jingham, jasonmolenda, clayborg

Reviewed By: clayborg

Subscribers: mgorny, lldb-commits

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

llvm-svn: 300580

7 years agoUpdate LLDB Host to support IPv6 over TCP
Chris Bieneman [Tue, 18 Apr 2017 20:01:52 +0000 (20:01 +0000)]
Update LLDB Host to support IPv6 over TCP

Summary:
This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way.

This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me).

The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call.

This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address.

The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else.

Reviewers: zturner, clayborg

Subscribers: jasonmolenda, labath, lldb-commits, emaste

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

llvm-svn: 300579

7 years ago[DOXYGEN] Minor improvements in doxygen comments.
Ekaterina Romanova [Tue, 18 Apr 2017 19:44:07 +0000 (19:44 +0000)]
[DOXYGEN] Minor improvements in doxygen comments.

- To be consistent with the rest of the intrinsics headers, I removed the tags <i> .. </i> for marking instruction names in italics in in smmintrin.h.

- Formatting changes to fit into 80 characters.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream.

llvm-svn: 300578

7 years ago[APInt] Inline the single word case of lshrInPlace similar to what we do for <<=.
Craig Topper [Tue, 18 Apr 2017 19:13:27 +0000 (19:13 +0000)]
[APInt] Inline the single word case of lshrInPlace similar to what we do for <<=.

llvm-svn: 300577

7 years ago[X86][SSE] Add scheduling latency/throughput tests for (most) SSE1 instructions
Simon Pilgrim [Tue, 18 Apr 2017 19:04:40 +0000 (19:04 +0000)]
[X86][SSE] Add scheduling latency/throughput tests for (most) SSE1 instructions

llvm-svn: 300576

7 years ago[test] Silence unused parameter/typedef warnings
Casey Carter [Tue, 18 Apr 2017 18:44:33 +0000 (18:44 +0000)]
[test] Silence unused parameter/typedef warnings

llvm-svn: 300575

7 years ago[SLP vectorizer] Allow phi node reordering in tryToVectorizeList.
Easwaran Raman [Tue, 18 Apr 2017 18:16:57 +0000 (18:16 +0000)]
[SLP vectorizer] Allow phi node reordering in tryToVectorizeList.

In tryToVectorizeList, under a very limited circumstance (when entered
from tryToVectorizePair), the values may be reordered (swapped) and the
SLP tree is built with the new order. This extends that to the case when
starting from phis in vectorizeChainsInBlock when there are exactly two
phis. The textual order of phi nodes shouldn't really matter. Without
this change, the loop body in the accompnaying test case is fully vectorized
when we swap the orde of the phis but not with this order. While this
doesn't solve the phi-ordering problem in a general way (for more than 2
phis), this is simple fix that piggybacks on an existing mechanism and
is useful in cases like multiplying two complex numbers.

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

llvm-svn: 300574

7 years agoRemove unused varible
Reid Kleckner [Tue, 18 Apr 2017 17:44:41 +0000 (17:44 +0000)]
Remove unused varible

The Result variable is unused both in Sema::CheckARMBuiltinFunctionCall
and Sema::CheckAArch64BuiltinFunctionCall, remove it.

Patch by Wei-Ren Chen!

Reviewers: craig.topper, rnk

Reviewed By: rnk

Subscribers: aemerson, cfe-commits, rengolin

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

llvm-svn: 300572

7 years ago[AArch64][clang] Pass cpu/arch information to assembler for AArch64.
Manoj Gupta [Tue, 18 Apr 2017 17:36:10 +0000 (17:36 +0000)]
[AArch64][clang] Pass cpu/arch information to assembler for AArch64.

Summary:
Pass Cpu/Arch options to assembler for AArch64 with no-integrated-as.
This fixes PR20019.

Reviewers: richard.barton.arm, kristof.beyls, rengolin

Reviewed By: rengolin

Subscribers: srhines, pirama, aemerson, rengolin, cfe-commits

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

llvm-svn: 300571

7 years agoTesting commit access.
Manoj Gupta [Tue, 18 Apr 2017 17:34:46 +0000 (17:34 +0000)]
Testing commit access.

Summary: Test commit access.

Reviewers: gbiv, george.burgess.iv

Reviewed By: george.burgess.iv

Subscribers: cfe-commits

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

llvm-svn: 300570

7 years ago[clang-tidy] Fix google-explicit-constructor issue with out-of-line conversions
Alexander Kornienko [Tue, 18 Apr 2017 17:26:00 +0000 (17:26 +0000)]
[clang-tidy] Fix google-explicit-constructor issue with out-of-line conversions

llvm-svn: 300569

7 years agoMark LWG#2788 as complete - we already do this
Marshall Clow [Tue, 18 Apr 2017 17:22:49 +0000 (17:22 +0000)]
Mark LWG#2788 as complete - we already do this

llvm-svn: 300568

7 years ago[X86] Use for-range loop. NFCI.
Simon Pilgrim [Tue, 18 Apr 2017 17:18:54 +0000 (17:18 +0000)]
[X86] Use for-range loop. NFCI.

llvm-svn: 300567

7 years ago[APInt] Use lshrInPlace to replace lshr where possible
Craig Topper [Tue, 18 Apr 2017 17:14:21 +0000 (17:14 +0000)]
[APInt] Use lshrInPlace to replace lshr where possible

This patch uses lshrInPlace to replace code where the object that lshr is called on is being overwritten with the result.

This adds an lshrInPlace(const APInt &) version as well.

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

llvm-svn: 300566

7 years agoNewGVN: Don't waste time value numbering unreachable blocks
Daniel Berlin [Tue, 18 Apr 2017 17:06:11 +0000 (17:06 +0000)]
NewGVN: Don't waste time value numbering unreachable blocks

llvm-svn: 300565

7 years agoAdd back code to implement "frame var -a,-l,-g" filters.
Jim Ingham [Tue, 18 Apr 2017 16:52:16 +0000 (16:52 +0000)]
Add back code to implement "frame var -a,-l,-g" filters.

r285226 dropped the code that did these checks.  I am pretty
sure that was inadvertent, so I added that back in and added
a test for it.

<rdar://problem/31661252>

llvm-svn: 300564

7 years agoMake the test pass on x86_64-win32 target.
Haojian Wu [Tue, 18 Apr 2017 16:25:03 +0000 (16:25 +0000)]
Make the test pass on x86_64-win32 target.

llvm-svn: 300563

7 years agomingw-w64: enable support for __declspec(selectany)
Martell Malone [Tue, 18 Apr 2017 15:56:24 +0000 (15:56 +0000)]
mingw-w64: enable support for __declspec(selectany)

Add selectany as a GCC spelling for mingw-w64

Reviewers: rnk

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

llvm-svn: 300562

7 years ago[DAG] Improve store merge candidate pruning.
Nirav Dave [Tue, 18 Apr 2017 15:36:34 +0000 (15:36 +0000)]
[DAG] Improve store merge candidate pruning.

Remove non-consecutive stores from store merge candidate search as
they cannot be merged and will prevent us from finding subsequent
mergeable store cases.

Reviewers: jyknight, bogner, javed.absar, spatel

Subscribers: llvm-commits

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

llvm-svn: 300561

7 years ago[ASTPrinter] Print template parameter lists for out-of-line functions
Alex Lorenz [Tue, 18 Apr 2017 15:12:34 +0000 (15:12 +0000)]
[ASTPrinter] Print template parameter lists for out-of-line functions

llvm-svn: 300560

7 years agoAdd base-index-based store merge test
Nirav Dave [Tue, 18 Apr 2017 15:12:13 +0000 (15:12 +0000)]
Add base-index-based store merge test

llvm-svn: 300559

7 years agoLoopRerollPass: Prefer Value::hasOneUse() over Value::getNumUses(). NFC.
Zvi Rackover [Tue, 18 Apr 2017 14:55:43 +0000 (14:55 +0000)]
LoopRerollPass: Prefer Value::hasOneUse() over Value::getNumUses(). NFC.

getNumUses() can be more expensive as it iterates over all list's elements.

llvm-svn: 300558

7 years ago[LV] Cache block mask values
Gil Rapaport [Tue, 18 Apr 2017 14:43:43 +0000 (14:43 +0000)]
[LV] Cache block mask values

This patch is part of D28975's breakdown.

Add caching for block masks similar to the cache already used for edge masks,
replacing generation per user with reusing the first generated value which
dominates all uses.

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

llvm-svn: 300557

7 years agoAdd #pragma clang attribute
Alex Lorenz [Tue, 18 Apr 2017 14:33:39 +0000 (14:33 +0000)]
Add #pragma clang attribute

This is a recommit of r300539 that was reverted in r300543 due to test failures.
The original commit message is displayed below:

The new '#pragma clang attribute' directive can be used to apply attributes to
multiple declarations. An attribute must satisfy the following conditions to
be supported by the pragma:
- It must have a subject list that's defined in the TableGen file.
- It must be documented.
- It must not be late parsed.
- It must have a GNU/C++11 spelling.

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

llvm-svn: 300556

7 years agoDriver: Better detection of mingw-gcc
Martell Malone [Tue, 18 Apr 2017 14:27:36 +0000 (14:27 +0000)]
Driver: Better detection of mingw-gcc

Stop blindly searching for "gcc.exe" on windows.
Stop assuming "/usr" on unix, fixes cross compiling.

Reviewers: mati865, yaron.keren

Subscribers: ismail, rnk

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

llvm-svn: 300555

7 years ago[ConstantRange] fix doxygen comment formatting; NFC
Sanjay Patel [Tue, 18 Apr 2017 14:27:24 +0000 (14:27 +0000)]
[ConstantRange] fix doxygen comment formatting; NFC

llvm-svn: 300554

7 years agoMake globalaa-retained.ll test catching more cases.
Nikolai Bozhenov [Tue, 18 Apr 2017 13:29:26 +0000 (13:29 +0000)]
Make globalaa-retained.ll test catching more cases.

Summary:
* Add checks for store. That is needed because GlobalsAA is called
  twice in the current pipeline with different sets of Function passes
  following it. However, the loads are eliminated using instcombine
  which happens everywhere. On the other hand, DeadStoreElimination is
  performed only once so by checking for store we'll be able to catch
  more cases when GlobalsAA is invalidated unintentionally.
* Add empty function above/below the test so that we don't depend on
  the relative order of instcombine/dead-store-elimination and the
  pass that invalidates the analysis (inside the same
  FunctionPassManager).

Reviewers: kristof.beyls

Reviewed By: kristof.beyls

Subscribers: llvm-commits, n.bozhenov

Differential Revision: https://reviews.llvm.org/D32015
Patch by Andrei Elovikov <andrei.elovikov@intel.com>

llvm-svn: 300553

7 years ago[GVNHoist] Mark GlobalsAA as preserved by GVNHoist.
Nikolai Bozhenov [Tue, 18 Apr 2017 13:25:49 +0000 (13:25 +0000)]
[GVNHoist] Mark GlobalsAA as preserved by GVNHoist.

Reviewers: sebpop, hiraditya

Reviewed By: sebpop

Subscribers: n.bozhenov, llvm-commits

Differential Revision: https://reviews.llvm.org/D32158
Patch by Andrei Elovikov <andrei.elovikov@intel.com>

llvm-svn: 300552

7 years agoAdd store Merge test.
Nirav Dave [Tue, 18 Apr 2017 13:25:19 +0000 (13:25 +0000)]
Add store Merge test.

llvm-svn: 300551

7 years ago[ARM] Add hardware build attributes in assembler
Oliver Stannard [Tue, 18 Apr 2017 13:21:05 +0000 (13:21 +0000)]
[ARM] Add hardware build attributes in assembler

This passes an option to the ARM assembly parser to emit build
attributes for the hardware selected by command line options, when
assembling an assembly file.

This is not enabled for C/C++, as this would result in duplicate build
attribute directives being emitted in each inline assembly block, when
emitting assembly.

This also adds an option to allow disabling this behaviour for assembly
files, for users who were relying on the old behaviour.

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

llvm-svn: 300550

7 years ago[ARM,AArch64] Define __ELF__ for arm-none-eabihf and AArch64
Oliver Stannard [Tue, 18 Apr 2017 13:12:36 +0000 (13:12 +0000)]
[ARM,AArch64] Define __ELF__ for arm-none-eabihf and AArch64

This macro is defined for arm-none-eabi as of r266625, but it should also be
defined for eabihf and aarch64.

llvm-svn: 300549

7 years agoIntroduce FPR and Debug Registers/NetBSD/amd64 support
Kamil Rytarowski [Tue, 18 Apr 2017 12:53:35 +0000 (12:53 +0000)]
Introduce FPR and Debug Registers/NetBSD/amd64 support

Summary:
This code offers Debug Registers (80386) model in LLDB/amd64.

This is initial support and has one issue that will be addressed later,
Debug Register trap (TRAP_DBREG) is registered as (TRAP_TRACE)
for unknown reason.  On the other hand this works good enough to
move on and leave this bug to be squashed later.

Improve the NativeProcessNetBSD::ReinitializeThreads() function,
stop setting inside it SetStoppedByExec(). This fixes incorrect
stop reason on attaching (SetStoppedBySignal(SIGSTOP)).

This commits also has no functional style improvements from
clang-format.

This code also ships with FXSAVE support on NetBSD.

Demo:

```
$ lldb ./watch
(lldb) target create "./watch"
Current executable set to './watch' (x86_64).
(lldb) b main
Breakpoint 1: where = watch`main + 15 at watch.c:8, address = 0x000000000040087f
(lldb) r
Process 1573 launched: './watch' (x86_64)
Process 1573 stopped
* thread #1, stop reason = breakpoint 1.1
    frame #0: 0x000000000040087f watch`main(argc=1, argv=0x00007f7fffa12b88) at watch.c:8
   5    {
   6            int i, j, k;
   7
-> 8            for (i = 0; i < 3; i++)
   9                    for (j = 0; j < 3; j++)
   10                           for (k = 0; k < 3; k++)
   11                                   printf("Hello world! i=%d j=%d k=%d\n", i, j, k);
(lldb) watch set var i
Watchpoint created: Watchpoint 1: addr = 0x7f7fffa12b4c size = 4 state = enabled type = w
    declare @ '/public/lldb_devel/watch.c:6'
    watchpoint spec = 'i'
    new value: 0
(lldb) c
Process 1573 resuming
Hello world! i=0 j=0 k=0
Hello world! i=0 j=0 k=1
Hello world! i=0 j=0 k=2
Hello world! i=0 j=1 k=0
Hello world! i=0 j=1 k=1
Hello world! i=0 j=1 k=2
Hello world! i=0 j=2 k=0
Hello world! i=0 j=2 k=1
Hello world! i=0 j=2 k=2
Process 1573 stopped
* thread #1, stop reason = trace
    frame #0: 0x00000000004008cc watch`main(argc=1, argv=0x00007f7fffa12b88) at watch.c:8
   5    {
   6            int i, j, k;
   7
-> 8            for (i = 0; i < 3; i++)
   9                    for (j = 0; j < 3; j++)
   10                           for (k = 0; k < 3; k++)
   11                                   printf("Hello world! i=%d j=%d k=%d\n", i, j, k)
```

FPR (in another program using libm)

```
(lldb) register read --all
General Purpose Registers:
       rax = 0x000000000000001c
       rbx = 0x00007f7fff1d4fe0
       rcx = 0x000000000000000c
       rdx = 0x0000000000000002
       rdi = 0x0000746711d5b018  __sF + 152
       rsi = 0x0000000000000001
       rbp = 0x00007f7fff1d3d80
       rsp = 0x00007f7fff1d3d60
        r8 = 0x00007f7fff1d3470
        r9 = 0x0000000000000000
       r10 = 0x0000000000000001
       r11 = 0x0000000000000202
       r12 = 0x00007f7fff1d3da0
       r13 = 0x00007d8ad2d88500
       r14 = 0x0000000000000002
       r15 = 0x00007f7fffa627e0
       rip = 0x00000000004009e9  fpr`main + 217 at fpr.c:15
    rflags = 0x0000000000000202
        cs = 0x0000000000000047
        fs = 0x0000000000000000
        gs = 0x0000000000000000
        ss = 0x000000000000003f
        ds = 0x000000000000003f
        es = 0x000000000000003f
       eax = 0x0000001c
       ebx = 0xff1d4fe0
       ecx = 0x0000000c
       edx = 0x00000002
       edi = 0x11d5b018
       esi = 0x00000001
       ebp = 0xff1d3d80
       esp = 0xff1d3d60
       r8d = 0xff1d3470
       r9d = 0x00000000
      r10d = 0x00000001
      r11d = 0x00000202
      r12d = 0xff1d3da0
      r13d = 0xd2d88500
      r14d = 0x00000002
      r15d = 0xffa627e0
        ax = 0x001c
        bx = 0x4fe0
        cx = 0x000c
        dx = 0x0002
        di = 0xb018
        si = 0x0001
        bp = 0x3d80
        sp = 0x3d60
       r8w = 0x3470
       r9w = 0x0000
      r10w = 0x0001
      r11w = 0x0202
      r12w = 0x3da0
      r13w = 0x8500
      r14w = 0x0002
      r15w = 0x27e0
        ah = 0x00
        bh = 0x4f
        ch = 0x00
        dh = 0x00
        al = 0x1c
        bl = 0xe0
        cl = 0x0c
        dl = 0x02
       dil = 0x18
       sil = 0x01
       bpl = 0x80
       spl = 0x60
       r8l = 0x70
       r9l = 0x00
      r10l = 0x01
      r11l = 0x02
      r12l = 0xa0
      r13l = 0x00
      r14l = 0x02
      r15l = 0xe0

unknown:
     fctrl = 0x037f
     fstat = 0x0220
      ftag = 0x00
       fop = 0x0000
     fiseg = 0x11e1a52c
     fioff = 0x11e1a52c
     foseg = 0xff1d3d54
     fooff = 0xff1d3d54
     mxcsr = 0x00001fa0
  mxcsrmask = 0x0000ffff
       st0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
       st1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
       st2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
       st3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
       st4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
       st5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
       st6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
       st7 = {0xa5 0xdb 0x2d 0xbd 0x93 0xae 0xb9 0xfe 0xfe 0x3f}
       mm0 = 0x3fe9d13800000000
       mm1 = 0x3e0485fcce89c000
       mm2 = 0x3fefd735e0000000
       mm3 = 0x0000000000000000
       mm4 = 0x3fe0000000000000
       mm5 = 0x3fe00000005217f3
       mm6 = 0x0000000000000000
       mm7 = 0x3fefd735e0000000
      xmm0 = {0x00 0x00 0x00 0x00 0x38 0xd1 0xe9 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm1 = {0x00 0xc0 0x89 0xce 0xfc 0x85 0x04 0x3e 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm2 = {0x00 0x00 0x00 0xe0 0x35 0xd7 0xef 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm4 = {0x00 0x00 0x00 0x00 0x00 0x00 0xe0 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm5 = {0xf3 0x17 0x52 0x00 0x00 0x00 0xe0 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm7 = {0x00 0x00 0x00 0xe0 0x35 0xd7 0xef 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm8 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
      xmm9 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm10 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm11 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm12 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm13 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm14 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
     xmm15 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
       dr0 = 0x0000000000000000
       dr1 = 0x0000000000000000
       dr2 = 0x0000000000000000
       dr3 = 0x0000000000000000
       dr4 = 0x0000000000000000
       dr5 = 0x0000000000000000
       dr6 = 0x00000000ffff0ff0
       dr7 = 0x0000000000000400
22 registers were unavailable.
```

Sponsored by <The NetBSD Foundation>

Reviewers: labath, emaste, joerg, kettenis

Reviewed By: labath

Subscribers: #lldb

Tags: #lldb

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

llvm-svn: 300548