platform/upstream/llvm.git
7 years ago[c++1z] Teach composite pointer type computation how to compute the composite
Richard Smith [Thu, 20 Oct 2016 17:57:33 +0000 (17:57 +0000)]
[c++1z] Teach composite pointer type computation how to compute the composite
pointer type of two function pointers with different noexcept specifications.
While I'm here, also teach it how to merge dynamic exception specifications.

llvm-svn: 284753

7 years agoFix *_EXTEND_VECTOR_INREG legalization
Pirama Arumuga Nainar [Thu, 20 Oct 2016 17:56:36 +0000 (17:56 +0000)]
Fix *_EXTEND_VECTOR_INREG legalization

Summary:
While promoting *_EXTEND_VECTOR_INREG nodes whose inputs are already
promoted, perform the appropriate sign extension for the promoted node
before doing the *_EXTEND_VECTOR_INREG operation.  If not, the undefined
high-order bits of the promoted operand may (a) be garbage inc ase of
zext) or (b) contribute the wrong sign-bit (in case of sext)

Updated the promote-vec3.ll test after this change.  The diff shows
explicit zeroing in case of zext and intermediate sign extension in case
of sext.

Reviewers: RKSimon

Subscribers: llvm-commits, srhines

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

llvm-svn: 284752

7 years ago[ELF][MIPS] Use getMipsLocalEntriesNum() everywhere we need number of `local` GOT...
Simon Atanasyan [Thu, 20 Oct 2016 17:53:59 +0000 (17:53 +0000)]
[ELF][MIPS] Use getMipsLocalEntriesNum() everywhere we need number of `local` GOT entries. NFC

llvm-svn: 284751

7 years ago[ELF][MIPS] Separate calculation of MIPS GOT index and offset of the corresponding...
Simon Atanasyan [Thu, 20 Oct 2016 17:53:55 +0000 (17:53 +0000)]
[ELF][MIPS] Separate calculation of MIPS GOT index and offset of the corresponding part of the GOT. NFC

MIPS GOT consists of some parts: local, global, TLS entries. This change
separates calculation of MIPS GOT index and offset of the corresponding
part of the GOT. That makes code a bit clear and allow to extend number
of parts in the future.

llvm-svn: 284750

7 years ago[clang-cl] Fix test that shouldn't be running on non-x86
Renato Golin [Thu, 20 Oct 2016 17:41:08 +0000 (17:41 +0000)]
[clang-cl] Fix test that shouldn't be running on non-x86

The clang-cl test required x86-registered-target but it defaulted to the
host's triple and AArch64 still doesn't support COFF, so the test failed.

The triple was "aarch64-pc-windows-msvc18.0.0" with ObjectFormat equals
llvm::Triple::COFF, failing assertion:

Assertion `(TT.isOSBinFormatELF() || TT.isOSBinFormatMachO()) &&
          "Only expect Darwin and ELF targets"

in AArch64MCTargetDesc.cpp:78.

Making the test only run on Windows hosts obviously fixes the problem.

llvm-svn: 284749

7 years ago[CostModel][X86] Added tests for sdiv/udiv costs for uniform const and uniform const...
Simon Pilgrim [Thu, 20 Oct 2016 17:16:38 +0000 (17:16 +0000)]
[CostModel][X86] Added tests for sdiv/udiv costs for uniform const and uniform const power-of-2

Shows poor costings in AVX1/AVX512BW for certain vector types

llvm-svn: 284748

7 years agoFixed memory leak mistakenly introduced by https://reviews.llvm.org/D23115
Andrey Churbanov [Thu, 20 Oct 2016 17:14:17 +0000 (17:14 +0000)]
Fixed memory leak mistakenly introduced by https://reviews.llvm.org/D23115

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

llvm-svn: 284747

7 years ago[Target] remove TargetRecip class; 2nd try
Sanjay Patel [Thu, 20 Oct 2016 16:55:45 +0000 (16:55 +0000)]
[Target] remove TargetRecip class; 2nd try

This is a retry of r284495 which was reverted at r284513 due to use-after-scope bugs
caused by faulty usage of StringRef.

This version also renames a pair of functions:
getRecipEstimateDivEnabled()
getRecipEstimateSqrtEnabled()
as suggested by Eric Christopher.

original commit msg:

[Target] remove TargetRecip class; move reciprocal estimate isel functionality to TargetLowering

This is a follow-up to https://reviews.llvm.org/D24816 - where we changed reciprocal estimates to be function attributes
rather than TargetOptions.

This patch is intended to be a structural, but not functional change. By moving all of the
TargetRecip functionality into TargetLowering, we can remove all of the reciprocal estimate
state, shield the callers from the string format implementation, and simplify/localize the
logic needed for a target to enable this.

If a function has a "reciprocal-estimates" attribute, those settings may override the target's
default reciprocal preferences for whatever operation and data type we're trying to optimize.
If there's no attribute string or specific setting for the op/type pair, just use the target
default settings.

As noted earlier, a better solution would be to move the reciprocal estimate settings to IR
instructions and SDNodes rather than function attributes, but that's a multi-step job that
requires infrastructure improvements. I intend to work on that, but it's not clear how long
it will take to get all the pieces in place.

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

llvm-svn: 284746

7 years agoPut the move ctor for PassManager back for now, it breaks some builds.
Benjamin Kramer [Thu, 20 Oct 2016 16:50:07 +0000 (16:50 +0000)]
Put the move ctor for PassManager back for now, it breaks some builds.

For some reason using the default move ctor creates undefined references
to it.

llvm-svn: 284745

7 years ago[CostModel][X86] Fixed AVX1/AVX512 sdiv/udiv general costs for 256/512 bit integer...
Simon Pilgrim [Thu, 20 Oct 2016 16:39:11 +0000 (16:39 +0000)]
[CostModel][X86] Fixed AVX1/AVX512 sdiv/udiv general costs for 256/512 bit integer vectors

We weren't accounting for legal types on every subtarget, meaning that many of the costs were using defaults.

We still don't correctly cost (or test) the 512-bit sdiv/udiv by uniform const cases, nor the power-of-2 cases.

llvm-svn: 284744

7 years ago[AMDGPU] add fcopysign(f64, f32) pattern
Valery Pykhtin [Thu, 20 Oct 2016 16:17:54 +0000 (16:17 +0000)]
[AMDGPU] add fcopysign(f64, f32) pattern

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

llvm-svn: 284743

7 years ago[clang-tidy] Add check 'readability-redundant-member-init'
Malcolm Parsons [Thu, 20 Oct 2016 16:08:03 +0000 (16:08 +0000)]
[clang-tidy] Add check 'readability-redundant-member-init'

Summary: The check emits a warning if a member-initializer calls the member's default constructor with no arguments.

Reviewers: sbenza, alexfh, aaron.ballman

Subscribers: modocache, mgorny, Eugene.Zelenko, etienneb, Prazek, hokein, cfe-commits, beanz

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

llvm-svn: 284742

7 years agoMinidump plugin: redesign the x86_64 register context
Dimitar Vlahovski [Thu, 20 Oct 2016 16:01:36 +0000 (16:01 +0000)]
Minidump plugin: redesign the x86_64 register context

Summary:
I misunderstood the format of the register context layout.
I thought it was a dynamically changing structure, and that it's size
depended on context_flags.
It turned out that it always has the same fixed layout and size,
and the context_flags says which fields of the
struct have valid values.
This required a minor redesign of the register context class.

The layout inconsistency, however, was not a "problem" before (e.g. the plugin was working)
because there also was a bug with checking context_flags - the code was
parsing the entire struct regardless of context_flags.
This bug is also fixed in this commit.

Reviewers: labath, zturner

Subscribers: lldb-commits, amccarth

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

llvm-svn: 284741

7 years agoFix SectionPiece size when compiling with MSVC
Hans Wennborg [Thu, 20 Oct 2016 15:59:08 +0000 (15:59 +0000)]
Fix SectionPiece size when compiling with MSVC

Builds were failing with:

  InputSection.h(139): error C2338: SectionPiece is too big

because MSVC does record layout differently, probably not packing the
'OutputOff' and 'Live' bitfields because their types are of different
size. Using size_t for 'Live' seems to fix it.

llvm-svn: 284740

7 years agoRemove a use of llvm::AlignOf that I missed.
Benjamin Kramer [Thu, 20 Oct 2016 15:55:41 +0000 (15:55 +0000)]
Remove a use of llvm::AlignOf that I missed.

llvm-svn: 284739

7 years ago[Support] Put back the MSVC hack for AlignedCharArray.
Benjamin Kramer [Thu, 20 Oct 2016 15:53:04 +0000 (15:53 +0000)]
[Support] Put back the MSVC hack for AlignedCharArray.

MSVC 2015 still errors when passing an alignas'd object by value as an
argument.

llvm-svn: 284738

7 years agoUse auto in for loop
Malcolm Parsons [Thu, 20 Oct 2016 15:40:34 +0000 (15:40 +0000)]
Use auto in for loop

llvm-svn: 284737

7 years ago[Support] Remove llvm::alignOf now that all uses are gone.
Benjamin Kramer [Thu, 20 Oct 2016 15:36:38 +0000 (15:36 +0000)]
[Support] Remove llvm::alignOf now that all uses are gone.

Also clean up the legacy hacks for AlignedCharArray. I'm keeping
LLVM_ALIGNAS alive for a bit longer because GCC 4.8.0 (which we still
support apparently) shipped a buggy alignas(). All other supported
compilers have a working alignas.

llvm-svn: 284736

7 years ago[clang-tidy] Simplify modernize-use-default
Malcolm Parsons [Thu, 20 Oct 2016 15:31:34 +0000 (15:31 +0000)]
[clang-tidy] Simplify modernize-use-default

Summary:
clang-tidy now cleans up after replacements, so leave colon and comma
removal to that.

Reviewers: angelgarcia, alexfh, aaron.ballman, djasper, ioeric

Subscribers: djasper, cfe-commits

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

llvm-svn: 284735

7 years agoRetire llvm::alignOf in favor of C++11 alignof.
Benjamin Kramer [Thu, 20 Oct 2016 15:30:02 +0000 (15:30 +0000)]
Retire llvm::alignOf in favor of C++11 alignof.

No functionality change intended.

llvm-svn: 284734

7 years agoRetire llvm::alignOf in favor of C++11 alignof.
Benjamin Kramer [Thu, 20 Oct 2016 15:02:18 +0000 (15:02 +0000)]
Retire llvm::alignOf in favor of C++11 alignof.

No functionality change intended.

llvm-svn: 284733

7 years ago[Format] Cleanup after replacing constructor body with = default
Malcolm Parsons [Thu, 20 Oct 2016 14:58:45 +0000 (14:58 +0000)]
[Format] Cleanup after replacing constructor body with = default

Summary:
Remove colon and commas after replacing constructor body with = default.
Fix annotation of TT_CtorInitializerColon when preceded by a comment.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 284732

7 years agoAdding a missing constexpr test for reverse_iterator operator[].
Marshall Clow [Thu, 20 Oct 2016 14:57:34 +0000 (14:57 +0000)]
Adding a missing constexpr test for reverse_iterator operator[].

llvm-svn: 284731

7 years agoRetire llvm::alignOf in favor of C++11 alignof.
Benjamin Kramer [Thu, 20 Oct 2016 14:27:22 +0000 (14:27 +0000)]
Retire llvm::alignOf in favor of C++11 alignof.

No functionality change intended.

llvm-svn: 284730

7 years agoClean up alignment hacks now that MSVC 2013 and GCC 4.7 are gone.
Benjamin Kramer [Thu, 20 Oct 2016 13:52:26 +0000 (13:52 +0000)]
Clean up alignment hacks now that MSVC 2013 and GCC 4.7 are gone.

llvm-svn: 284729

7 years ago[OpenMP] Fix issue with directives used in a macro.
Samuel Antao [Thu, 20 Oct 2016 13:20:17 +0000 (13:20 +0000)]
[OpenMP] Fix issue with directives used in a macro.

Summary:
If directives are used in a macro, clang complains with:
```
src/projects/openmp/runtime/src/kmp_runtime.c:7486:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
#if KMP_USE_MONITOR
```

This patch fixes two occurrences of the issue in `kmp_runtime.cpp`.

Reviewers: tlwilmar, jlpeyton, AndreyChurbanov, Hahnfeld

Subscribers: Hahnfeld, openmp-commits

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

llvm-svn: 284728

7 years ago[clang-tidy] Fix an assertion failure in cppcoreguidelines-pro-type-member-init.
Haojian Wu [Thu, 20 Oct 2016 13:15:40 +0000 (13:15 +0000)]
[clang-tidy] Fix an assertion failure in cppcoreguidelines-pro-type-member-init.

Summary:
The matcher for matching "class with default constructor" still match
some classes without default constructor, which trigger an assert at
Line 307. This patch makes the matcher more strict.

Reviewers: aaron.ballman

Subscribers: nemanjai, cfe-commits

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

llvm-svn: 284727

7 years ago[GVN] Use defaulted members. No functional change.
Benjamin Kramer [Thu, 20 Oct 2016 13:09:12 +0000 (13:09 +0000)]
[GVN] Use defaulted members. No functional change.

llvm-svn: 284726

7 years agoRe-generate the python and cpp reference documentation
Tamas Berghammer [Thu, 20 Oct 2016 13:04:32 +0000 (13:04 +0000)]
Re-generate the python and cpp reference documentation

They haven't been updated since July 2013 so they missed a lot of new
function added to the SB API since.

Bug: llvm.org/pr30603
llvm-svn: 284725

7 years ago[mips][mcjit] Add the majority of N32 support.
Simon Dardis [Thu, 20 Oct 2016 13:02:23 +0000 (13:02 +0000)]
[mips][mcjit] Add the majority of N32 support.

The missing piece is relocation composition for %hi(%neg(%gp_rel(x))) and
similar.

Patch by: Daniel Sanders

llvm-svn: 284724

7 years ago[CostModel][X86] Added tests for sdiv/udiv costs for scalar and 128/256/512 bit integ...
Simon Pilgrim [Thu, 20 Oct 2016 12:34:00 +0000 (12:34 +0000)]
[CostModel][X86] Added tests for sdiv/udiv costs for scalar and 128/256/512 bit integer vectors

Shows current bug in AVX1/AVX512BW costs for 256 bit vector types

llvm-svn: 284723

7 years ago[lsan] [aarch64] Fix printing of pointers in make check tests
Strahinja Petrovic [Thu, 20 Oct 2016 12:25:57 +0000 (12:25 +0000)]
[lsan] [aarch64] Fix printing of pointers in make check tests

This patch replaces fprintf with print_address function
in LSAN tests. This is necessary because of different
printing of pointers in fprintf and sanitizer's print
function. Differential Revision: https://reviews.llvm.org/D25270.

llvm-svn: 284722

7 years agoDo a sweep over move ctors and remove those that are identical to the default.
Benjamin Kramer [Thu, 20 Oct 2016 12:20:28 +0000 (12:20 +0000)]
Do a sweep over move ctors and remove those that are identical to the default.

All of these existed because MSVC 2013 was unable to synthesize default
move ctors. We recently dropped support for it so all that error-prone
boilerplate can go.

No functionality change intended.

llvm-svn: 284721

7 years agoReapply "Add Chrono.h - std::chrono support header"
Pavel Labath [Thu, 20 Oct 2016 12:05:50 +0000 (12:05 +0000)]
Reapply "Add Chrono.h - std::chrono support header"

This is a resubmission of r284590. The mingw build should be fixed now. The
problem was we were matching time_t with _localtime_64s, which was incorrect on
_USE_32BIT_TIME_T systems. Instead I use localtime_s, which should always
evaluate to the correct function.

llvm-svn: 284720

7 years ago[Clang-tidy]: Fix modernize-avoid-bind erroneous scope resolution.
Haojian Wu [Thu, 20 Oct 2016 11:32:47 +0000 (11:32 +0000)]
[Clang-tidy]: Fix modernize-avoid-bind erroneous scope resolution.

Hello, i would like to suggest a fix for one of the checks in clang-tidy and i should hope this one is the correct mailing list.
The check is modernize-avoid-bind.

Consider the following:

  void bar(int x, int y);

  namespace N {
    void bar(int x, int y);
  }

  void foo(){
    auto Test = std::bind(N::bar,1,1);
  }

clang-tidy’s modernize-avoid-bind check suggests writing:

  void foo(){
    auto Test =[] {return bar(1,1);};
  }

instead of:

  void foo(){
    auto Test = [] {return N::bar(1,1);};
  }

So clang-tidy has proposed an incorrect Fix.

Patch by IdrissRio!

Reviewers: alexfh, hokein, aaron.ballman

Subscriber: cfe-commits
llvm-svn: 284719

7 years ago[cmake] Avoid warnings in feature tests. NFC.
Michael Kruse [Thu, 20 Oct 2016 11:16:19 +0000 (11:16 +0000)]
[cmake] Avoid warnings in feature tests. NFC.

Apply the __attribute__((unused)) before the function to unambiguously apply to
the function declaration.

Add more casts-to-void to mark return values unused as intended.

Contributed-by: Andy Gibbs <andyg1001@hotmail.co.uk>
llvm-svn: 284718

7 years ago[DAGCombiner] Add general constant vector support to (srl (shl x, c), c) -> (and...
Simon Pilgrim [Thu, 20 Oct 2016 11:10:21 +0000 (11:10 +0000)]
[DAGCombiner] Add general constant vector support to (srl (shl x, c), c) -> (and x, cst2)

We already supported scalar constant / splatted constant vector - now accepts any (non opaque) constant scalar / vector

llvm-svn: 284717

7 years agoCompact SectionPiece.
Rafael Espindola [Thu, 20 Oct 2016 10:55:58 +0000 (10:55 +0000)]
Compact SectionPiece.

We allocate a lot of these when linking debug info. This speeds up the
link of debug programs by 1% to 2%.

llvm-svn: 284716

7 years agoWdocumentation fix
Simon Pilgrim [Thu, 20 Oct 2016 10:53:38 +0000 (10:53 +0000)]
Wdocumentation fix

llvm-svn: 284715

7 years agoFix spelling mistake in comment.
Simon Pilgrim [Thu, 20 Oct 2016 10:42:14 +0000 (10:42 +0000)]
Fix spelling mistake in comment.

llvm-svn: 284714

7 years agoFix MSVC bool -> uint64_t promotion warning
Simon Pilgrim [Thu, 20 Oct 2016 10:37:58 +0000 (10:37 +0000)]
Fix MSVC bool -> uint64_t promotion warning

llvm-svn: 284713

7 years ago[ELF] Add REQUIRES: arm to test to fix buildbot without ARM backend.
Peter Smith [Thu, 20 Oct 2016 10:16:13 +0000 (10:16 +0000)]
[ELF] Add REQUIRES: arm to test to fix buildbot without ARM backend.

llvm-svn: 284711

7 years ago[ELF] Allow relative exceptions relocations in shared libraries
Peter Smith [Thu, 20 Oct 2016 09:59:26 +0000 (09:59 +0000)]
[ELF] Allow relative exceptions relocations in shared libraries

The R_ARM_PREL31 and R_ARM_NONE relocations should not be faulted in
shared libraries. In the case of R_ARM_NONE, we have moved the TLS
relaxation hint instruction to R_TLSDESC_CALL so that R_HINT can be used
without side-effects. In the case of R_ARM_PREL31 we permit it to be used
against PLT entries as the personality routines are imported when used in
shared libraries.

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

llvm-svn: 284710

7 years agoDon't include PHDRs if linker script doesn't want them
Eugene Leviant [Thu, 20 Oct 2016 09:39:09 +0000 (09:39 +0000)]
Don't include PHDRs if linker script doesn't want them

This script below shouldn't include file and program headers
to PT_LOAD segment, because it doesn't have PHDRS and FILEHDR
attributes:

PHDRS { all PT_LOAD; }
SECTIONS { /* list of sections here */ }

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

llvm-svn: 284709

7 years ago[ELF] - Partial support of --gdb-index command line option (Part 1).
George Rimar [Thu, 20 Oct 2016 09:19:48 +0000 (09:19 +0000)]
[ELF] - Partial support of --gdb-index command line option (Part 1).

In this patch partial gdb_index section is created.
For costructing the .gdb_index section 6 steps should be performed (details are in
SplitDebugInfo.cpp file header), this patch do first 3:

Creates proper section header.
Fills list of compilation units.
Types CU list area is not supposed to be supported, so it is ignored and therefore
can be treated as implemented either.

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

llvm-svn: 284708

7 years ago[Go bindings] Update for r284678 API changes.
Benjamin Kramer [Thu, 20 Oct 2016 09:14:39 +0000 (09:14 +0000)]
[Go bindings] Update for r284678 API changes.

Alignment moved from createBasicType to createAutoVariable.

llvm-svn: 284707

7 years agoFix ARM/AArch64 Step-Over watchpoint issue remove provision for duplicate watchpoints
Omair Javaid [Thu, 20 Oct 2016 09:07:26 +0000 (09:07 +0000)]
Fix ARM/AArch64 Step-Over watchpoint issue remove provision for duplicate watchpoints

This patch fixes ARM/AArch64 watchpoint bug which was taking inferior out of control while stepping over watchpoints.
Also adds a test case that tests above problem.

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

llvm-svn: 284706

7 years ago[ELF] - Applied clang format. NFC.
George Rimar [Thu, 20 Oct 2016 08:36:42 +0000 (08:36 +0000)]
[ELF] - Applied clang format. NFC.

llvm-svn: 284705

7 years ago[SystemZ] Post-RA scheduler implementation
Jonas Paulsson [Thu, 20 Oct 2016 08:27:16 +0000 (08:27 +0000)]
[SystemZ] Post-RA scheduler implementation

Post-RA sched strategy and scheduling instruction annotations for z196, zEC12
and z13.

This scheduler optimizes decoder grouping and balances processor resources
(including side steering the FPd unit instructions).

The SystemZHazardRecognizer keeps track of the scheduling state, which can
be dumped with -debug-only=misched.

Reviers: Ulrich Weigand, Andrew Trick.
https://reviews.llvm.org/D17260

llvm-svn: 284704

7 years ago[ELF] - Testcase checking that we do not crash on invalid sh_info in SHT_GROUP sectio...
George Rimar [Thu, 20 Oct 2016 08:22:54 +0000 (08:22 +0000)]
[ELF] - Testcase checking that we do not crash on invalid sh_info in SHT_GROUP sections. NFC.

Fix was landed as r284702 "[Object/ELF] - Check index argument in getSymbol()."

Patch contains LLD testcase only.

llvm-svn: 284703

7 years ago[Object/ELF] - Check index argument in getSymbol().
George Rimar [Thu, 20 Oct 2016 08:03:10 +0000 (08:03 +0000)]
[Object/ELF] - Check index argument in getSymbol().

Without this check LLD crashes when SHT_GROUP section has invalid symbol index
because of next code:

template <class ELFT>
StringRef elf::ObjectFile<ELFT>::getShtGroupSignature(const Elf_Shdr &Sec) {
..
  const Elf_Sym *Sym = Obj.getSymbol(Symtab, Sec.sh_info);
..
}
If sh_info is too large, &Symbols[Index] just asserts.

No testcases provided because llvm-objdump/llvm-readelf does
not use getSymbol() function.

I`ll commit testcase for LLD separatelly.

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

llvm-svn: 284702

7 years agoWork around MSVC rejects-valid. Apparenty (some versions of) MSVC will check
Richard Smith [Thu, 20 Oct 2016 07:53:17 +0000 (07:53 +0000)]
Work around MSVC rejects-valid. Apparenty (some versions of) MSVC will check
that a member is default-initializable even if it's initialized by a default
member initializer.

llvm-svn: 284701

7 years agoAdd a helper function to define symbols.
Rui Ueyama [Thu, 20 Oct 2016 06:44:58 +0000 (06:44 +0000)]
Add a helper function to define symbols.

Also replace std::copy with memcpy because in other places we are
using memcpy.

llvm-svn: 284700

7 years agoRename variables so that they are more in line with rest of the code.
Rui Ueyama [Thu, 20 Oct 2016 06:34:03 +0000 (06:34 +0000)]
Rename variables so that they are more in line with rest of the code.

llvm-svn: 284699

7 years agoUpdate document.
Rui Ueyama [Thu, 20 Oct 2016 05:35:25 +0000 (05:35 +0000)]
Update document.

llvm-svn: 284698

7 years agoFormat. NFC.
Rui Ueyama [Thu, 20 Oct 2016 05:23:23 +0000 (05:23 +0000)]
Format. NFC.

llvm-svn: 284697

7 years agoRemove Config::Binary.
Rui Ueyama [Thu, 20 Oct 2016 05:12:29 +0000 (05:12 +0000)]
Remove Config::Binary.

This member is used only by LinkerDriver, so move it to LinkerDriver.

llvm-svn: 284696

7 years agoRemove an optional parameter from LinkerDriver::addFile to simplify.
Rui Ueyama [Thu, 20 Oct 2016 05:03:49 +0000 (05:03 +0000)]
Remove an optional parameter from LinkerDriver::addFile to simplify.

llvm-svn: 284695

7 years agoSplit LinkerDriver::createFiles. NFC.
Rui Ueyama [Thu, 20 Oct 2016 04:47:47 +0000 (04:47 +0000)]
Split LinkerDriver::createFiles. NFC.

llvm-svn: 284694

7 years agoFix error message for unknown -format argument.
Rui Ueyama [Thu, 20 Oct 2016 04:47:45 +0000 (04:47 +0000)]
Fix error message for unknown -format argument.

-format=<foo>, -format <foo> and -b <foo> are all the same.
Previous code was intended to produce an error message with the
same spelling as given from the command line, but it actually
always printed out this string: "unknown -format= value:".
This is probably more confusing than "unknown -format value:".
So I changed the message.

llvm-svn: 284693

7 years agoSimplify. NFC.
Rui Ueyama [Thu, 20 Oct 2016 04:36:36 +0000 (04:36 +0000)]
Simplify. NFC.

llvm-svn: 284692

7 years agoAttempt to workaround XPASS for aligned allocation tests
Eric Fiselier [Thu, 20 Oct 2016 03:31:07 +0000 (03:31 +0000)]
Attempt to workaround XPASS for aligned allocation tests

llvm-svn: 284691

7 years agoReplace uses of LLVM_FUNCTION_NAME with __func__, this was macro was removed from...
Erik Pilkington [Thu, 20 Oct 2016 02:46:22 +0000 (02:46 +0000)]
Replace uses of LLVM_FUNCTION_NAME with __func__, this was macro was removed from llvm/Support in r284681

llvm-svn: 284690

7 years agoUpdate isl to isl-0.17.1-236-ga9c6cc7
Tobias Grosser [Thu, 20 Oct 2016 01:59:24 +0000 (01:59 +0000)]
Update isl to isl-0.17.1-236-ga9c6cc7

This includes isl_id_to_str, which is used in Michael's upcoming DeLICM patch.

llvm-svn: 284689

7 years agoX86: Allow expressions to appear as u8imm operands.
Peter Collingbourne [Thu, 20 Oct 2016 01:58:34 +0000 (01:58 +0000)]
X86: Allow expressions to appear as u8imm operands.

llvm-svn: 284688

7 years agoRemove std:: from std::size_t.
Rui Ueyama [Thu, 20 Oct 2016 01:33:09 +0000 (01:33 +0000)]
Remove std:: from std::size_t.

llvm-svn: 284687

7 years agoX86: Deduplicate some lowering code. NFCI.
Peter Collingbourne [Thu, 20 Oct 2016 01:21:26 +0000 (01:21 +0000)]
X86: Deduplicate some lowering code. NFCI.

llvm-svn: 284686

7 years agoRefactor and simplify Sema::FindCompositePointerType. No functionality change intended.
Richard Smith [Thu, 20 Oct 2016 01:20:00 +0000 (01:20 +0000)]
Refactor and simplify Sema::FindCompositePointerType. No functionality change intended.

llvm-svn: 284685

7 years agoPR26276: Fix detection of non-cast-expressions as operands of fold-expressions.
Richard Smith [Thu, 20 Oct 2016 00:55:15 +0000 (00:55 +0000)]
PR26276: Fix detection of non-cast-expressions as operands of fold-expressions.

llvm-svn: 284684

7 years agoUpgrade debug-info-vla test: we do not pass default alignment now
Victor Leschuk [Thu, 20 Oct 2016 00:37:07 +0000 (00:37 +0000)]
Upgrade debug-info-vla test: we do not pass default alignment now

llvm-svn: 284683

7 years agoDebugInfo: remove broken bitcode upgrade test
Victor Leschuk [Thu, 20 Oct 2016 00:26:36 +0000 (00:26 +0000)]
DebugInfo: remove broken bitcode upgrade test

llvm-svn: 284682

7 years agoUse __func__ directly now that all supported compilers support it
Reid Kleckner [Thu, 20 Oct 2016 00:22:23 +0000 (00:22 +0000)]
Use __func__ directly now that all supported compilers support it

Remove the portability macro now that it is unused.

llvm-svn: 284681

7 years agoFix narrowing conversion error in 32-bit MSVC builds
Reid Kleckner [Thu, 20 Oct 2016 00:13:34 +0000 (00:13 +0000)]
Fix narrowing conversion error in 32-bit MSVC builds

Use size_t instead of ELFT::uint for the string table offset. If the
linker is built 32-bit, it can't write an output file larger than 2GB.
Other code in this area uses size_t as well.

llvm-svn: 284680

7 years agoDebugInfo: pass alignment value only if it was forced
Victor Leschuk [Thu, 20 Oct 2016 00:13:19 +0000 (00:13 +0000)]
DebugInfo: pass alignment value only if it was forced

Preparation to implement DW_AT_alignment support:
 - We pass non-zero align value to DIBuilder only when alignment was forced
 - Modify tests to match this change

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

llvm-svn: 284679

7 years agoDebugInfo: preparation to implement DW_AT_alignment
Victor Leschuk [Thu, 20 Oct 2016 00:13:12 +0000 (00:13 +0000)]
DebugInfo: preparation to implement DW_AT_alignment

 - Add alignment attribute to DIVariable family
 - Modify bitcode format to match new DIVariable representation
 - Update tests to match these changes (also add bitcode upgrade test)
 - Expect that frontend passes non-zero align value only when it is not default
   (was forcibly aligned by alignas()/_Alignas()/__atribute__(aligned())

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

llvm-svn: 284678

7 years ago[WebAssembly] Update extending load test for new i1 behavior
Derek Schuff [Thu, 20 Oct 2016 00:10:34 +0000 (00:10 +0000)]
[WebAssembly] Update extending load test for new i1 behavior

r284611 changed the behavior of the DAG legalizer for sign-extending i1
values. Update the wasm extending load test to match.

llvm-svn: 284677

7 years agoAllow linker-script-defined entry symbols.
Rui Ueyama [Thu, 20 Oct 2016 00:07:36 +0000 (00:07 +0000)]
Allow linker-script-defined entry symbols.

Previously, we were checking the existence of an entry symbol
too early. It was done before the linker script processor creates
symbols defined in scripts. Fixes bug 30743.

llvm-svn: 284676

7 years agoFix build failure.
Rui Ueyama [Thu, 20 Oct 2016 00:05:46 +0000 (00:05 +0000)]
Fix build failure.

llvm-svn: 284675

7 years agoAdded a decorator for the macOS version and switched over testcases that used platfor...
Sean Callanan [Thu, 20 Oct 2016 00:03:39 +0000 (00:03 +0000)]
Added a decorator for the macOS version and switched over testcases that used platform.release

llvm-svn: 284674

7 years agoFix crash on noreturn conversion in unprototyped function type. Thanks to Keith
Richard Smith [Thu, 20 Oct 2016 00:01:36 +0000 (00:01 +0000)]
Fix crash on noreturn conversion in unprototyped function type. Thanks to Keith
Walker for spotting the bug.

llvm-svn: 284673

7 years agoRemove LLVM_NOEXCEPT and replace it with noexcept
Reid Kleckner [Wed, 19 Oct 2016 23:52:38 +0000 (23:52 +0000)]
Remove LLVM_NOEXCEPT and replace it with noexcept

Now that we have dropped MSVC 2013, all supported compilers support
noexcept and we can drop this portability macro.

llvm-svn: 284672

7 years agoUse noexcept directly now that all compilers support it
Reid Kleckner [Wed, 19 Oct 2016 23:50:50 +0000 (23:50 +0000)]
Use noexcept directly now that all compilers support it

llvm-svn: 284671

7 years ago[ELF] Replace std::pair with a struct so we have proper names. NFC.
Michael J. Spencer [Wed, 19 Oct 2016 23:49:27 +0000 (23:49 +0000)]
[ELF] Replace std::pair with a struct so we have proper names. NFC.

llvm-svn: 284670

7 years agoExtend hack to work around bad exception specifications for 'swap' members to
Richard Smith [Wed, 19 Oct 2016 23:47:37 +0000 (23:47 +0000)]
Extend hack to work around bad exception specifications for 'swap' members to
also cover libstdc++'s std::__debug::array and std::__profile::array.

llvm-svn: 284669

7 years agoNext set of additional error checks for invalid Mach-O files for the
Kevin Enderby [Wed, 19 Oct 2016 23:44:34 +0000 (23:44 +0000)]
Next set of additional error checks for invalid Mach-O files for the
load commands that use the MachO::thread_command type
but are not used in llvm libObject code but used in llvm tool code.

This includes the LC_UNIXTHREAD and LC_THREAD
load commands.

A quick note about the philosophy of the error checking in
libObject for Mach-O files, the idea behind the checking is
that we never will return a Mach-O file out of libObject that
contains unknown things in the load commands.

To do this the 32-bit ARM and PPC general tread states
needed to be defined as two test case binaries contained
them.  If other thread states for other CPUs need to be
added we will do that as needed.

Going forward the LC_MAIN load command is used to
set the entry point in Mach-O executables these days
instead of an LC_UNIXTHREAD as was done in the past.
So today only in core files are LC_THREAD load commands
and thread states usually found.

Other thread states have not yet been defined in
include/Support/MachO.h at this time.  But that can be
added as needed with their corresponding checking also
added.

llvm-svn: 284668

7 years agoUse noexcept instead of LLVM_NOEXCEPT now that all compilers support it
Reid Kleckner [Wed, 19 Oct 2016 23:39:55 +0000 (23:39 +0000)]
Use noexcept instead of LLVM_NOEXCEPT now that all compilers support it

llvm-svn: 284667

7 years agoAdd lldb register definitions for w0-w28, s0-s31, and d0-d31 to
Jason Molenda [Wed, 19 Oct 2016 23:38:38 +0000 (23:38 +0000)]
Add lldb register definitions for w0-w28, s0-s31, and d0-d31 to
RegisterInfos_arm64.h.  These register definitions include the
offset into the register context, which will vary depending on the
endianness of the arm64 target system (e.g. s8 is at offset 0 in
v8 on little-endian, it is at offset 12 on big-endian) and I've
only added the little-endian definitions to the table.  If we want
to add a big-endian arm64 target, we'll need a separate table which
uses the big-endian offsets for these registers.  I changed the
name of the register table from g_register_infos_arm64 to
g_register_infos_arm64_le to make it explicit that this is the
little-endian version of that table, and updated users of the table
to use the new name.

I added support for the "w", "s", and "d" registers to
RegisterContextDarwin_arm64 but it was more an example than anything
useful -- this plugin is only used when working with core files and
darwin core files do not (today) include the floating point register
context, so it only added the support for the "w" pseudo registers.
When we're connected to a real arm64 device, we use the ProcessGDBRemote
code.

llvm-svn: 284666

7 years agoUpdate Compiler.h to fail fast when building with MSVC 2013
Reid Kleckner [Wed, 19 Oct 2016 23:34:58 +0000 (23:34 +0000)]
Update Compiler.h to fail fast when building with MSVC 2013

llvm-svn: 284665

7 years ago[PGO] Fix a use-after-move. NFC.
Rong Xu [Wed, 19 Oct 2016 23:31:59 +0000 (23:31 +0000)]
[PGO] Fix a use-after-move. NFC.

llvm-svn: 284664

7 years agoDon't call markLiveAt for non alloc sections.
Rafael Espindola [Wed, 19 Oct 2016 23:13:40 +0000 (23:13 +0000)]
Don't call markLiveAt for non alloc sections.

We don't gc them anyway, so just use an early return in Enqueue.

llvm-svn: 284663

7 years agoRead an expression in the form of "ABSOLUTE(<expr>) op <expr> ...".
Rui Ueyama [Wed, 19 Oct 2016 23:11:21 +0000 (23:11 +0000)]
Read an expression in the form of "ABSOLUTE(<expr>) op <expr> ...".

Fixes bug 30741.

llvm-svn: 284662

7 years agoRevert "DenseSet: Appease msc18 to define derived constructors explicitly."
Reid Kleckner [Wed, 19 Oct 2016 23:04:57 +0000 (23:04 +0000)]
Revert "DenseSet: Appease msc18 to define derived constructors explicitly."

This reverts commit r284570. MSVC 18 / 2013 is not supported anymore.

llvm-svn: 284661

7 years agoUpdate docs to reflect new minimum MSVC version requirement
Reid Kleckner [Wed, 19 Oct 2016 23:04:41 +0000 (23:04 +0000)]
Update docs to reflect new minimum MSVC version requirement

Mailing list discussion about this:
http://lists.llvm.org/pipermail/llvm-dev/2016-September/104631.html

Code changes to simplify the ifdefs will come next, and can be reverted
without affecting the policy if someone needs it.

llvm-svn: 284660

7 years ago[PGO] Fix bogus warning for merging empty llvm profile file
Rong Xu [Wed, 19 Oct 2016 22:51:17 +0000 (22:51 +0000)]
[PGO] Fix bogus warning for merging empty llvm profile file

Profile runtime can generate an empty raw profile (when there is no function in
the shared library). This empty profile is treated as a text format profile.  A
test format profile without the flag of "#IR" is thought to be a clang
generated profile.  So in llvm profile merging, we will get a bogus warning of
"Merge IR generated profile with Clang generated profile."

The fix here is to skip the empty profile (when the buffer size is 0) for
profile merge.

Reviewers: vsk, davidxl

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

llvm-svn: 284659

7 years ago[cmake] Follow LLVM's lead in creating exported tool targets for clang tools.
Michael Gottesman [Wed, 19 Oct 2016 22:46:06 +0000 (22:46 +0000)]
[cmake] Follow LLVM's lead in creating exported tool targets for clang tools.

This is needed by downstream projects such as swift to get proper cmake
dependency information for LLVM/Clang targets.

A few months ago I added support for exporting this information for Clang
libraries. In order to be incremental, I did not add support for exporting clang
tools as well at that time. Now such support is needed, so I am committing this
incremental code.

llvm-svn: 284658

7 years ago[BuildingAJIT] Use the remote target triple to construct the TargetMachine in
Lang Hames [Wed, 19 Oct 2016 22:41:03 +0000 (22:41 +0000)]
[BuildingAJIT] Use the remote target triple to construct the TargetMachine in
Chapter 5.

Chapter 5 demonstrates remote JITing: code is executed on the remote, not the
machine running the REPL, so it's the remote's triple (and TargetMachine) that
we need.

llvm-svn: 284657

7 years agoAdd computeHostNumPhysicalCores() implementation for Darwin
Mehdi Amini [Wed, 19 Oct 2016 22:36:07 +0000 (22:36 +0000)]
Add computeHostNumPhysicalCores() implementation for Darwin

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

llvm-svn: 284656

7 years agoAMDGPU : Add a function to enable and disable IEEEBit for SC and shader
Wei Ding [Wed, 19 Oct 2016 22:34:49 +0000 (22:34 +0000)]
AMDGPU : Add a function to enable and disable IEEEBit for SC and shader
respectively.

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

llvm-svn: 284655

7 years agoRemove the JIT EH/small code model tests for now.
Lang Hames [Wed, 19 Oct 2016 22:19:38 +0000 (22:19 +0000)]
Remove the JIT EH/small code model tests for now.

These tests rely on two sections being allocated with a limited displacement
from one to the other to work. We've never guaranteed this, and consequently
these tests usually fail. That led to them being XFAILed, but now they XPASS
whenever the sections do happen to be allocated nearby in memory. So I'm
removing these for now to get rid of the noise. We can re-instate them if/when
we take the time to implement a displacement-respecting allocator.

llvm-svn: 284654

7 years agoAdd optimization to sizeof...(X) handling: if none of parameter pack X's
Richard Smith [Wed, 19 Oct 2016 22:18:42 +0000 (22:18 +0000)]
Add optimization to sizeof...(X) handling: if none of parameter pack X's
corresponding arguments are unexpanded pack expansions, we can compute the
result without substituting them. This significantly improves the memory usage
and performance of make_integer_sequence implementations that do this kind of
thing:

  using result = integer_sequence<T, Ns ..., sizeof...(Ns) + Ns ...>;

... but note that such an implementation will still perform O(sizeof...(Ns)^2)
work while building the second pack expansion (we just have a somewhat lower
constant now).

In principle we could get this down to linear time by caching whether the
number of expansions of a pack is constant, or checking whether we're within an
alias template before scanning the pack for pack expansions (since that's the
only case in which we do substitutions within a dependent context at the
moment), but this patch doesn't attempt that.

llvm-svn: 284653