platform/upstream/llvm.git
7 years agoDelete clang-completion-mode.el.
Manuel Klimek [Tue, 11 Oct 2016 09:25:34 +0000 (09:25 +0000)]
Delete clang-completion-mode.el.

It has been unmaintained for a while (last change was more than four
years ago), and it appears not widely used.
By now there are multiple well-maintained alternatives (emacs-ycmd,
atuo-complete-clang), and if users try to make this work they'll likely
have a bad user experience.

Reasoning and problems pointed out by Philipp Stephani.

llvm-svn: 283864

7 years agoclang-include-fixer.el: Don't prompt the user about killing clang-include-fixer processes
Manuel Klimek [Tue, 11 Oct 2016 09:21:20 +0000 (09:21 +0000)]
clang-include-fixer.el: Don't prompt the user about killing clang-include-fixer processes

By default, Emacs prompts the user when killing processes on exit. This is useful for stateful processes such as interactive shells. However, clang-include-fixer processes are stateless; the only effect of killing them is to cancel a clang-include-fixer operation. Therefore prompting the user is just a nuisance.

Patch by Philipp Stephani.

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

llvm-svn: 283863

7 years ago[AArch64] Allow label arithmetic with add/sub/cmp
Diana Picus [Tue, 11 Oct 2016 09:17:47 +0000 (09:17 +0000)]
[AArch64] Allow label arithmetic with add/sub/cmp

Allow instructions such as 'cmp w0, #(end - start)' by folding the
expression into a constant. For ELF, we fold only if the symbols are in
the same section. For MachO, we fold if the expression contains only
symbols that are not linker visible.

Fixes https://llvm.org/bugs/show_bug.cgi?id=18920

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

llvm-svn: 283862

7 years agoMake Emacs libraries compatible with Emacs 24.
Manuel Klimek [Tue, 11 Oct 2016 09:15:10 +0000 (09:15 +0000)]
Make Emacs libraries compatible with Emacs 24.

Emacs 24 doesn't have format-message, fall back to format in that case.

Patch by Philipp Stephani.

llvm-svn: 283861

7 years agoFix formatting in findRegisterUseOperandIdx. NFC.
Fraser Cormack [Tue, 11 Oct 2016 09:09:21 +0000 (09:09 +0000)]
Fix formatting in findRegisterUseOperandIdx. NFC.

llvm-svn: 283860

7 years ago[ELF] - Fixed assertion fail when symbol table has invalid sh_info value.
George Rimar [Tue, 11 Oct 2016 09:07:14 +0000 (09:07 +0000)]
[ELF] - Fixed assertion fail when symbol table has invalid sh_info value.

This part was splitted from D25016.

When sh_info value was set in the way that non-local symbol was treated as local, lld
was asserting, patch fixes that.

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

llvm-svn: 283859

7 years agoReverted r283740 [Object/ELF] - Do not crash on invalid Header->e_shoff value.
George Rimar [Tue, 11 Oct 2016 08:12:27 +0000 (08:12 +0000)]
Reverted r283740 [Object/ELF] - Do not crash on invalid Header->e_shoff value.

Bot does not like it: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/17075

/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/test/Object/invalid.test:70:32: error: expected string not found in input
INVALID-SEC-ADDRESS-ALIGNMENT: Invalid address alignment of section headers
                               ^
<stdin>:1:1: note: scanning from here
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/Object/ELF.h:412:7: runtime error: upcast of misaligned address 0x000002d8b899 for type 'llvm::object::Elf_Shdr_Impl<llvm::object::ELFType<llvm::support::endianness::little, true> >', which requires 2 byte alignment
^
<stdin>:1:125: note: possible intended match here
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/Object/ELF.h:412:7: runtime error: upcast of misaligned address 0x000002d8b899 for type 'llvm::object::Elf_Shdr_Impl<llvm::object::ELFType<llvm::support::endianness::little, true> >', which requires 2 byte alignment

llvm-svn: 283858

7 years agoRevert "Codegen: Tail-duplicate during placement."
Daniel Jasper [Tue, 11 Oct 2016 07:36:11 +0000 (07:36 +0000)]
Revert "Codegen: Tail-duplicate during placement."

This reverts commit r283842.

test/CodeGen/X86/tail-dup-repeat.ll causes and llc crash with our
internal testing. I'll share a link with you.

llvm-svn: 283857

7 years agoTurn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)
Mehdi Amini [Tue, 11 Oct 2016 07:31:29 +0000 (07:31 +0000)]
Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)

llvm-svn: 283856

7 years agoUse LLVM_CONSTEXPR to appease MSVC2013 (fixup for r283854)
Mehdi Amini [Tue, 11 Oct 2016 07:29:43 +0000 (07:29 +0000)]
Use LLVM_CONSTEXPR to appease MSVC2013 (fixup for r283854)

llvm-svn: 283855

7 years agoMake RandomNumberGenerator compatible with <random>
Mehdi Amini [Tue, 11 Oct 2016 07:13:01 +0000 (07:13 +0000)]
Make RandomNumberGenerator compatible with <random>

LLVM's RandomNumberGenerator wasn't compatible with
the random distribution from <random>.

Fixes PR25105

Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu>

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

llvm-svn: 283854

7 years agoExplicitly ignore return code in test for test systems that use pipefail
Daniel Jasper [Tue, 11 Oct 2016 06:13:18 +0000 (06:13 +0000)]
Explicitly ignore return code in test for test systems that use pipefail

llvm-svn: 283853

7 years agoTune isHotFunction/isColdFunction
Dehao Chen [Tue, 11 Oct 2016 05:19:00 +0000 (05:19 +0000)]
Tune isHotFunction/isColdFunction

Summary: This patch sets function as hot if function's entry count is hot/cold.

Reviewers: eraman, davidxl

Subscribers: llvm-commits

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

llvm-svn: 283852

7 years agoFix warning; NFC
Matthias Braun [Tue, 11 Oct 2016 04:32:03 +0000 (04:32 +0000)]
Fix warning; NFC

llvm-svn: 283851

7 years agoMIRParser: generic register operands with types
Matthias Braun [Tue, 11 Oct 2016 04:22:29 +0000 (04:22 +0000)]
MIRParser: generic register operands with types

This should fix the fallout of r283848.

llvm-svn: 283850

7 years agoAdd a second, more complicated, arm64 example program to
Jason Molenda [Tue, 11 Oct 2016 03:44:48 +0000 (03:44 +0000)]
Add a second, more complicated, arm64 example program to
the arm64 assembly unwind tests.

llvm-svn: 283849

7 years agoMIRParser: Rewrite register info initialization; mostly NFC
Matthias Braun [Tue, 11 Oct 2016 03:13:01 +0000 (03:13 +0000)]
MIRParser: Rewrite register info initialization; mostly NFC

This changes MachineRegisterInfo to be initializes after parsing all
instructions. This is in preparation for upcoming commits that allow the
register class specification on the operand or deduce them from the
MCInstrDesc.

This commit removes the unused feature of having nonsequential register
numbers. This was confusing anyway as the vreg numbers would be
different after parsing when you had "holes" in your numbering.

This patch also introduces the concept of an incomplete virtual
register. An incomplete virtual register may be used during .mir parsing
to construct MachineOperands without knowing the exact register class
(or register bank) yet.

NFC except for some error messages.

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

llvm-svn: 283848

7 years agoAdd a first unit test for the arm64 instruction profiled unwind
Jason Molenda [Tue, 11 Oct 2016 02:24:00 +0000 (02:24 +0000)]
Add a first unit test for the arm64 instruction profiled unwind
plan generator.

Fix a small bug in EmulateInstructionARM64::GetFramePointerRegister
which was returning the stack pointer reg instead of fp, prevented
the unwinder from recognizing the switch to using the fp in a
function. (<rdar://problem/28663117>)

Add a new eContextRestoreStackPointer context hint so that the arm64
emulator can flag when the frame pointer value is copied back in to
the stack pointer and that should be used to compute the canonical
frame address again in an epilogue sequence.  (<rdar://problem/28704862>)

Small changes to UnwindAssemblyInstEmulation to have a method we can
call without a live process/thread/etc for unit tests.

<rdar://problem/28663117>
<rdar://problem/28704862>
<rdar://problem/28509178>

llvm-svn: 283847

7 years agoFixing the bug number for darwin on this failure.
Jim Ingham [Tue, 11 Oct 2016 01:53:43 +0000 (01:53 +0000)]
Fixing the bug number for darwin on this failure.

llvm-svn: 283843

7 years agoCodegen: Tail-duplicate during placement.
Kyle Butt [Tue, 11 Oct 2016 01:20:33 +0000 (01:20 +0000)]
Codegen: Tail-duplicate during placement.

The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

Issue from previous rollback fixed, and a new test was added for that
case as well. Issue was worklist/scheduling/taildup issue in layout.

Issue from 2nd rollback fixed, with 2 additional tests. Issue was
tail merging/loop info/tail-duplication causing issue with loops that share
a header block.

Issue with early tail-duplication of blocks that branch to a fallthrough
predecessor fixed with test case: tail-dup-branch-to-fallthrough.ll

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

llvm-svn: 283842

7 years ago[libFuzzer] implement value profile for switch, increase the size of the PCs array...
Kostya Serebryany [Tue, 11 Oct 2016 01:14:41 +0000 (01:14 +0000)]
[libFuzzer] implement value profile for switch, increase the size of the PCs array, make sure we don't overflow it

llvm-svn: 283841

7 years ago[libFuzzer] add switch tests
Kostya Serebryany [Tue, 11 Oct 2016 01:13:32 +0000 (01:13 +0000)]
[libFuzzer] add switch tests

llvm-svn: 283840

7 years agoFixup test/Driver/opt-record.c for nvptx pointer size
Hal Finkel [Tue, 11 Oct 2016 01:05:45 +0000 (01:05 +0000)]
Fixup test/Driver/opt-record.c for nvptx pointer size

On some systems, it looks like nvptx is used instead of nvptx64.

llvm-svn: 283839

7 years ago[RegAllocGreedy] Attempt to split unspillable live intervals
Dylan McKay [Tue, 11 Oct 2016 01:04:36 +0000 (01:04 +0000)]
[RegAllocGreedy] Attempt to split unspillable live intervals

Summary:
Previously, when allocating unspillable live ranges, we would never
attempt to split. We would always bail out and try last ditch graph
recoloring.

This patch changes this by attempting to split all live intervals before
performing recoloring.

This fixes LLVM bug PR14879.

I can't add test cases for any backends other than AVR because none of
them have small enough register classes to trigger the bug.

Reviewers: qcolombet

Subscribers: MatzeB

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

llvm-svn: 283838

7 years agoRevert "Add section header stream to PDB." because it depends on r283823.
Rui Ueyama [Tue, 11 Oct 2016 01:01:40 +0000 (01:01 +0000)]
Revert "Add section header stream to PDB." because it depends on r283823.

The change this patch depends on was reverted.

llvm-svn: 283837

7 years ago[InstCombine] Transform !range metadata to !nonnull when combining loads
David Majnemer [Tue, 11 Oct 2016 01:00:45 +0000 (01:00 +0000)]
[InstCombine] Transform !range metadata to !nonnull when combining loads

When combining an integer load with !range metadata that does not include 0 to a pointer load, make sure emit !nonnull metadata on the newly-created pointer load. This prevents the !nonnull metadata from being dropped during a ptrtoint/inttoptr pair.

This fixes PR30597.

Patch by Ariel Ben-Yehuda!

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

llvm-svn: 283836

7 years agoThis test was failing because /bin/ls is no longer debuggable on OS X.
Jim Ingham [Tue, 11 Oct 2016 00:35:41 +0000 (00:35 +0000)]
This test was failing because /bin/ls is no longer debuggable on OS X.
Add an executable that we can debug.

llvm-svn: 283835

7 years agoAdd an option to save the backend-produced YAML optimization record to a file
Hal Finkel [Tue, 11 Oct 2016 00:26:09 +0000 (00:26 +0000)]
Add an option to save the backend-produced YAML optimization record to a file

The backend now has the capability to save information from optimizations, the
same information that can be used to generate optimization diagnostics but in
machine-consumable form, into an output file. This can be enabled when using
opt (see r282539), and this change enables it when using clang. The idea is
that other tools will be able to consume these files, and perhaps in
combination with the original source code, produce various kinds of
optimization reports for users (and for compiler developers).

We now have at-least two tools that can consume these files:
  * tools/llvm-opt-report
  * utils/opt-viewer

Using the flag -fsave-optimization-record will cause the YAML file to be
generated; the file name will be based on the output file name (if we're using
-c or -S and have an output name), or the input file name. When we're using
CUDA, or some other offloading mechanism, separate files are generated for each
backend target. The output file name can be specified by the user using
-foptimization-record-file=filename.

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

llvm-svn: 283834

7 years ago[Sema] Add explicit move constructor for ExpressionEvaluationContextRecord.
Justin Lebar [Tue, 11 Oct 2016 00:23:53 +0000 (00:23 +0000)]
[Sema] Add explicit move constructor for ExpressionEvaluationContextRecord.

This is needed to keep MSVC 2013 happy.

llvm-svn: 283833

7 years ago[AArch64][InstructionSelector] Teach how to select FP load/store.
Quentin Colombet [Tue, 11 Oct 2016 00:21:14 +0000 (00:21 +0000)]
[AArch64][InstructionSelector] Teach how to select FP load/store.

This patch allows to select 32 and 64-bit FP load and store.

llvm-svn: 283832

7 years ago[AArch64][InstructionSelector] Teach the selector how to handle vector OR.
Quentin Colombet [Tue, 11 Oct 2016 00:21:11 +0000 (00:21 +0000)]
[AArch64][InstructionSelector] Teach the selector how to handle vector OR.

This only adds the support for 64-bit vector OR. Adding more sizes is
not difficult, but it requires a bigger refactoring because ORs work on
any size, not necessarly the ones that match the width of the register
width. Right now, this is not expressed in the legalization, so don't
bother pushing the refactoring yet.

llvm-svn: 283831

7 years agoAligned allocation versus CUDA: make deallocation function preference order
Richard Smith [Tue, 11 Oct 2016 00:21:10 +0000 (00:21 +0000)]
Aligned allocation versus CUDA: make deallocation function preference order
match other CUDA preference orders, per discussion with jlebar. We now model
this in an attempt to match overload resolution as closely as possible:

- First, we throw out all non-callable (due to CUDA host/device mismatch)
  operator delete functions.
- Then we apply sizedness / alignedness preferences based on whether the type
  is overaligned and whether the deallocation function is a member.
- Finally, we use the CUDA callability preference as a tiebreaker.

llvm-svn: 283830

7 years ago[AArch64][MachineLegalizer] Mark v2s32 G_LOAD as legal.
Quentin Colombet [Tue, 11 Oct 2016 00:21:08 +0000 (00:21 +0000)]
[AArch64][MachineLegalizer] Mark v2s32 G_LOAD as legal.

Actually every 64-bit loads are legal, but right now the API does not
offer a simple way to express that.

llvm-svn: 283829

7 years agoRevert r283824 and r283823: Define DbiStreamBuilder::addDbgStream to add stream.
Rui Ueyama [Tue, 11 Oct 2016 00:15:50 +0000 (00:15 +0000)]
Revert r283824 and r283823: Define DbiStreamBuilder::addDbgStream to add stream.

This reverts commit r283824 and r283823 to fix buildbots.

llvm-svn: 283828

7 years ago[Driver][Diagnostics] Make 'show option names' default for driver warnings
Bruno Cardoso Lopes [Tue, 11 Oct 2016 00:01:22 +0000 (00:01 +0000)]
[Driver][Diagnostics] Make 'show option names' default for driver warnings

Currently, driver level warnings do not show option names (e.g. warning:
complain about foo [-Woption-name]) in a diagnostic unless
-fdiagnostics-show-option is explictly specified. OTOH, the driver by
default turn this option on for CC1. Change the logic to show option
names by default in the driver as well.

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

rdar://problem/27300909

llvm-svn: 283827

7 years ago[ThinLTO] Attempt to fix the test (and the bots).
Davide Italiano [Mon, 10 Oct 2016 23:56:13 +0000 (23:56 +0000)]
[ThinLTO] Attempt to fix the test (and the bots).

llvm-svn: 283826

7 years agoAdd section header stream to PDB.
Rui Ueyama [Mon, 10 Oct 2016 23:44:10 +0000 (23:44 +0000)]
Add section header stream to PDB.

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

llvm-svn: 283825

7 years agoFix a bug in DbiStreamBuilder::addDbgStream.
Rui Ueyama [Mon, 10 Oct 2016 23:44:04 +0000 (23:44 +0000)]
Fix a bug in DbiStreamBuilder::addDbgStream.

This feature will be tested in LLD unit tests.

llvm-svn: 283824

7 years agoDefine DbiStreamBuilder::addDbgStream to add stream.
Rui Ueyama [Mon, 10 Oct 2016 23:35:36 +0000 (23:35 +0000)]
Define DbiStreamBuilder::addDbgStream to add stream.

Previously, there is no way to create a stream other than pre-defined
special stream such as DBI or IPI. This patch adds a new method,
addDbgStream, to add a debug stream to a PDB file.

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

llvm-svn: 283823

7 years agoAdding radar number on our end for llvm.org/pr15824.
Jim Ingham [Mon, 10 Oct 2016 23:31:36 +0000 (23:31 +0000)]
Adding radar number on our end for llvm.org/pr15824.

llvm-svn: 283821

7 years agoAdd the related radar on our end for llvm.org/pr15824.
Jim Ingham [Mon, 10 Oct 2016 23:29:01 +0000 (23:29 +0000)]
Add the related radar on our end for llvm.org/pr15824.

llvm-svn: 283820

7 years agoFix clang-tools-extra build after r283815 (Store FileEntry::Filename as a StringRef...
Mehdi Amini [Mon, 10 Oct 2016 23:24:16 +0000 (23:24 +0000)]
Fix clang-tools-extra build after r283815 (Store FileEntry::Filename as a StringRef instead of raw pointer)

llvm-svn: 283819

7 years agoFix issue which cases lit installed with setup.py to not resolve main
Chris Matthews [Mon, 10 Oct 2016 23:22:11 +0000 (23:22 +0000)]
Fix issue which cases lit installed with setup.py to not resolve main

llvm-svn: 283818

7 years ago[LTO] Split the options for ThinLTO jobs and Regular LTO partitions
Davide Italiano [Mon, 10 Oct 2016 23:12:14 +0000 (23:12 +0000)]
[LTO] Split the options for ThinLTO jobs and Regular LTO partitions

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

llvm-svn: 283817

7 years agoFix llvm-lit.in corresponding to r283710.
NAKAMURA Takumi [Mon, 10 Oct 2016 23:02:42 +0000 (23:02 +0000)]
Fix llvm-lit.in corresponding to r283710.

  Traceback (most recent call last):
    File "bin/llvm-lit", line 44, in <module>
      lit.main(builtin_parameters)
  AttributeError: 'module' object has no attribute 'main'

Suggested by Artem Belevich.

llvm-svn: 283816

7 years agoStore FileEntry::Filename as a StringRef instead of raw pointer (NFC)
Mehdi Amini [Mon, 10 Oct 2016 22:52:47 +0000 (22:52 +0000)]
Store FileEntry::Filename as a StringRef instead of raw pointer (NFC)

llvm-svn: 283815

7 years agoRevert r283690, "MC: Remove unused entities."
Peter Collingbourne [Mon, 10 Oct 2016 22:49:37 +0000 (22:49 +0000)]
Revert r283690, "MC: Remove unused entities."

llvm-svn: 283814

7 years agoAdd the radar number on our end.
Jim Ingham [Mon, 10 Oct 2016 22:21:47 +0000 (22:21 +0000)]
Add the radar number on our end.

llvm-svn: 283813

7 years ago[x86] auto-generate checks
Sanjay Patel [Mon, 10 Oct 2016 22:04:12 +0000 (22:04 +0000)]
[x86] auto-generate checks

llvm-svn: 283812

7 years ago[x86] auto-generate checks
Sanjay Patel [Mon, 10 Oct 2016 22:01:42 +0000 (22:01 +0000)]
[x86] auto-generate checks

llvm-svn: 283811

7 years ago[Driver] Let -gline-tables-only win when it comes after -gmodules.
Adrian Prantl [Mon, 10 Oct 2016 21:56:20 +0000 (21:56 +0000)]
[Driver] Let -gline-tables-only win when it comes after -gmodules.
The -gmodules option is all about putting debug type info into clang
modules and for line tables the type information is irrelevant, so
combining these two options makes no sense.
This commmit fixes the behavior to match the one  documented on the
clang man page: the last -g... option wins.

<rdar://problem/27059770>

llvm-svn: 283810

7 years agoGlobalISel: select G_GLOBAL_VALUE uses on AArch64.
Tim Northover [Mon, 10 Oct 2016 21:50:00 +0000 (21:50 +0000)]
GlobalISel: select G_GLOBAL_VALUE uses on AArch64.

llvm-svn: 283809

7 years agoGlobalISel: allow G_GLOBAL_VALUEs in AArch64 legalization.
Tim Northover [Mon, 10 Oct 2016 21:49:53 +0000 (21:49 +0000)]
GlobalISel: allow G_GLOBAL_VALUEs in AArch64 legalization.

llvm-svn: 283808

7 years agoGlobalISel: support selecting G_GEP instructions.
Tim Northover [Mon, 10 Oct 2016 21:49:49 +0000 (21:49 +0000)]
GlobalISel: support selecting G_GEP instructions.

They're basically just an alias for G_ADD on AArch64.

llvm-svn: 283807

7 years agoGlobalISel: support selecting constants on AArch64.
Tim Northover [Mon, 10 Oct 2016 21:49:42 +0000 (21:49 +0000)]
GlobalISel: support selecting constants on AArch64.

llvm-svn: 283806

7 years agoRename isHotFunction/isColdFunction to isFunctionEntryHot/isFunctionEntryCold. (NFC)
Dehao Chen [Mon, 10 Oct 2016 21:47:28 +0000 (21:47 +0000)]
Rename isHotFunction/isColdFunction to isFunctionEntryHot/isFunctionEntryCold. (NFC)

This is in preparation for https://reviews.llvm.org/D25048

llvm-svn: 283805

7 years agoMark 2777 as complete
Marshall Clow [Mon, 10 Oct 2016 21:37:16 +0000 (21:37 +0000)]
Mark 2777 as complete

llvm-svn: 283804

7 years agoRevert "Disallow ArrayRef assignment from temporaries."
Zachary Turner [Mon, 10 Oct 2016 21:36:23 +0000 (21:36 +0000)]
Revert "Disallow ArrayRef assignment from temporaries."

This reverts commit r283798, as it causes static asserts on
MSVC 2015 with the following errors:

ArrayRefTest.cpp(38): error C2338: Assigning from single prvalue element
ArrayRefTest.cpp(41): error C2338: Assigning from single xvalue element
ArrayRefTest.cpp(47): error C2338: Assigning from an initializer list

llvm-svn: 283803

7 years agoChange Builtins name to be stored as StringRef instead of raw pointers (NFC)
Mehdi Amini [Mon, 10 Oct 2016 21:34:29 +0000 (21:34 +0000)]
Change Builtins name to be stored as StringRef instead of raw pointers (NFC)

llvm-svn: 283802

7 years agoAdd -fno-sanitize-address-use-after-scope flag
Vitaly Buka [Mon, 10 Oct 2016 21:31:50 +0000 (21:31 +0000)]
Add -fno-sanitize-address-use-after-scope flag

Reviewers: eugenis

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

llvm-svn: 283801

7 years agoRename llvm::apply -> llvm::apply_tuple.
Zachary Turner [Mon, 10 Oct 2016 21:24:34 +0000 (21:24 +0000)]
Rename llvm::apply -> llvm::apply_tuple.

llvm::cl already has a function called llvm::apply() so this is
causing an ODR violation.  The STLExtras version should win the
vote on which one gets to be called apply() since it is named
after the equivalent STL function, but since renaiming the cl
version is more difficult, let's do this for now to get the
bots green.

llvm-svn: 283800

7 years agoUpdate with the rest of the results from the 7-Oct Telecom
Marshall Clow [Mon, 10 Oct 2016 21:00:12 +0000 (21:00 +0000)]
Update with the rest of the results from the 7-Oct Telecom

llvm-svn: 283799

7 years agoDisallow ArrayRef assignment from temporaries.
Jordan Rose [Mon, 10 Oct 2016 20:57:33 +0000 (20:57 +0000)]
Disallow ArrayRef assignment from temporaries.

Without this, the following statements will create ArrayRefs that
refer to temporary storage that goes out of scope by the end of the
line:

  someArrayRef = getSingleElement();
  someArrayRef = {elem1, elem2};

Note that the constructor still has this problem:

  ArrayRef<Element> someArrayRef = getSingleElement();
  ArrayRef<Element> someArrayRef = {elem1, elem2};

but that's a little harder to get rid of because we want to be able to
use this in calls:

  takesArrayRef(getSingleElement());
  takesArrayRef({elem1, elem2});

Part of rdar://problem/16375365. Reviewed by Duncan Exon Smith.

llvm-svn: 283798

7 years ago[SelectionDAGBuilder] Support llvm.flt.rounds on targets where i32 is not legal
Hal Finkel [Mon, 10 Oct 2016 20:45:15 +0000 (20:45 +0000)]
[SelectionDAGBuilder] Support llvm.flt.rounds on targets where i32 is not legal

Add integer expansion for FLT_ROUNDS_ for targets where i32 is not a legal
type.

Patch by Edward Jones, thanks!

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

llvm-svn: 283797

7 years ago[ADT] Use () instead of {} in an attempt to work around MSVC 2012 ICEs.
Justin Lebar [Mon, 10 Oct 2016 20:18:02 +0000 (20:18 +0000)]
[ADT] Use () instead of {} in an attempt to work around MSVC 2012 ICEs.

llvm-svn: 283796

7 years agoMake the LValue created in EmitValueForIvarAtOffset have the same Qualifiers in the...
Nick Lewycky [Mon, 10 Oct 2016 20:07:13 +0000 (20:07 +0000)]
Make the LValue created in EmitValueForIvarAtOffset have the same Qualifiers in the LValue as the QualType in the LValue. No functionality change intended.

llvm-svn: 283795

7 years ago[ADT] Don't use make_pointee_iterator in IteratorTest.
Justin Lebar [Mon, 10 Oct 2016 19:56:52 +0000 (19:56 +0000)]
[ADT] Don't use make_pointee_iterator in IteratorTest.

llvm-svn: 283794

7 years agoImplement MS read/write barriers and __faststorefence intrinsic
Albert Gutowski [Mon, 10 Oct 2016 19:40:51 +0000 (19:40 +0000)]
Implement MS read/write barriers and __faststorefence intrinsic

Reviewers: hans, rnk, majnemer

Subscribers: cfe-commits

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

llvm-svn: 283793

7 years agoUse StringRef in TableGen generated Intrinsics.gen file (NFC)
Mehdi Amini [Mon, 10 Oct 2016 19:31:09 +0000 (19:31 +0000)]
Use StringRef in TableGen generated Intrinsics.gen file (NFC)

llvm-svn: 283792

7 years ago[ADT] Remove make_pointe{e,r}_iterator, because it seems to crash MSVC 2015.
Justin Lebar [Mon, 10 Oct 2016 19:29:37 +0000 (19:29 +0000)]
[ADT] Remove make_pointe{e,r}_iterator, because it seems to crash MSVC 2015.

llvm-svn: 283791

7 years ago[AST] Don't use make_pointee_iterator in VTableBuilder.
Justin Lebar [Mon, 10 Oct 2016 19:26:22 +0000 (19:26 +0000)]
[AST] Don't use make_pointee_iterator in VTableBuilder.

Our implementation of make_pointee_iterator seems to be causing MSVC
2015 to crash, so I'm going to remove it.

llvm-svn: 283790

7 years agoRe-commit r283722, reverted in r283750, with a fix for a CUDA-specific use of
Richard Smith [Mon, 10 Oct 2016 18:54:32 +0000 (18:54 +0000)]
Re-commit r283722, reverted in r283750, with a fix for a CUDA-specific use of
past-the-end iterator.

Original commit message:

P0035R4: Semantic analysis and code generation for C++17 overaligned
allocation.

llvm-svn: 283789

7 years ago[libcxx] Add support for Fuchsia
Petr Hosek [Mon, 10 Oct 2016 18:53:32 +0000 (18:53 +0000)]
[libcxx] Add support for Fuchsia

Fuchsia is a new operating system which uses musl as the standard
C library, libc++ and libc++abi as the C++ standard library.

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

llvm-svn: 283788

7 years ago[LTO/Thin] Make the number of threads to run in the BE configurable.
Davide Italiano [Mon, 10 Oct 2016 18:12:53 +0000 (18:12 +0000)]
[LTO/Thin] Make the number of threads to run in the BE configurable.

Before the default was whatever number hardware_concurrency() returned.
Users can specify the number of threads via --lto-jobs=X option.

llvm-svn: 283787

7 years agoRemove trailing whitespace.
Rui Ueyama [Mon, 10 Oct 2016 18:10:01 +0000 (18:10 +0000)]
Remove trailing whitespace.

llvm-svn: 283786

7 years agoImplement __emul, __emulu, _mul128 and _umul128 MS intrinsics
Albert Gutowski [Mon, 10 Oct 2016 18:09:27 +0000 (18:09 +0000)]
Implement __emul, __emulu, _mul128 and _umul128 MS intrinsics

Reviewers: rnk, thakis, majnemer, hans

Subscribers: cfe-commits

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

llvm-svn: 283785

7 years agoTeach llvm::StripDebugInfo() about global variable !dbg attachments.
Adrian Prantl [Mon, 10 Oct 2016 17:53:33 +0000 (17:53 +0000)]
Teach llvm::StripDebugInfo() about global variable !dbg attachments.
This is a regression introduced by the global variable ownership
reversal performed in r281284.

rdar://problem/28448075

llvm-svn: 283784

7 years ago[ADT] Attempt to fix MSVC 2015 ICE via judicious addition of std::decay to make_point...
Justin Lebar [Mon, 10 Oct 2016 17:18:45 +0000 (17:18 +0000)]
[ADT] Attempt to fix MSVC 2015 ICE via judicious addition of std::decay to make_pointe{r,e}_iterator.

llvm-svn: 283783

7 years agoUpdate documentation after r283671 ("Turn cl::values() (for enum) from a vararg funct...
Mehdi Amini [Mon, 10 Oct 2016 17:13:14 +0000 (17:13 +0000)]
Update documentation after r283671 ("Turn cl::values() (for enum) from a vararg function to using C++ variadic template")

llvm-svn: 283782

7 years agoUpdated notes about issues; marked 2062, 2223, 2394, 2460 and 2540 as complete.
Marshall Clow [Mon, 10 Oct 2016 17:11:37 +0000 (17:11 +0000)]
Updated notes about issues; marked 2062, 2223, 2394, 2460 and 2540 as complete.

llvm-svn: 283781

7 years agoAdd tests to check that swap(std::function, std::function) is noexcept. This is LWG...
Marshall Clow [Mon, 10 Oct 2016 16:47:48 +0000 (16:47 +0000)]
Add tests to check that swap(std::function, std::function) is noexcept. This is LWG#2062, but we already do this. No changes to the library, just adding tests.

llvm-svn: 283780

7 years agoAdd llvm::apply to STLExtras.
Zachary Turner [Mon, 10 Oct 2016 16:44:09 +0000 (16:44 +0000)]
Add llvm::apply to STLExtras.

This is equivalent to the C++14 std::apply().  Since we are not
using C++14 yet, this allows us to still make use of apply anyway.

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

llvm-svn: 283779

7 years ago[Examples] Fix use of sema.LateParsedTemplateMap in clang/examples.
Justin Lebar [Mon, 10 Oct 2016 16:41:00 +0000 (16:41 +0000)]
[Examples] Fix use of sema.LateParsedTemplateMap in clang/examples.

llvm-svn: 283778

7 years ago[clang-tidy] Add a whitelist option in google-runtime-references.
Haojian Wu [Mon, 10 Oct 2016 16:38:11 +0000 (16:38 +0000)]
[clang-tidy] Add a whitelist option in google-runtime-references.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 283777

7 years agoUse StringRef in LangOptions::isNoBuiltinFunc API (NFC)
Mehdi Amini [Mon, 10 Oct 2016 16:34:07 +0000 (16:34 +0000)]
Use StringRef in LangOptions::isNoBuiltinFunc API (NFC)

llvm-svn: 283776

7 years ago[Analysis] Use unique_ptr for CallGraph::FunctionMap.
Justin Lebar [Mon, 10 Oct 2016 16:26:48 +0000 (16:26 +0000)]
[Analysis] Use unique_ptr for CallGraph::FunctionMap.

Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283775

7 years ago[Analysis] Use unique_ptr in AnalyaisDeclContextManager's ContextMap.
Justin Lebar [Mon, 10 Oct 2016 16:26:44 +0000 (16:26 +0000)]
[Analysis] Use unique_ptr in AnalyaisDeclContextManager's ContextMap.

Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283774

7 years ago[AST] Convert Marshallers to use unique_ptr.
Justin Lebar [Mon, 10 Oct 2016 16:26:40 +0000 (16:26 +0000)]
[AST] Convert Marshallers to use unique_ptr.

Reviewers: timshen

Subscribers: cfe-commits, klimek

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

llvm-svn: 283773

7 years agoUse unique_ptr for VTableBuilder::VBaseInfo map.
Justin Lebar [Mon, 10 Oct 2016 16:26:36 +0000 (16:26 +0000)]
Use unique_ptr for VTableBuilder::VBaseInfo map.

Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283772

7 years agoUse unique_ptr for VTableBuilder::VFTableLayouts map.
Justin Lebar [Mon, 10 Oct 2016 16:26:33 +0000 (16:26 +0000)]
Use unique_ptr for VTableBuilder::VFTableLayouts map.

Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283771

7 years agoUse unique_ptr for VPtrLocationsMap and VPtrInfoVector.
Justin Lebar [Mon, 10 Oct 2016 16:26:29 +0000 (16:26 +0000)]
Use unique_ptr for VPtrLocationsMap and VPtrInfoVector.

Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283770

7 years ago[AST] Use unique_ptr for VTableLayout.
Justin Lebar [Mon, 10 Oct 2016 16:26:24 +0000 (16:26 +0000)]
[AST] Use unique_ptr for VTableLayout.

Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283769

7 years ago[AST] Convert MangleNumberingContext to a unique_ptr.
Justin Lebar [Mon, 10 Oct 2016 16:26:19 +0000 (16:26 +0000)]
[AST] Convert MangleNumberingContext to a unique_ptr.

Summary: It doesn't need to be refcounted anymore, either.

Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283768

7 years agoUse unique_ptr in LLVMContextImpl's constant maps.
Justin Lebar [Mon, 10 Oct 2016 16:26:13 +0000 (16:26 +0000)]
Use unique_ptr in LLVMContextImpl's constant maps.

Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283767

7 years ago[Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.
Justin Lebar [Mon, 10 Oct 2016 16:26:08 +0000 (16:26 +0000)]
[Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.

Summary:
This is possible now that MapVector supports move-only values.

Depends on D25404.

Reviewers: timshen

Subscribers: cfe-commits

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

llvm-svn: 283766

7 years ago[ADT] Add make_pointe{e,r}_iterator.
Justin Lebar [Mon, 10 Oct 2016 16:26:03 +0000 (16:26 +0000)]
[ADT] Add make_pointe{e,r}_iterator.

Reviewers: timshen

Subscribers: llvm-commits

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

llvm-svn: 283765

7 years ago[ADT] Let MapVector handle non-copyable values.
Justin Lebar [Mon, 10 Oct 2016 16:25:59 +0000 (16:25 +0000)]
[ADT] Let MapVector handle non-copyable values.

Summary: The keys must still be copyable, because we store two copies of them.

Reviewers: timshen

Subscribers: llvm-commits

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

llvm-svn: 283764

7 years ago[ARM] Fix invalid VLDM/VSTM access when targeting Big Endian with NEON
Alexandros Lamprineas [Mon, 10 Oct 2016 16:01:54 +0000 (16:01 +0000)]
[ARM] Fix invalid VLDM/VSTM access when targeting Big Endian with NEON

The instructions VLDM/VSTM can only access word-aligned memory
locations and produce alignment fault if the condition is not met.

The compiler currently generates VLDM/VSTM for v2f64 load/store
regardless the alignment of the memory access. Instead, if a v2f64
load/store is not word-aligned, the compiler should generate
VLD1/VST1. For each non double-word-aligned VLD1/VST1, a VREV
instruction should be generated when targeting Big Endian.

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

llvm-svn: 283763

7 years ago[libcxx] Fix gcc build.
Asiri Rathnayake [Mon, 10 Oct 2016 15:56:01 +0000 (15:56 +0000)]
[libcxx] Fix gcc build.

Attempt to fix a horrible gcc include order problem.

llvm-svn: 283762

7 years agoAdd return type for checkForValidSection parsing function. NFC Intended.
Nirav Dave [Mon, 10 Oct 2016 15:24:54 +0000 (15:24 +0000)]
Add return type for checkForValidSection parsing function. NFC Intended.

llvm-svn: 283761