platform/upstream/llvm.git
8 years ago[libFuzzer] make sure we have symbols on fuzzer tests
Kostya Serebryany [Thu, 25 Aug 2016 23:30:02 +0000 (23:30 +0000)]
[libFuzzer] make sure we have symbols on fuzzer tests

llvm-svn: 279792

8 years ago[asan] remove unused kAsanHeapRightRedzoneMagic (NFC); part 2 (sorry)
Kostya Serebryany [Thu, 25 Aug 2016 22:51:26 +0000 (22:51 +0000)]
[asan] remove unused kAsanHeapRightRedzoneMagic (NFC); part 2 (sorry)

llvm-svn: 279790

8 years ago[asan] remove unused kAsanHeapRightRedzoneMagic (NFC)
Kostya Serebryany [Thu, 25 Aug 2016 22:49:35 +0000 (22:49 +0000)]
[asan] remove unused kAsanHeapRightRedzoneMagic (NFC)

llvm-svn: 279789

8 years agoRevert r274613 because it breaks the test suite with AVX512
Michael Kuperstein [Thu, 25 Aug 2016 22:48:11 +0000 (22:48 +0000)]
Revert r274613 because it breaks the test suite with AVX512

This reverts most of r274613 (AKA r274626) and its follow-ups (r276347, r277289),
due to miscompiles in the test suite. The FastISel change was left in, because
it apparently fixes an unrelated issue.

(Recommit of r279782 which was broken due to a bad merge.)

This fixes 4 out of the 5 test failures in PR29112.

llvm-svn: 279788

8 years ago[libFizzer] rename -print_new_cov_pcs=1 into -print_pcs=1 and make it more useful...
Kostya Serebryany [Thu, 25 Aug 2016 22:35:08 +0000 (22:35 +0000)]
[libFizzer] rename -print_new_cov_pcs=1 into -print_pcs=1 and make it more useful: print PCs only after the initial corpus has been read and symbolize them

llvm-svn: 279787

8 years agoWiden type of __offset_flags in RTTI on Mingw64
Reid Kleckner [Thu, 25 Aug 2016 22:16:30 +0000 (22:16 +0000)]
Widen type of __offset_flags in RTTI on Mingw64

Otherwise we can't handle secondary base classes at offsets greater than
2**24. This agrees with libstdc++abi.

We could extend this change to other LLP64 platforms, but then we would
want to update libc++abi and it would require additional review.

Fixes PR29116

llvm-svn: 279786

8 years agoRevert r279782 due to debug buildbot breakage.
Michael Kuperstein [Thu, 25 Aug 2016 22:14:45 +0000 (22:14 +0000)]
Revert r279782 due to debug buildbot breakage.

llvm-svn: 279785

8 years agoAdd a notification message in 'type lookup' when the current language doesn't yield...
Enrico Granata [Thu, 25 Aug 2016 22:11:01 +0000 (22:11 +0000)]
Add a notification message in 'type lookup' when the current language doesn't yield results and one has to go across multiple languages to scan for types

Fixes rdar://22422313

llvm-svn: 279784

8 years agoFix ArrayRef initializer_list Ctor Test
David Blaikie [Thu, 25 Aug 2016 22:09:13 +0000 (22:09 +0000)]
Fix ArrayRef initializer_list Ctor Test

The InitializerList test had undefined behavior by creating a dangling pointer to the temporary initializer list.  This patch removes the undefined behavior in the test by creating the initializer list directly.

Reviewers: mehdi_amini, dblaikie

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

llvm-svn: 279783

8 years agoRevert r274613 because it breaks the test suite with AVX512
Michael Kuperstein [Thu, 25 Aug 2016 21:55:41 +0000 (21:55 +0000)]
Revert r274613 because it breaks the test suite with AVX512

This reverts most of r274613 and its follow-ups (r276347, r277289), due to
miscompiles in the test suite. The FastISel change was left in, because it
apparently fixes an unrelated issue.

This fixes 4 out of the 5 test failures in PR29112.

llvm-svn: 279782

8 years ago[asan] fix windows bot
Kostya Serebryany [Thu, 25 Aug 2016 21:45:18 +0000 (21:45 +0000)]
[asan] fix windows bot

llvm-svn: 279781

8 years ago[sanitizer] add __sanitizer_symbolize_pc. https://github.com/google/sanitizers/issues/322
Kostya Serebryany [Thu, 25 Aug 2016 21:35:29 +0000 (21:35 +0000)]
[sanitizer] add __sanitizer_symbolize_pc. https://github.com/google/sanitizers/issues/322

llvm-svn: 279780

8 years ago[StreamExecutor] Add Platform and PlatformManager
Jason Henline [Thu, 25 Aug 2016 21:33:07 +0000 (21:33 +0000)]
[StreamExecutor] Add Platform and PlatformManager

Summary: Abstractions for a StreamExecutor platform

Reviewers: jlebar

Subscribers: jprice, parallel_libs-commits

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

llvm-svn: 279779

8 years ago[MemCpy] Add comments for r279769
Tim Shen [Thu, 25 Aug 2016 21:03:46 +0000 (21:03 +0000)]
[MemCpy] Add comments for r279769

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

llvm-svn: 279778

8 years agocmake: Install CheckAtomic.cmake (needed by lldb)
Chris Bieneman [Thu, 25 Aug 2016 20:53:00 +0000 (20:53 +0000)]
cmake: Install CheckAtomic.cmake (needed by lldb)

Summary:
Install CheckAtomic.cmake along with other LLVM modules, therefore making it possible for other projects to use it. This file is needed for LLDB to be built standalone, and installing it was suggested in https://reviews.llvm.org/D23881.

Patch by: Michał Górny

Reviewers: krytarowski, zturner, eugenis, jyknight, labath, beanz

Subscribers: beanz, llvm-commits

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

llvm-svn: 279777

8 years ago[CMake] Add support for exposing runtime targets
Chris Bieneman [Thu, 25 Aug 2016 20:49:51 +0000 (20:49 +0000)]
[CMake] Add support for exposing runtime targets

This patch adds support to the runtimes build for exposing sub-project targets through the high-level configuration. This will enable exposing the build, check and install targets for sub-project components (i.e. asan, check-asan, install-asan...).

This patch requires minor changes to the runtime projects to take advantage of it, and I'll phase those changes into Compiler-RT shortly.

llvm-svn: 279776

8 years agoFix test corresponding to change r279770
Hemant Kulkarni [Thu, 25 Aug 2016 20:43:49 +0000 (20:43 +0000)]
Fix test corresponding to change r279770

llvm-svn: 279775

8 years ago[MS] Win64 va_arg should expect large arguments to be passed indirectly
Reid Kleckner [Thu, 25 Aug 2016 20:42:26 +0000 (20:42 +0000)]
[MS] Win64 va_arg should expect large arguments to be passed indirectly

Fixes PR20569

llvm-svn: 279774

8 years agoARM: by default don't set the Thumb bit on MachO relocated values.
Tim Northover [Thu, 25 Aug 2016 20:41:30 +0000 (20:41 +0000)]
ARM: by default don't set the Thumb bit on MachO relocated values.

Its existence is largely historical, apparently we tried to make ARM object
files look maybe-almost-possibly runnable by putting our best guess at the
actual value into relocated locations. Of course, the real linker then comes
along and can completely change things.

But it should only be there for word-sized and movw/movt relocations. It can't
be encoded in branch relocations, and I've seen it mess up validity
calculations twice in the last couple of weeks so the default is clearly problematic.

llvm-svn: 279773

8 years agoFix clang-offload-bundler.c test on Windows
Reid Kleckner [Thu, 25 Aug 2016 20:40:23 +0000 (20:40 +0000)]
Fix clang-offload-bundler.c test on Windows

llvm-svn: 279772

8 years ago[sanitizer] change SizeClassAllocator64 to accept just one template parameter instead...
Kostya Serebryany [Thu, 25 Aug 2016 20:23:08 +0000 (20:23 +0000)]
[sanitizer] change SizeClassAllocator64 to accept just one template parameter instead of 5. First, this will make the mangled names shorter. Second, this will make adding more parameters simpler.

llvm-svn: 279771

8 years agollvm-objdump: ELF: Handle code and data mix in all scenarios
Hemant Kulkarni [Thu, 25 Aug 2016 19:41:08 +0000 (19:41 +0000)]
llvm-objdump: ELF: Handle code and data mix in all scenarios

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

llvm-svn: 279770

8 years ago[MemCpy] Check for alias in performMemCpyToMemSetOptzn, instead of the identity of...
Tim Shen [Thu, 25 Aug 2016 19:27:26 +0000 (19:27 +0000)]
[MemCpy] Check for alias in performMemCpyToMemSetOptzn, instead of the identity of two operands

Summary:
This fixes pr29105. The reason is that lifetime marks creates new
aliasing pointers the original ones, but before this patch aliases
were not checked in performMemCpyToMemSetOptzn.

Subscribers: llvm-commits

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

llvm-svn: 279769

8 years ago[lsan] one more test fix to please the Debian Sid bot (this time, confirmed on the...
Kostya Serebryany [Thu, 25 Aug 2016 19:08:10 +0000 (19:08 +0000)]
[lsan] one more test fix to please the Debian Sid bot (this time, confirmed on the proper machine). Apparently, newer glibc uses slightly more stack

llvm-svn: 279768

8 years agoReuse an SDLoc throughout a function. NFC.
Michael Kuperstein [Thu, 25 Aug 2016 18:50:56 +0000 (18:50 +0000)]
Reuse an SDLoc throughout a function. NFC.

llvm-svn: 279767

8 years agoRefactor to remove the assumption that we know the name of the module we're emitting...
Richard Smith [Thu, 25 Aug 2016 18:26:30 +0000 (18:26 +0000)]
Refactor to remove the assumption that we know the name of the module we're emitting at the point when we create a PCHGenerator (with the C++ modules TS, we find that out part way through parsing the input).

llvm-svn: 279766

8 years agoOmit column info for CodeView by default
Adrian McCarthy [Thu, 25 Aug 2016 18:24:35 +0000 (18:24 +0000)]
Omit column info for CodeView by default

Clang tracks only start columns, not start-end ranges. CodeView allows for that, but the VS debugger doesn't handle anything less than a complete range well--it either highlights the wrong part of a statement or truncates source lines in the assembly view. It's better to have no column information at all.

So by default, we'll omit the column information for CodeView targeting Windows.

Since the column info is still useful for sanitizers, I've promoted -gcolumn-info (and -gno-column-info) to a CoreOption and added a couple tests to make sure that works for clang-cl.

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

llvm-svn: 279765

8 years ago[MS] Pass non-trivially-copyable objects indirectly on Windows ARM
Reid Kleckner [Thu, 25 Aug 2016 18:23:28 +0000 (18:23 +0000)]
[MS] Pass non-trivially-copyable objects indirectly on Windows ARM

This isn't exactly what MSVC does, unfortunately. MSVC does not pass
objects with destructors but no copy constructors by address. More ARM
expertise is required to really understand what should be done here.

Fixes PR29136.

llvm-svn: 279764

8 years agoFollowon to r279744. Find the other exception types and make __throw_XXX routines...
Marshall Clow [Thu, 25 Aug 2016 17:47:09 +0000 (17:47 +0000)]
Followon to r279744. Find the other exception types and make __throw_XXX routines (and call them).  Remove the generic __libcpp_throw routine, since no one uses it anymore.

llvm-svn: 279763

8 years agoGlobalISel: add missing type to G_UADDE instructions
Tim Northover [Thu, 25 Aug 2016 17:37:44 +0000 (17:37 +0000)]
GlobalISel: add missing type to G_UADDE instructions

llvm-svn: 279762

8 years agoGlobalISel: mark overflow bit of overflow ops legal.
Tim Northover [Thu, 25 Aug 2016 17:37:41 +0000 (17:37 +0000)]
GlobalISel: mark overflow bit of overflow ops legal.

It's expected this will map to NZCV register class and be properly selectable.

llvm-svn: 279761

8 years agoGlobalISel: mark simple ops legal even on types < 32-bit.
Tim Northover [Thu, 25 Aug 2016 17:37:39 +0000 (17:37 +0000)]
GlobalISel: mark simple ops legal even on types < 32-bit.

The 32-bit variants of these operations don't depend on the bits not being
operated on, so they also naturally model operations narrower than the actual
register width.

llvm-svn: 279760

8 years agoGlobalISel: mark pointer constants as legal on AArch64.
Tim Northover [Thu, 25 Aug 2016 17:37:35 +0000 (17:37 +0000)]
GlobalISel: mark pointer constants as legal on AArch64.

llvm-svn: 279759

8 years agoGlobalISel: perform multi-step legalization
Tim Northover [Thu, 25 Aug 2016 17:37:32 +0000 (17:37 +0000)]
GlobalISel: perform multi-step legalization

llvm-svn: 279758

8 years agoGlobalISel: mark small extends as legal on AArch64
Tim Northover [Thu, 25 Aug 2016 17:37:25 +0000 (17:37 +0000)]
GlobalISel: mark small extends as legal on AArch64

llvm-svn: 279757

8 years agoHooking up a check-all target for the runtimes projects
Chris Bieneman [Thu, 25 Aug 2016 17:18:41 +0000 (17:18 +0000)]
Hooking up a check-all target for the runtimes projects

llvm-svn: 279756

8 years ago[X86] 512-bit VPAVG requires AVX512BW
Michael Kuperstein [Thu, 25 Aug 2016 17:17:46 +0000 (17:17 +0000)]
[X86] 512-bit VPAVG requires AVX512BW

Fix VPAVG detection to require AVX512BW, not AVX512F for 512-bit widths,
and change associated asserts to assert in the right direction...

This fixes PR29111.

llvm-svn: 279755

8 years ago[Sema][Comments] Add support for TypeAliasTemplate
Bruno Cardoso Lopes [Thu, 25 Aug 2016 17:09:33 +0000 (17:09 +0000)]
[Sema][Comments] Add support for TypeAliasTemplate

Emit proper diagnostics when -Wdocumentation is used with constructs such as:

  template<typename T>
  using fn = int(T aaa, int ccc);

Previously clang wouldn't recognize the function and complain with
'comment that is not attached to a function declaration'.

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

rdar://problem/27300695

llvm-svn: 279754

8 years agodfsan: Enable 48-bit VMA support on aarch64
Adhemerval Zanella [Thu, 25 Aug 2016 17:07:43 +0000 (17:07 +0000)]
dfsan: Enable 48-bit VMA support on aarch64

This patch adds 48-bits VMA support for msan on aarch64. As current
mappings for aarch64, 48-bit VMA also supports PIE executable.

Tested on 39 and 48-bit VMA kernels on aarch64.

llvm-svn: 279753

8 years agomsan: Enable 48-bit VMA support on aarch64
Adhemerval Zanella [Thu, 25 Aug 2016 17:05:56 +0000 (17:05 +0000)]
msan: Enable 48-bit VMA support on aarch64

This patch adds 48-bits VMA support for msan on aarch64. As current
mappings for aarch64, 48-bit VMA also supports PIE executable. The
48-bits segments only cover the usual PIE/default segments plus some
more segments (262144GB total, 0.39% total VMA). Memory avaliability
can be increase by adding multiple application segments like 39 and
42 mapping (some mappings were added on this patch as well).

Tested on 39 and 48-bit VMA kernels on aarch64.

llvm-svn: 279752

8 years ago[X86][SSE] INSERTPS is only combined on v4f32 types. NFCI.
Simon Pilgrim [Thu, 25 Aug 2016 17:02:00 +0000 (17:02 +0000)]
[X86][SSE] INSERTPS is only combined on v4f32 types. NFCI.

llvm-svn: 279751

8 years ago[Hexagon] Remove extraneous debug output from HexagonCopyToCombine.cpp
Ron Lieberman [Thu, 25 Aug 2016 16:46:09 +0000 (16:46 +0000)]
[Hexagon] Remove extraneous debug output from HexagonCopyToCombine.cpp
BB# ...

llvm-svn: 279750

8 years ago[UNROLL] Postpone ScalarEvolution::forgetLoop after TripCountSC is expanded
Wei Mi [Thu, 25 Aug 2016 16:17:18 +0000 (16:17 +0000)]
[UNROLL] Postpone ScalarEvolution::forgetLoop after TripCountSC is expanded
when unroll runtime iteration loop.

In llvm::UnrollRuntimeLoopRemainder, if the loop to be unrolled is the inner
loop inside a loop nest, the scalar evolution needs to be dropped for its
parent loop which is done by ScalarEvolution::forgetLoop. However, we can
postpone forgetLoop to the end of UnrollRuntimeLoopRemainder so TripCountSC
expansion can still reuse existing value.

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

llvm-svn: 279748

8 years ago[builtins] Make sure builtin compile tests respect CMAKE_C_COMPILER_TARGET
Francis Ricci [Thu, 25 Aug 2016 16:15:45 +0000 (16:15 +0000)]
[builtins] Make sure builtin compile tests respect CMAKE_C_COMPILER_TARGET

Summary:
Since we generate the compiler invocation on our own, we need to
manually add -target if CMAKE_C_COMPILER_TARGET has been specified.

Reviewers: compnerd, beanz

Subscribers: llvm-commits

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

llvm-svn: 279747

8 years agoRemove duplicate inline
Marshall Clow [Thu, 25 Aug 2016 15:56:55 +0000 (15:56 +0000)]
Remove duplicate inline

llvm-svn: 279746

8 years agoFix line endings
Simon Pilgrim [Thu, 25 Aug 2016 15:45:27 +0000 (15:45 +0000)]
Fix line endings

llvm-svn: 279745

8 years agoAdd an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type...
Marshall Clow [Thu, 25 Aug 2016 15:09:01 +0000 (15:09 +0000)]
Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled.  Reviewed as: https://reviews.llvm.org/D23855.

llvm-svn: 279744

8 years agoQuery llvm-config to get system libs required for linking.
Michael Kruse [Thu, 25 Aug 2016 14:58:29 +0000 (14:58 +0000)]
Query llvm-config to get system libs required for linking.

Remove the unused function get_system_libs. Instead, run
'llvm-config --system-libs' to determine which libraries are required in
addition LLVM's for linking an executable. At the moment these are the unittests
that link to gtest and transitively depend on these system libs.

llvm-svn: 279743

8 years agoAdd comment for querying --libdir. NFC.
Michael Kruse [Thu, 25 Aug 2016 14:43:04 +0000 (14:43 +0000)]
Add comment for querying --libdir. NFC.

llvm-svn: 279742

8 years agoFix offload bundler test to support Windows new lines.
Samuel Antao [Thu, 25 Aug 2016 14:35:20 +0000 (14:35 +0000)]
Fix offload bundler test to support Windows new lines.

llvm-svn: 279741

8 years agoDo not build unittests by default.
Michael Kruse [Thu, 25 Aug 2016 14:33:44 +0000 (14:33 +0000)]
Do not build unittests by default.

Only build them for check-polly and check-polly-unittests in out-of-tree builds.

In LLVM, this behaviour is controlled with LLVM_BUILD_TESTS. Polly out-of-tree
does not have such a flag.

llvm-svn: 279740

8 years ago[Hexagon] vector store print tracing.
Ron Lieberman [Thu, 25 Aug 2016 13:35:48 +0000 (13:35 +0000)]
[Hexagon] vector store print tracing.

Add vector store print tracing option for hexagon vector instructions.

https://reviews.llvm.org/D23870

llvm-svn: 279739

8 years agoAdd missing words to wanrning.
Michael Kruse [Thu, 25 Aug 2016 13:29:26 +0000 (13:29 +0000)]
Add missing words to wanrning.

llvm-svn: 279738

8 years agoAdd warning for FORCE_STATIC libraries when using BUILD_SHARED_LIBS.
Michael Kruse [Thu, 25 Aug 2016 13:21:53 +0000 (13:21 +0000)]
Add warning for FORCE_STATIC libraries when using BUILD_SHARED_LIBS.

We cannot built ISL as shared object because we build it with
-fvisibility=hidden; The created shared object would have no accessible symbols.

The reason it is built with -fvisibility=hidden is because opt/clang might load
other libraries that have ISL embedded and whose' symbols would conflict with
Polly's private ISL. This could happend with Draggonegg.

In the future we might instead statically link PollyISL into the Polly shared
object to avoid installing the static library.

Requested-by: Vedran Miletic <vedran@miletic.net>
See-also: llvm.org/PR27306
llvm-svn: 279737

8 years ago[X86][AVX] Improved AVX512F/AVX512VL SubVectorBroadcast tests
Simon Pilgrim [Thu, 25 Aug 2016 12:50:13 +0000 (12:50 +0000)]
[X86][AVX] Improved AVX512F/AVX512VL SubVectorBroadcast tests

llvm-svn: 279736

8 years ago[X86][AVX] Provide SubVectorBroadcast fallback if load fold fails (PR29133)
Simon Pilgrim [Thu, 25 Aug 2016 12:45:16 +0000 (12:45 +0000)]
[X86][AVX] Provide SubVectorBroadcast fallback if load fold fails (PR29133)

Fix for PR29133, matching the approach that was taken for AVX1 scalar broadcasts.

llvm-svn: 279735

8 years agoIntroduce unittests.
Michael Kruse [Thu, 25 Aug 2016 12:36:15 +0000 (12:36 +0000)]
Introduce unittests.

Add the infrastructure for unittests to Polly and two simple tests for
conversion between isl_val and APInt. In addition, a build target
check-polly-unittests is added to run only the unittests but not the regression
tests.

Clang's unittest mechanism served as as a blueprint which then was adapted to
Polly.

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

llvm-svn: 279734

8 years agoUse configure_lit_site_cfg instead of configure_file.
Michael Kruse [Thu, 25 Aug 2016 12:03:33 +0000 (12:03 +0000)]
Use configure_lit_site_cfg instead of configure_file.

configure_lit_site_cfg defines some more parameters that are used in
lit.site.cfg.in. configure_file would leave those empty. These additional
definitions seem to be unimportant for regression tests, but unittests do not
work without them.

In case of out-of-tree builds, define the additional parameters with default
values. These may not take all configuration parameters into account, as
configure_lit_site_cfg would.

llvm-svn: 279733

8 years agoGVN-hoist: fix hoistingFromAllPaths for loops (PR29034)
Sebastian Pop [Thu, 25 Aug 2016 11:55:47 +0000 (11:55 +0000)]
GVN-hoist: fix hoistingFromAllPaths for loops (PR29034)

It is invalid to hoist stores or loads if they are not executed on all paths
from the hoisting point to the exit of the function. In the testcase, there are
paths in the loop that do not execute the stores or the loads, and so hoisting
them within the loop is unsafe.

The problem is that the current implementation of hoistingFromAllPaths is
incomplete: it walks all blocks dominated by the hoisting point, and does not
return false when the loop contains a path on which the hoisted ld/st is
not executed.

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

llvm-svn: 279732

8 years agoRemove trailing WS [NFC]
Aditya Kumar [Thu, 25 Aug 2016 11:52:38 +0000 (11:52 +0000)]
Remove trailing WS [NFC]

llvm-svn: 279731

8 years agoAdd LLVM libdir to library search path in out-of-tree builds.
Michael Kruse [Thu, 25 Aug 2016 11:28:52 +0000 (11:28 +0000)]
Add LLVM libdir to library search path in out-of-tree builds.

This previously was not required because in an out-of-tree build Polly would
only build libraries (LLVMPolly, libPolly, libPollyISL, libPollyPPCG), but no
executables where the libraries would be linked to. This will change when adding
unittests in a follow-up commit.

llvm-svn: 279730

8 years agoRemoved trailing whitespace. NFC.
George Rimar [Thu, 25 Aug 2016 10:39:04 +0000 (10:39 +0000)]
Removed trailing whitespace. NFC.

llvm-svn: 279729

8 years agoAlso warn if llvm-lit is not available.
Michael Kruse [Thu, 25 Aug 2016 10:35:22 +0000 (10:35 +0000)]
Also warn if llvm-lit is not available.

The program 'llvm-lit', like 'not' and 'FileCheck' are necessary for running
check-polly. Warn of any of the three is not in LLVM_INSTALL_ROOT/bin directory.

llvm-svn: 279728

8 years agoclang-format: [JS] nested and tagged template strings.
Martin Probst [Thu, 25 Aug 2016 10:13:21 +0000 (10:13 +0000)]
clang-format: [JS] nested and tagged template strings.

JavaScript template strings can be nested arbitrarily:

    foo = `text ${es.map(e => { return `<${e}>`; })} text`;

This change lexes nested template strings using a stack of lexer states to
correctly switch back to template string lexing on closing braces.

Also, reuse the same stack for the token-stashed logic.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 279727

8 years ago[ELF] - Implemented --oformat binary option.
George Rimar [Thu, 25 Aug 2016 09:05:47 +0000 (09:05 +0000)]
[ELF] - Implemented --oformat binary option.

-oformat output-format
`-oformat' option can be used to specify the binary format for the output object file.

Patch implements binary format output type.

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

llvm-svn: 279726

8 years agogdb-remote: Make the sequence mutex non-recursive
Pavel Labath [Thu, 25 Aug 2016 08:34:57 +0000 (08:34 +0000)]
gdb-remote: Make the sequence mutex non-recursive

Summary:
This is a preparatory commit for D22914, where I'd like to replace this mutex by an R/W lock
(which is also not recursive). This required a couple of changes:
- The only caller of Read/WriteRegister, GDBRemoteRegisterContext class, was already acquiring
  the mutex, so these functions do not need to. All functions which now do not take a lock, take
  an lock argument instead, to remind the caller of this fact.
- GetThreadSuffixSupported() was being called from locked and unlocked contexts (including
  contexts where the process was running, and the call would fail if it did not have the result
  cached). I have split this into two functions, one which computes the thread suffix support and
  caches it (this one always takes the lock), and another, which returns the cached value (and
  never needs to take the lock). This feels quite natural as ProcessGdbRemote was already
  pre-caching this value at the start.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 279725

8 years agoFix warnings preventing copy elision.
Pavel Labath [Thu, 25 Aug 2016 08:22:14 +0000 (08:22 +0000)]
Fix warnings preventing copy elision.

Summary:
Moving a temporary object prevents copy elision, which is exactly
what clang points out by warning about this pattern.

The fix is simply removal of std::move applied to temporary objects.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D23825
Author: Taras Tsugrii <ttsugrii@fb.com>

llvm-svn: 279724

8 years agoamdgcn: Fix return type of get_num_groups
Matt Arsenault [Thu, 25 Aug 2016 07:31:40 +0000 (07:31 +0000)]
amdgcn: Fix return type of get_num_groups

llvm-svn: 279723

8 years agoFix memory leaks in clang-offload-bundler
Vitaly Buka [Thu, 25 Aug 2016 07:21:34 +0000 (07:21 +0000)]
Fix memory leaks in clang-offload-bundler

Summary:
1. Pair removed from StringMap was not destroyed
2. ObjectFile had no owner

Reviewers: sfantao

Subscribers: llvm-commits

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

llvm-svn: 279722

8 years ago[X86] Simplify getOperandBias as a bit. NFC
Craig Topper [Thu, 25 Aug 2016 04:16:10 +0000 (04:16 +0000)]
[X86] Simplify getOperandBias as a bit. NFC

There's no reason for it to return a signed type. Just return the operand bias in each if instead of starting from 0 and adding in the 'if'.

llvm-svn: 279720

8 years ago[X86] Fix indentation per coding standards. NFC
Craig Topper [Thu, 25 Aug 2016 04:16:08 +0000 (04:16 +0000)]
[X86] Fix indentation per coding standards. NFC

llvm-svn: 279719

8 years agoFixed comment
Vitaly Buka [Thu, 25 Aug 2016 03:44:36 +0000 (03:44 +0000)]
Fixed comment

llvm-svn: 279718

8 years ago[asan] Disable CreateSigAltStack from Unix/Signals.inc for asan builds
Vitaly Buka [Thu, 25 Aug 2016 03:32:49 +0000 (03:32 +0000)]
[asan] Disable CreateSigAltStack from Unix/Signals.inc for asan builds

Summary: Asan fails to UnsetAlternateSignalStack if it set by Unix/Signals.inc

Reviewers: kcc

Subscribers: llvm-commits

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

llvm-svn: 279717

8 years agoIf the user has specified target.memory-module-load-level 'minimal'
Jason Molenda [Thu, 25 Aug 2016 02:33:09 +0000 (02:33 +0000)]
If the user has specified target.memory-module-load-level 'minimal'
and we couldn't find a dyld binary on the debug system, override
that setting and read dyld out of memory - we need to put an
internal breakpoint on dyld to register binaries being loaded or
unloaded; the debugger won't work right without dyld symbols.

<rdar://problem/27857025>

llvm-svn: 279704

8 years agoMake buildbots happy.
George Burgess IV [Thu, 25 Aug 2016 02:15:54 +0000 (02:15 +0000)]
Make buildbots happy.

"warning: extra ‘;’ [-Wpedantic]"

llvm-svn: 279703

8 years agoRemove a pointless LLVM_CONSTEXPR. NFC.
George Burgess IV [Thu, 25 Aug 2016 01:54:37 +0000 (01:54 +0000)]
Remove a pointless LLVM_CONSTEXPR. NFC.

llvm-svn: 279702

8 years agoTailDuplication: Don't pass MMI separately from MF. NFC
Kyle Butt [Thu, 25 Aug 2016 01:37:07 +0000 (01:37 +0000)]
TailDuplication: Don't pass MMI separately from MF. NFC

MMI must match the function passed, and MF has a handle on MMI. Use that instead
of accepting it as separate argument. No Functional Change.

llvm-svn: 279701

8 years agoTailDuplication: Save MF and reduce number of parameters. NFC
Kyle Butt [Thu, 25 Aug 2016 01:37:03 +0000 (01:37 +0000)]
TailDuplication: Save MF and reduce number of parameters. NFC

Save the function in the class, and then don't pass it around. This reduces the
number of parameters and makes calls to member functions simpler.
No Functional Change.

llvm-svn: 279700

8 years agoUpdate a comment.
George Burgess IV [Thu, 25 Aug 2016 01:29:55 +0000 (01:29 +0000)]
Update a comment.

r279696, which changed `LLVM_CONSTEXPR AliasAttr` to `const AliasAttr`,
made this comment make less sense.

llvm-svn: 279699

8 years agoMachineFunctionProperties/MIRParser: Rename AllVRegsAllocated->NoVRegs, compute it
Matthias Braun [Thu, 25 Aug 2016 01:27:13 +0000 (01:27 +0000)]
MachineFunctionProperties/MIRParser: Rename AllVRegsAllocated->NoVRegs, compute it

Rename AllVRegsAllocated to NoVRegs. This avoids the connotation of
running after register and simply describes that no vregs are used in
a machine function. With that we can simply compute the property and do
not need to dump/parse it in .mir files.

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

llvm-svn: 279698

8 years ago[libFuzzer] simplify the code, NFC
Kostya Serebryany [Thu, 25 Aug 2016 01:25:03 +0000 (01:25 +0000)]
[libFuzzer] simplify the code, NFC

llvm-svn: 279697

8 years agoMake some LLVM_CONSTEXPR variables const. NFC.
George Burgess IV [Thu, 25 Aug 2016 01:05:08 +0000 (01:05 +0000)]
Make some LLVM_CONSTEXPR variables const. NFC.

This patch changes LLVM_CONSTEXPR variable declarations to const
variable declarations, since LLVM_CONSTEXPR expands to nothing if the
current compiler doesn't support constexpr. In all of the changed
cases, it looks like the code intended the variable to be const instead
of sometimes-constexpr sometimes-not.

llvm-svn: 279696

8 years agoFix some Clang-tidy modernize-use-using and Include What You Use warnings; other...
Eugene Zelenko [Thu, 25 Aug 2016 00:45:04 +0000 (00:45 +0000)]
Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes.

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

llvm-svn: 279695

8 years agoLazily load the ContextDecl for a lambda's DefinitionData, to fix a
Richard Smith [Thu, 25 Aug 2016 00:34:00 +0000 (00:34 +0000)]
Lazily load the ContextDecl for a lambda's DefinitionData, to fix a
deserialization cycle caused by the ContextDecl recursively importing members
of the lambda's closure type.

llvm-svn: 279694

8 years ago[Profile] Propagate branch metadata properly in instcombine
Xinliang David Li [Thu, 25 Aug 2016 00:26:32 +0000 (00:26 +0000)]
[Profile] Propagate branch metadata properly in instcombine

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

llvm-svn: 279693

8 years agoStrip opencl.ocl.version metadata
Matt Arsenault [Thu, 25 Aug 2016 00:25:10 +0000 (00:25 +0000)]
Strip opencl.ocl.version metadata

This should be uniqued when linking, but right now it creates
a lot of metadata spam listing the same version. This should also
probably be reporting the compiled version of the user program,
which may differ from the library. Currently the library IR files report
1.0 while 1.1/1.2 are the default for user programs.

llvm-svn: 279692

8 years ago[Sema][Comments] Factor out function type loc logic. NFCI
Bruno Cardoso Lopes [Thu, 25 Aug 2016 00:22:08 +0000 (00:22 +0000)]
[Sema][Comments] Factor out function type loc logic. NFCI

This is in prepatation for @param TypeAliasTemplate support.

llvm-svn: 279691

8 years agoTest: Add REQUIRES: asserts to test that now requires stats.
Kyle Butt [Thu, 25 Aug 2016 00:06:52 +0000 (00:06 +0000)]
Test: Add REQUIRES: asserts to test that now requires stats.

Test was modified in r279670

llvm-svn: 279690

8 years agoRewrite the GetFileInSDK methods in PlatformRemoteiOS,
Jason Molenda [Wed, 24 Aug 2016 23:46:48 +0000 (23:46 +0000)]
Rewrite the GetFileInSDK methods in PlatformRemoteiOS,
PlatformRemoteAppleWatch, PlatformRemoteAppleTV and remove the
GetFileInSDKRoot method from those classes.

The rewrite uses the more modern FileSpec etc API to simplify,
and handles the case where an SDK Root is given to lldb with
the "/Symbols" directory name already appended.  The new version
will try appending "/Symbols" and "/Symbols.Internal" to the
sdk root directories, and will also try appending nothing to
the sdk root directory in case it's handed such an sdkroot.

<rdar://problem/28000054>

llvm-svn: 279688

8 years agoDebugInfo: Let -gsplit-dwarf and -gmlt compose if -fno-split-dwarf-inlining is used
David Blaikie [Wed, 24 Aug 2016 23:22:36 +0000 (23:22 +0000)]
DebugInfo: Let -gsplit-dwarf and -gmlt compose if -fno-split-dwarf-inlining is used

If the inline info is not duplicated into the skeleton CU, then there's
value in using -gsplit-dwarf and -gmlt together (to keep all those extra
subprograms out of the skeleton CU, while also producing smaller .dwo
files)

llvm-svn: 279687

8 years ago[libFuzzer] make a test more deterministic
Kostya Serebryany [Wed, 24 Aug 2016 23:10:17 +0000 (23:10 +0000)]
[libFuzzer] make a test more deterministic

llvm-svn: 279686

8 years ago[InstCombine] move foldICmpDivConstConst() contents to foldICmpDivConstant(); NFCI
Sanjay Patel [Wed, 24 Aug 2016 23:03:36 +0000 (23:03 +0000)]
[InstCombine] move foldICmpDivConstConst() contents to foldICmpDivConstant(); NFCI

There was no logic in foldICmpDivConstant, so no need for a separate function.
The code is directly copy/pasted, so further cleanups to follow.

llvm-svn: 279685

8 years agoThe patch improves ValueTracking on left shift with nsw flag.
Evgeny Stupachenko [Wed, 24 Aug 2016 23:01:33 +0000 (23:01 +0000)]
The patch improves ValueTracking on left shift with nsw flag.

Summary:
The patch fixes PR28946.

Reviewers: majnemer, sanjoy

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

From: Li Huang
llvm-svn: 279684

8 years ago[WebAssembly] Change a comment line
Heejin Ahn [Wed, 24 Aug 2016 22:53:00 +0000 (22:53 +0000)]
[WebAssembly] Change a comment line

Test for commit access.

llvm-svn: 279683

8 years agoMIRYamlMapping cleanup
Matthias Braun [Wed, 24 Aug 2016 22:41:46 +0000 (22:41 +0000)]
MIRYamlMapping cleanup

Missed two lines got lost when cherry picking old commits to master.

llvm-svn: 279682

8 years ago[Hexagon] Check for block end when skipping debug instructions
Krzysztof Parzyszek [Wed, 24 Aug 2016 22:36:35 +0000 (22:36 +0000)]
[Hexagon] Check for block end when skipping debug instructions

llvm-svn: 279681

8 years agoMIRParser/MIRPrinter: Compute HasInlineAsm instead of printing/parsing it
Matthias Braun [Wed, 24 Aug 2016 22:34:06 +0000 (22:34 +0000)]
MIRParser/MIRPrinter: Compute HasInlineAsm instead of printing/parsing it

llvm-svn: 279680

8 years agoMissed a test in my last commit
Matthias Braun [Wed, 24 Aug 2016 22:32:11 +0000 (22:32 +0000)]
Missed a test in my last commit

llvm-svn: 279679

8 years ago[Hexagon] Change insertion of expand-condsets pass to avoid memory leaks
Krzysztof Parzyszek [Wed, 24 Aug 2016 22:27:36 +0000 (22:27 +0000)]
[Hexagon] Change insertion of expand-condsets pass to avoid memory leaks

llvm-svn: 279678

8 years ago[InstCombine] use m_APInt to allow icmp eq/ne (shr X, C2), C folds for splat constant...
Sanjay Patel [Wed, 24 Aug 2016 22:22:06 +0000 (22:22 +0000)]
[InstCombine] use m_APInt to allow icmp eq/ne (shr X, C2), C folds for splat constant vectors

llvm-svn: 279677