platform/upstream/llvm.git
9 years agoclang-format: [JS] Try not to break in container literals.
Daniel Jasper [Thu, 27 Nov 2014 15:24:48 +0000 (15:24 +0000)]
clang-format: [JS] Try not to break in container literals.

Before:
  var obj = {
    fooooooooo:
        function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); }
  };

After:
  var obj = {
    fooooooooo: function(x) {
      return x.zIsTooLongForOneLineWithTheDeclarationLine();
    }
  };

llvm-svn: 222892

9 years agoreinstate r222872: Peephole optimization in switch table lookup: reuse the guarding...
Erik Eckstein [Thu, 27 Nov 2014 15:13:14 +0000 (15:13 +0000)]
reinstate r222872: Peephole optimization in switch table lookup: reuse the guarding table comparison if possible.

Fixed missing dominance check.
Original commit message:

This optimization tries to reuse the generated compare instruction, if there is a comparison against the default value after the switch.
Example:
   if (idx < tablesize)
      r = table[idx]; // table does not contain default_value
   else
      r = default_value;
   if (r != default_value)
      ...
Is optimized to:
   cond = idx < tablesize;
   if (cond)
      r = table[idx];
   else
      r = default_value;
   if (cond)
      ...
Jump threading will then eliminate the second if(cond).

llvm-svn: 222891

9 years agoclang-format: [JS] new and delete are valid function names.
Daniel Jasper [Thu, 27 Nov 2014 14:55:17 +0000 (14:55 +0000)]
clang-format: [JS] new and delete are valid function names.

Before:
  someObject.new ();
  someObject.delete ();

After:
  someObject.new();
  someObject.delete();

llvm-svn: 222890

9 years ago[msan] Remove indirect call wrapping code.
Evgeniy Stepanov [Thu, 27 Nov 2014 14:54:02 +0000 (14:54 +0000)]
[msan] Remove indirect call wrapping code.

This functionality was only used in MSanDR, which is deprecated.

llvm-svn: 222889

9 years agoclang-format: [JS] Make Closure module detection more narrow.
Daniel Jasper [Thu, 27 Nov 2014 14:46:03 +0000 (14:46 +0000)]
clang-format: [JS] Make Closure module detection more narrow.

Before:
  var MyLongClassName = goog.module.get('my.long.module.name.followedBy.MyLongClassName');

After:
  var MyLongClassName =
      goog.module.get('my.long.module.name.followedBy.MyLongClassName');

llvm-svn: 222888

9 years ago[mips][microMIPS] Implement disassembler support for 16-bit instructions LI16, ADDIUR...
Jozef Kolek [Thu, 27 Nov 2014 14:41:44 +0000 (14:41 +0000)]
[mips][microMIPS] Implement disassembler support for 16-bit instructions LI16, ADDIUR1SP, ADDIUR2 and ADDIUS5

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

llvm-svn: 222887

9 years agoclang-format: Don't use column layout with AlignAfterOpenBrackets.
Daniel Jasper [Thu, 27 Nov 2014 14:40:48 +0000 (14:40 +0000)]
clang-format: Don't use column layout with AlignAfterOpenBrackets.

This fixes llvm.org/PR21676.

llvm-svn: 222886

9 years ago[Msan] Fix some interceptors to pass initialization on FreeBSD
Viktor Kutuzov [Thu, 27 Nov 2014 14:28:57 +0000 (14:28 +0000)]
[Msan] Fix some interceptors to pass initialization on FreeBSD
Differential Revision: http://reviews.llvm.org/D6417

llvm-svn: 222885

9 years agoA little more work on the compact unwind dumper.
Jason Molenda [Thu, 27 Nov 2014 13:21:38 +0000 (13:21 +0000)]
A little more work on the compact unwind dumper.
UNWIND_X86_64_MODE_STACK_IND mode is almost correct; extra stack
space allocated before the reg saves isn't handled right.  Still a
little wobbily on the file addresses of functions.  Finally understand
how the 6 registers that may be saved are ordered in just 10 its
of space -- the Lehmer code for the registers is derived and then
the sequence is encoded in a variable base number.  Added some
comments with references to what the code is doing so it'll be
easier for others to track down.

llvm-svn: 222884

9 years agoStop uppercasing build attribute data.
Charlie Turner [Thu, 27 Nov 2014 12:13:56 +0000 (12:13 +0000)]
Stop uppercasing build attribute data.

The string data for string-valued build attributes were being unconditionally
uppercased. There is no mention in the ARM ABI addenda about case conventions,
so it's technically implementation defined as to whether the data are
capitialised in some way or not. However, there are good reasons not to
captialise the data.

  * It's less work.
  * Some vendors may legitimately have case-sensitive checks for these
    attributes which would fail on LLVM generated object files.
  * There could be locale issues with uppercasing.

The original reasons for uppercasing appear to have stemmed from an
old codesourcery toolchain behaviour, see

http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/87133

This patch makes the object file emitted no longer captialise string
data, it encodes as seen in the assembly source.

Change-Id: Ibe20dd6e60d2773d57ff72a78470839033aa5538
llvm-svn: 222882

9 years agoUse FileCheck instead of grep. Change by Ankur Garg.
Suyog Sarda [Thu, 27 Nov 2014 11:22:49 +0000 (11:22 +0000)]
Use FileCheck instead of grep. Change by Ankur Garg.

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

llvm-svn: 222879

9 years ago[clang-tidy] Support initializer_list in google-explicit-constructor check
Alexander Kornienko [Thu, 27 Nov 2014 11:11:47 +0000 (11:11 +0000)]
[clang-tidy] Support initializer_list in google-explicit-constructor check

Summary:
According to the Google C++ Style Guide, constructors taking a single
std::initializer_list<> should not be marked explicit.

This change also changes the messages according to conventions used in Clang
diagnostics: no capitalization of the first letter, no trailing dot.

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

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

llvm-svn: 222878

9 years agoRevert "Peephole optimization in switch table lookup: reuse the guarding table compar...
Erik Eckstein [Thu, 27 Nov 2014 10:59:08 +0000 (10:59 +0000)]
Revert "Peephole optimization in switch table lookup: reuse the guarding table comparison if possible."

It is breaking the clang bootstrag.

llvm-svn: 222877

9 years agoUse FileCheck instead of grep. Change by Sonam.
Suyog Sarda [Thu, 27 Nov 2014 10:57:24 +0000 (10:57 +0000)]
Use FileCheck instead of grep. Change by Sonam.

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

llvm-svn: 222876

9 years agoautoconf: Move libraries later to ensure that all symbols are found
Tobias Grosser [Thu, 27 Nov 2014 10:14:27 +0000 (10:14 +0000)]
autoconf: Move libraries later to ensure that all symbols are found

This fixes llvm.org/PR19540

llvm-svn: 222874

9 years agoAdd test for MI tokens.
Hafiz Abid Qadeer [Thu, 27 Nov 2014 09:19:46 +0000 (09:19 +0000)]
Add test for MI tokens.
This file tests the sequence of digits that can come before
an MI command.

Patch from dawn@burble.org.

llvm-svn: 222873

9 years agoPeephole optimization in switch table lookup: reuse the guarding table comparison...
Erik Eckstein [Thu, 27 Nov 2014 08:33:51 +0000 (08:33 +0000)]
Peephole optimization in switch table lookup: reuse the guarding table comparison if possible.

This optimization tries to reuse the generated compare instruction, if there is a comparison against the default value after the switch.
Example:
    if (idx < tablesize)
       r = table[idx]; // table does not contain default_value
    else
       r = default_value;
    if (r != default_value)
       ...
Is optimized to:
    cond = idx < tablesize;
    if (cond)
       r = table[idx];
    else
       r = default_value;
    if (cond)
       ...
\endcode
Jump threading will then eliminate the second if(cond).

llvm-svn: 222872

9 years agoInstCombine: Restore optimizations lost in r210006
David Majnemer [Thu, 27 Nov 2014 07:25:21 +0000 (07:25 +0000)]
InstCombine: Restore optimizations lost in r210006

This restores our ability to optimize:
(X & C) == 0 ? X ^ C : X  into  X | C
(X & C) != 0 ? X ^ C : X  into  X & ~C

llvm-svn: 222871

9 years agoAdd LLVMObject to LLVMExecutionEngine.
NAKAMURA Takumi [Thu, 27 Nov 2014 06:36:22 +0000 (06:36 +0000)]
Add LLVMObject to LLVMExecutionEngine.

llvm-svn: 222869

9 years agoInstSimplify: Restore optimizations lost in r210006
David Majnemer [Thu, 27 Nov 2014 06:32:46 +0000 (06:32 +0000)]
InstSimplify: Restore optimizations lost in r210006

This restores our ability to optimize:
(X & C) ? X & ~C : X  into  X & ~C
(X & C) ? X : X & ~C  into  X
(X & C) ? X | C : X  into  X
(X & C) ? X : X | C  into  X | C

llvm-svn: 222868

9 years ago[MCJIT] Remove the local symbol table from RuntimeDlyd - it's not needed.
Lang Hames [Thu, 27 Nov 2014 05:40:13 +0000 (05:40 +0000)]
[MCJIT] Remove the local symbol table from RuntimeDlyd - it's not needed.

All symbols have to be stored in the global symbol to enable
cross-rtdyld-instance linking, so the local symbol table content is
redundant.

llvm-svn: 222867

9 years ago[MCJIT] Update CMakeLists.txt for llvm-rtdyld to add Object as a requirement.
Lang Hames [Thu, 27 Nov 2014 04:18:50 +0000 (04:18 +0000)]
[MCJIT] Update CMakeLists.txt for llvm-rtdyld to add Object as a requirement.

Hopefully this will fix
http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/8271/steps/stage1_build/logs/stdio

llvm-svn: 222866

9 years ago[c++1z] Remove terse range-based for loops; they've been removed from
Richard Smith [Thu, 27 Nov 2014 01:54:27 +0000 (01:54 +0000)]
[c++1z] Remove terse range-based for loops; they've been removed from
consideration for C++17 for now. Update C++ status page to match.

llvm-svn: 222865

9 years ago[MCJIT] Replace JITEventListener::anchor (temporarily removed in r222861), and
Lang Hames [Thu, 27 Nov 2014 01:41:16 +0000 (01:41 +0000)]
[MCJIT] Replace JITEventListener::anchor (temporarily removed in r222861), and
move GDBRegistrationListener into ExecutionEngine to avoid layering violation.

llvm-svn: 222864

9 years agoWhen checking for uninitialized values, do not confuse "std::move" with every
Richard Trieu [Thu, 27 Nov 2014 01:29:32 +0000 (01:29 +0000)]
When checking for uninitialized values, do not confuse "std::move" with every
other function named "move".

llvm-svn: 222863

9 years agoRefactor SocketAddress::getaddrinfo - avoid calling IsValid if ::getaddrinfo has...
Oleksiy Vyalov [Thu, 27 Nov 2014 00:32:54 +0000 (00:32 +0000)]
Refactor SocketAddress::getaddrinfo - avoid calling IsValid if ::getaddrinfo has failed.
Otherwise, IsValid crashes on assertation in GetFamilyLength.

llvm-svn: 222862

9 years ago[MCJIT] Remove JITEventListener's anchor until I can determine the right place
Lang Hames [Thu, 27 Nov 2014 00:15:28 +0000 (00:15 +0000)]
[MCJIT] Remove JITEventListener's anchor until I can determine the right place
to put it. This should unbreak the Mips bots.

llvm-svn: 222861

9 years agoTeach LLVM about llgo subproject.
Peter Collingbourne [Thu, 27 Nov 2014 00:15:21 +0000 (00:15 +0000)]
Teach LLVM about llgo subproject.

llvm-svn: 222860

9 years ago[MCJIT] Move get-any-symbol-load-address logic out of RuntimeDyld and into
Lang Hames [Thu, 27 Nov 2014 00:12:28 +0000 (00:12 +0000)]
[MCJIT] Move get-any-symbol-load-address logic out of RuntimeDyld and into
RuntimeDyldChecker.

RuntimeDyld instances should only provide lookup for locally defined
symbols.

llvm-svn: 222859

9 years agoInitial commit of llgo third_party.
Peter Collingbourne [Thu, 27 Nov 2014 00:12:26 +0000 (00:12 +0000)]
Initial commit of llgo third_party.

llvm-svn: 222858

9 years agoInitial commit of llgo.
Peter Collingbourne [Thu, 27 Nov 2014 00:06:42 +0000 (00:06 +0000)]
Initial commit of llgo.

llvm-svn: 222857

9 years agoRevert "Added inst combine transforms for single bit tests from Chris's note"
David Majnemer [Wed, 26 Nov 2014 23:00:38 +0000 (23:00 +0000)]
Revert "Added inst combine transforms for single bit tests from Chris's note"

This reverts commit r210006, it miscompiled libapr which is used in who
knows how many projects.

A test has been added to ensure that we don't regress again.

I'll work on a rewrite of what the optimization was trying to do later.

llvm-svn: 222856

9 years agoAdd a small "usage:" comment at the top of not.cpp
Sean Silva [Wed, 26 Nov 2014 22:53:46 +0000 (22:53 +0000)]
Add a small "usage:" comment at the top of not.cpp

Mostly pulled from Rafael's r185678 commit message.

llvm-svn: 222855

9 years agoCreate directories for llgo subproject.
Peter Collingbourne [Wed, 26 Nov 2014 22:50:16 +0000 (22:50 +0000)]
Create directories for llgo subproject.

llvm-svn: 222854

9 years agoOpenCL: fix test for lack of names in release builds
Tim Northover [Wed, 26 Nov 2014 22:33:04 +0000 (22:33 +0000)]
OpenCL: fix test for lack of names in release builds

llvm-svn: 222853

9 years agoObject/COFF: Fix off-by-one error for object having lots of relocations
Rui Ueyama [Wed, 26 Nov 2014 22:17:25 +0000 (22:17 +0000)]
Object/COFF: Fix off-by-one error for object having lots of relocations

llvm-objdump printed out an error message for this off-by-one error,
but because it always exits with 0 whether or not it found an error,
the test (llvm-objdump/coff-many-relocs.test) succeeded.
I made llvm-objdump exit with EXIT_FAILURE when an error is found.

llvm-svn: 222852

9 years ago[analyzer] Indented code within the DisplayHelp sub.
Anton Yartsev [Wed, 26 Nov 2014 21:53:39 +0000 (21:53 +0000)]
[analyzer] Indented code within the DisplayHelp sub.

llvm-svn: 222851

9 years agoR600/SI: Use ZeroOrNegativeOneBooleanContent
Matt Arsenault [Wed, 26 Nov 2014 21:23:15 +0000 (21:23 +0000)]
R600/SI: Use ZeroOrNegativeOneBooleanContent

This sort of doesn't matter since the setcc type is i1, but
this previously was using the default UndefinedBooleanContent. This
makes it more consistent with R600. This enables more optimizations
which typically give up on UndefinedBooleanContent. For example,
there is already a special case target DAG combine for
setcc + sext which can be eliminated in favor of what the generic
DAG combiner can do if it assumes boolean values are sign extended.
Since -1 is an inline immediate, using it is basically free and the
backend already uses it when a boolean value is needed in a wider type.

llvm-svn: 222850

9 years ago[Hexagon] Adding cmp* immediate form instructions.
Colin LeMahieu [Wed, 26 Nov 2014 19:43:12 +0000 (19:43 +0000)]
[Hexagon] Adding cmp* immediate form instructions.

llvm-svn: 222849

9 years agoFix buildbot failure on LLP64 platforms like MSVC x86_64.
Richard Smith [Wed, 26 Nov 2014 19:37:39 +0000 (19:37 +0000)]
Fix buildbot failure on LLP64 platforms like MSVC x86_64.

llvm-svn: 222848

9 years ago[mips][microMIPS] Implement disassembler support for 16-bit instructions LBU16, LHU16...
Jozef Kolek [Wed, 26 Nov 2014 18:56:38 +0000 (18:56 +0000)]
[mips][microMIPS] Implement disassembler support for 16-bit instructions LBU16, LHU16, LW16, SB16, SH16 and SW16

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

llvm-svn: 222847

9 years ago[Hexagon] Adding and64, or64, and xor64 instructions.
Colin LeMahieu [Wed, 26 Nov 2014 18:55:59 +0000 (18:55 +0000)]
[Hexagon] Adding and64, or64, and xor64 instructions.

llvm-svn: 222846

9 years agoFix several test failures on Linux/FreeBSD caused by compiler configuration and inval...
Oleksiy Vyalov [Wed, 26 Nov 2014 18:30:04 +0000 (18:30 +0000)]
Fix several test failures on Linux/FreeBSD caused by compiler configuration and invalid environment.

http://reviews.llvm.org/D6392

llvm-svn: 222845

9 years agoR600/SI: Create e64 versions of and/or/xor in SILowerI1Copies
Matt Arsenault [Wed, 26 Nov 2014 18:18:28 +0000 (18:18 +0000)]
R600/SI: Create e64 versions of and/or/xor in SILowerI1Copies

This fixes moving boolean constants into registers before operating
on them. They get permuted and shrunk down to e32 anyway later. This
is a temporary fix until the patch that removes these pseudos is
committed.

llvm-svn: 222844

9 years agoclang-format: [Java] Don't line-wrap package declarations.
Daniel Jasper [Wed, 26 Nov 2014 18:03:42 +0000 (18:03 +0000)]
clang-format: [Java] Don't line-wrap package declarations.

This fixes llvm.org/PR21677.

llvm-svn: 222843

9 years agolibc++: integral types trap on PNaCl
JF Bastien [Wed, 26 Nov 2014 17:51:58 +0000 (17:51 +0000)]
libc++: integral types trap on PNaCl

    Reviewers: dschuff, danalbert

    Subscribers: jfb, cfe-commits

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

llvm-svn: 222842

9 years ago[MCJIT] Fix missing return statement.
Lang Hames [Wed, 26 Nov 2014 17:21:41 +0000 (17:21 +0000)]
[MCJIT] Fix missing return statement.

llvm-svn: 222841

9 years ago[MCJIT] Reapply r222828 and r222810-r222812 with fix for MSVC move-op issues.
Lang Hames [Wed, 26 Nov 2014 16:54:40 +0000 (16:54 +0000)]
[MCJIT] Reapply r222828 and r222810-r222812 with fix for MSVC move-op issues.

llvm-svn: 222840

9 years agoclang-format: Tweak -style=Chromium for Java files.
Nico Weber [Wed, 26 Nov 2014 16:43:18 +0000 (16:43 +0000)]
clang-format: Tweak -style=Chromium for Java files.

For Java, don't do any of the deviations from Google Style that Chromium style
does for C++.

Chromium's Java follows Android Java style [1], which is roughly Google Java
style with an indent of 4 and a continuation indent of 8.

1: https://source.android.com/source/code-style.html
llvm-svn: 222839

9 years agoImprove lldb-mi tests.
Hafiz Abid Qadeer [Wed, 26 Nov 2014 16:37:51 +0000 (16:37 +0000)]
Improve lldb-mi tests.

summary of changes:
  Cleanup: Use "line_number" API instead of hardcoded source lines
  Combine child.sendline with previous child.send command.
  test_lldbmi_tokens: Add test for MI tokens.
  test_lldbmi_badpathexe: Remove check for prompt so test for bad path can be enabled.

Patch from dawn@burble.org.

llvm-svn: 222838

9 years agoAdding an explicit triple to this test to get it to pass all build bots.
Aaron Ballman [Wed, 26 Nov 2014 16:17:20 +0000 (16:17 +0000)]
Adding an explicit triple to this test to get it to pass all build bots.

llvm-svn: 222837

9 years ago[asan] Disable preload tests on Android.
Evgeniy Stepanov [Wed, 26 Nov 2014 15:44:15 +0000 (15:44 +0000)]
[asan] Disable preload tests on Android.

They don't test what they claim to because LD_PRELOAD applies to "not" instead
of the actual test binary. And all Android tests run with LD_PRELOAD anyway.

llvm-svn: 222835

9 years ago[OpenCL] Implemented restrictions for pointer conversions specified in OpenCL v2.0.
Anastasia Stulova [Wed, 26 Nov 2014 15:36:41 +0000 (15:36 +0000)]
[OpenCL] Implemented restrictions for pointer conversions specified in OpenCL v2.0.

OpenCL v2.0 s6.5.5 restricts conversion of pointers to different address spaces:
- the named address spaces (__global, __local, and __private) => __generic - implicitly converted;
- __generic => named - with an explicit cast;
- named <=> named - disallowed;
- __constant <=> any other - disallowed.

llvm-svn: 222834

9 years agoReverting r222828 and r222810-r222812 as they broke the build on Windows.
Aaron Ballman [Wed, 26 Nov 2014 15:27:39 +0000 (15:27 +0000)]
Reverting r222828 and r222810-r222812 as they broke the build on Windows.

http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/11753

llvm-svn: 222833

9 years ago[OpenCL] Generic address space parsing and diagnostics test (forgotten previously)
Anastasia Stulova [Wed, 26 Nov 2014 14:14:05 +0000 (14:14 +0000)]
[OpenCL] Generic address space parsing and diagnostics test (forgotten previously)

llvm-svn: 222832

9 years ago[OpenCL] Generic address space has been added in OpenCL v2.0.
Anastasia Stulova [Wed, 26 Nov 2014 14:10:06 +0000 (14:10 +0000)]
[OpenCL] Generic address space has been added in OpenCL v2.0.

To support it in the frontend, the following has been added:
- generic address space type attribute;
- documentation for the OpenCL address space attributes;
- parsing of __generic(generic) keyword;
- test code for the parser and diagnostics.

llvm-svn: 222831

9 years agoRemoving a spurious semicolon; NFC
Aaron Ballman [Wed, 26 Nov 2014 13:55:55 +0000 (13:55 +0000)]
Removing a spurious semicolon; NFC

llvm-svn: 222830

9 years agoclang-format: [Java] Improve formatting of throws declarations.
Daniel Jasper [Wed, 26 Nov 2014 12:31:19 +0000 (12:31 +0000)]
clang-format: [Java] Improve formatting of throws declarations.

Before:
  public void doSoooooooooo() throws LoooooooooongException,
      LooooooooooongException {}

After:
  public void doSoooooooooo()
      throws LoooooooooongException, LooooooooooongException {}

llvm-svn: 222829

9 years agoAdd missing "override".
Evgeniy Stepanov [Wed, 26 Nov 2014 12:26:03 +0000 (12:26 +0000)]
Add missing "override".

Fixes compilation failure in r222810.

llvm-svn: 222828

9 years agoclang-format: [Java] Improve cast detection.
Daniel Jasper [Wed, 26 Nov 2014 12:23:10 +0000 (12:23 +0000)]
clang-format: [Java] Improve cast detection.

Before:
  a[b >> 1] = (byte)(c() << 4);

After:
  a[b >> 1] = (byte) (c() << 4);

llvm-svn: 222827

9 years ago[Asan] Fix the heavy_uar_test.cc test to pass on FreeBSD
Viktor Kutuzov [Wed, 26 Nov 2014 11:38:45 +0000 (11:38 +0000)]
[Asan] Fix the heavy_uar_test.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D6406

llvm-svn: 222826

9 years agoclang-format: [Java] Fix breaking after annotations.
Daniel Jasper [Wed, 26 Nov 2014 11:20:43 +0000 (11:20 +0000)]
clang-format: [Java] Fix breaking after annotations.

Before:
  @Annotation1 // comment
  @Annotation2 class C {}

After:
  @Annotation1 // comment
  @Annotation2
  class C {}

llvm-svn: 222825

9 years agoRename R_AARCH64_TLSDESC_ADR_PAGE to R_AARCH64_TLSDESC_ADR_PAGE21
Will Newton [Wed, 26 Nov 2014 11:00:03 +0000 (11:00 +0000)]
Rename R_AARCH64_TLSDESC_ADR_PAGE to R_AARCH64_TLSDESC_ADR_PAGE21

llvm-svn: 222823

9 years ago[Msan] Exclude non-FreeBSD interceptors on FreeBSD
Viktor Kutuzov [Wed, 26 Nov 2014 10:51:49 +0000 (10:51 +0000)]
[Msan] Exclude non-FreeBSD interceptors on FreeBSD
Differential Revision: http://reviews.llvm.org/D6404

llvm-svn: 222822

9 years agoUpdate AArch64 ELF relocations to ABI 1.0
Will Newton [Wed, 26 Nov 2014 10:49:18 +0000 (10:49 +0000)]
Update AArch64 ELF relocations to ABI 1.0

This mostly entails adding relocations, however there are a couple of
changes to existing relocations:

1. R_AARCH64_NONE is defined to be zero rather than 256

R_AARCH64_NONE has been defined to be zero for a long time elsewhere
e.g. binutils and glibc since the submission of the AArch64 port in
2012 so this is required for compatibility.

2. R_AARCH64_TLSDESC_ADR_PAGE renamed to R_AARCH64_TLSDESC_ADR_PAGE21

I don't think there is any way for relocation names to leak out of LLVM
so this should not break anything.

Tested with check-all with no regressions.

llvm-svn: 222821

9 years agoAVX-512: Scalar ERI intrinsics
Elena Demikhovsky [Wed, 26 Nov 2014 10:46:49 +0000 (10:46 +0000)]
AVX-512: Scalar ERI intrinsics
including SAE mode and memory operand.
Added AVX512_maskable_scalar template, that should cover all scalar instructions in the future.

The main difference between AVX512_maskable_scalar<> and AVX512_maskable<> is using X86select instead of vselect.
I need it, because I can't create vselect node for MVT::i1 mask for scalar instruction.

http://reviews.llvm.org/D6378

llvm-svn: 222820

9 years agoclang-format: Add SFS_Empty to only empty functions on a single line.
Daniel Jasper [Wed, 26 Nov 2014 10:43:58 +0000 (10:43 +0000)]
clang-format: Add SFS_Empty to only empty functions on a single line.

Activated for and tested by Google's Java style.

This fixes llvm.org/PR21667.

llvm-svn: 222819

9 years ago[Msan] Check returning value of DTLS_Get()
Viktor Kutuzov [Wed, 26 Nov 2014 10:42:02 +0000 (10:42 +0000)]
[Msan] Check returning value of DTLS_Get()
Differential Revision: http://reviews.llvm.org/D6403

llvm-svn: 222818

9 years agoUpdate ARM ELF relocations to ABI 2.09
Will Newton [Wed, 26 Nov 2014 10:36:03 +0000 (10:36 +0000)]
Update ARM ELF relocations to ABI 2.09

Add R_ARM_IRELATIVE.

llvm-svn: 222817

9 years agoRe-order the base classes to prevent a crash in Linux.
Hafiz Abid Qadeer [Wed, 26 Nov 2014 10:19:32 +0000 (10:19 +0000)]
Re-order the base classes to prevent a crash in Linux.

In the initialization list of IOHandlerConfirm, *this is basically casting
IOHandlerConfirm to its base IOHandlerDelegate and passing it to constructor of
IOHandlerEditline which uses it and crashes as constructor of IOHandlerDelegate
is still not called. Re-ordering the base classes makes sure that constructor of
IOHandlerDelegate runs first.

It would be good to have a test case for this case too.

llvm-svn: 222816

9 years agoFix comment in AArch64 ELF backend
Will Newton [Wed, 26 Nov 2014 09:51:54 +0000 (09:51 +0000)]
Fix comment in AArch64 ELF backend

llvm-svn: 222814

9 years agoclang-format: [Java] Support Foo.class;
Daniel Jasper [Wed, 26 Nov 2014 08:17:08 +0000 (08:17 +0000)]
clang-format: [Java] Support Foo.class;

Before:
  SomeClass.
  class.getName();

After:
  SomeClass.class.getName();

This fixes llvm.org/PR21665.

llvm-svn: 222813

9 years ago[MCJIT] Re-enable GDB registration (temporarily disabled in r222811), but check
Lang Hames [Wed, 26 Nov 2014 07:39:03 +0000 (07:39 +0000)]
[MCJIT] Re-enable GDB registration (temporarily disabled in r222811), but check
that we actually have an object to register first.

For MachO objects, RuntimeDyld::LoadedObjectInfo::getObjectForDebug returns an
empty OwningBinary<ObjectFile> which was causing crashes in the GDB registration
code.

llvm-svn: 222812

9 years ago[MCJIT] Temporarily disable automatic JIT debugger registration.
Lang Hames [Wed, 26 Nov 2014 07:25:26 +0000 (07:25 +0000)]
[MCJIT] Temporarily disable automatic JIT debugger registration.

The RuntimeDyld cleanup patch r222810 turned on GDB registration for MachO
objects. I expected this to be harmless, but it seems to have broken on
MacsOS. Temporarily disabling debugger registration while I dig in to what's
gone wrong.

llvm-svn: 222811

9 years ago[MCJIT] Clean up RuntimeDyld's quirky object-ownership/modification scheme.
Lang Hames [Wed, 26 Nov 2014 06:53:26 +0000 (06:53 +0000)]
[MCJIT] Clean up RuntimeDyld's quirky object-ownership/modification scheme.

Previously, when loading an object file, RuntimeDyld (1) took ownership of the
ObjectFile instance (and associated MemoryBuffer), (2) potentially modified the
object in-place, and (3) returned an ObjectImage that managed ownership of the
now-modified object and provided some convenience methods. This scheme accreted
over several years as features were tacked on to RuntimeDyld, and was both
unintuitive and unsafe (See e.g. http://llvm.org/PR20722).

This patch fixes the issue by removing all ownership and in-place modification
of object files from RuntimeDyld. Existing behavior, including debugger
registration, is preserved.

Noteworthy changes include:

(1) ObjectFile instances are now passed to RuntimeDyld by const-ref.
(2) The ObjectImage and ObjectBuffer classes have been removed entirely, they
    existed to model ownership within RuntimeDyld, and so are no longer needed.
(3) RuntimeDyld::loadObject now returns an instance of a new class,
    RuntimeDyld::LoadedObjectInfo, which can be used to construct a modified
    object suitable for registration with the debugger, following the existing
    debugger registration scheme.
(4) The JITRegistrar class has been removed, and the GDBRegistrar class has been
    re-written as a JITEventListener.

This should fix http://llvm.org/PR20722 .

llvm-svn: 222810

9 years agoRemove neverHasSideEffects support from TableGen CodeGenInstruction. Everyone should...
Craig Topper [Wed, 26 Nov 2014 04:11:14 +0000 (04:11 +0000)]
Remove neverHasSideEffects support from TableGen CodeGenInstruction. Everyone should use hasSideEffects now.

llvm-svn: 222809

9 years agoTry to make the modules buildbot happy again.
Richard Smith [Wed, 26 Nov 2014 03:44:47 +0000 (03:44 +0000)]
Try to make the modules buildbot happy again.

llvm-svn: 222808

9 years ago[c++1z] Most of N4268 (allow constant evaluation for non-type template arguments).
Richard Smith [Wed, 26 Nov 2014 03:26:53 +0000 (03:26 +0000)]
[c++1z] Most of N4268 (allow constant evaluation for non-type template arguments).

We don't yet support pointer-to-member template arguments that have undergone
pointer-to-member conversions, mostly because we don't have a mangling for them yet.

llvm-svn: 222807

9 years agoReformat with gofmt.
Eric Christopher [Wed, 26 Nov 2014 02:57:33 +0000 (02:57 +0000)]
Reformat with gofmt.

llvm-svn: 222806

9 years agoMake SetMCJITOptimizationLevel more of a method and pass options
Eric Christopher [Wed, 26 Nov 2014 02:54:24 +0000 (02:54 +0000)]
Make SetMCJITOptimizationLevel more of a method and pass options
as a reference. Move closer to the type.

llvm-svn: 222805

9 years agoMake sure that the go bindings call LLVMInitializeMCJITCompilerOptions
Eric Christopher [Wed, 26 Nov 2014 02:27:46 +0000 (02:27 +0000)]
Make sure that the go bindings call LLVMInitializeMCJITCompilerOptions
so that they initialize the code generation model to the correct
(non-zero) default model.

llvm-svn: 222804

9 years ago[Sanitizer] Bump kMaxPathLength to 4096 and use it more extensively instead of hardco...
Alexey Samsonov [Wed, 26 Nov 2014 01:48:39 +0000 (01:48 +0000)]
[Sanitizer] Bump kMaxPathLength to 4096 and use it more extensively instead of hardcoded constants

llvm-svn: 222803

9 years agoUse SafelyCloseFileDescriptor instead of close.
Rui Ueyama [Wed, 26 Nov 2014 01:45:24 +0000 (01:45 +0000)]
Use SafelyCloseFileDescriptor instead of close.

Opening a file using openFileForWrite and closing it using close
was asymmetric. It also had a subtle portability problem (details are
described in the commit message for r219189).

llvm-svn: 222802

9 years agoReplace neverHasSideEffects=1 with hasSideEffects=0 in all .td files.
Craig Topper [Wed, 26 Nov 2014 00:46:26 +0000 (00:46 +0000)]
Replace neverHasSideEffects=1 with hasSideEffects=0 in all .td files.

llvm-svn: 222801

9 years ago[ASan] Fix typo in test
Alexey Samsonov [Wed, 26 Nov 2014 00:23:51 +0000 (00:23 +0000)]
[ASan] Fix typo in test

llvm-svn: 222800

9 years ago[PECOFF] Properly close a file descriptor.
Rui Ueyama [Wed, 26 Nov 2014 00:21:27 +0000 (00:21 +0000)]
[PECOFF] Properly close a file descriptor.

This was basically benign resource leak on Unix, but on Windows
it could cause builds to fail because opened file descriptor
prevents other processes from moving or removing the file.

llvm-svn: 222799

9 years agoCodeGen: Fix emission of __atomic_compare_exchange
David Majnemer [Tue, 25 Nov 2014 23:44:32 +0000 (23:44 +0000)]
CodeGen: Fix emission of __atomic_compare_exchange

We (wrongly) discarded the return value of the call.

llvm-svn: 222798

9 years agoEnsure that any TypoExprs in the arguments to bultins with custom type
Kaelyn Takata [Tue, 25 Nov 2014 23:04:09 +0000 (23:04 +0000)]
Ensure that any TypoExprs in the arguments to bultins with custom type
checking are handled before the custom type checking is performed.

Fixes PR21669.

llvm-svn: 222797

9 years ago[X86][SSE] Improvements to byte shift shuffle matching
Simon Pilgrim [Tue, 25 Nov 2014 22:34:59 +0000 (22:34 +0000)]
[X86][SSE] Improvements to byte shift shuffle matching

Since (v)pslldq / (v)psrldq instructions resolve to a single input argument it is useful to match it much earlier than we currently do - this prevents more complicated shuffles (notably insertion into a zero vector) matching before it.

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

llvm-svn: 222796

9 years ago[Hexagon] Adding add64 and sub64 instructions.
Colin LeMahieu [Tue, 25 Nov 2014 22:15:44 +0000 (22:15 +0000)]
[Hexagon] Adding add64 and sub64 instructions.

llvm-svn: 222795

9 years agoFixes to get libc++ building on sun solaris. Patch from C Bergstrom.
Eric Fiselier [Tue, 25 Nov 2014 21:57:41 +0000 (21:57 +0000)]
Fixes to get libc++ building on sun solaris. Patch from C Bergstrom.

llvm-svn: 222794

9 years agoReverting 222792
Colin LeMahieu [Tue, 25 Nov 2014 21:39:57 +0000 (21:39 +0000)]
Reverting 222792

llvm-svn: 222793

9 years ago[Hexagon] Adding compare with immediate instructions.
Colin LeMahieu [Tue, 25 Nov 2014 21:30:28 +0000 (21:30 +0000)]
[Hexagon] Adding compare with immediate instructions.

llvm-svn: 222792

9 years ago[Hexagon] Adding NOP encoding bits.
Colin LeMahieu [Tue, 25 Nov 2014 21:23:07 +0000 (21:23 +0000)]
[Hexagon] Adding NOP encoding bits.

llvm-svn: 222791

9 years agoGo bindings: add DIBuilder.InsertValueAtEnd
Peter Collingbourne [Tue, 25 Nov 2014 21:05:04 +0000 (21:05 +0000)]
Go bindings: add DIBuilder.InsertValueAtEnd

Expose llvm::DIBuilder::insertDbgValueIntrinsic as
DIBuilder.InsertValueAtEnd in the Go bindings, to support attaching
debug metadata to register values.

Patch by Andrew Wilkins!

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

llvm-svn: 222790

9 years agoR600/SI: Only use one DEBUG()
Matt Arsenault [Tue, 25 Nov 2014 21:03:22 +0000 (21:03 +0000)]
R600/SI: Only use one DEBUG()

llvm-svn: 222789

9 years agoThis test requires asserts because of -stats.
Rafael Espindola [Tue, 25 Nov 2014 20:56:56 +0000 (20:56 +0000)]
This test requires asserts because of -stats.

Sorry about that.

llvm-svn: 222788

9 years agogold plugin: call llvm_shutdown so that -stats works.
Rafael Espindola [Tue, 25 Nov 2014 20:52:49 +0000 (20:52 +0000)]
gold plugin: call llvm_shutdown so that -stats works.

llvm-svn: 222787

9 years ago[AVX512] Add 512b integer shift by variable intrinsics and patterns.
Cameron McInally [Tue, 25 Nov 2014 20:41:51 +0000 (20:41 +0000)]
[AVX512] Add 512b integer shift by variable intrinsics and patterns.

llvm-svn: 222786

9 years ago[Hexagon] [NFC] Adding trailing whitespace to test files.
Colin LeMahieu [Tue, 25 Nov 2014 20:22:24 +0000 (20:22 +0000)]
[Hexagon] [NFC] Adding trailing whitespace to test files.

llvm-svn: 222785