platform/upstream/llvm.git
10 years agoAdd MapVector::rbegin(), MapVector::rend() to completment MapVector::begin(), MapVect...
Michael Gottesman [Mon, 27 Oct 2014 17:20:53 +0000 (17:20 +0000)]
Add MapVector::rbegin(), MapVector::rend() to completment MapVector::begin(), MapVector::end().

These just delegate to the underlying vector type in the MapVector.

Also just add in some sanity unittests.

llvm-svn: 220687

10 years agoclang-format: Don't break after very short return types.
Daniel Jasper [Mon, 27 Oct 2014 17:13:59 +0000 (17:13 +0000)]
clang-format: Don't break after very short return types.

Before:
  void
  SomeFunction(int parameter);

After:
  void SomeFunction(
      int parameter);

(Unless AlwaysBreakAfterDefinitionReturnType after type is set).

llvm-svn: 220686

10 years agoclang-format: improve vim integration docs
Saleem Abdulrasool [Mon, 27 Oct 2014 17:13:33 +0000 (17:13 +0000)]
clang-format: improve vim integration docs

Improve the documentation for vim integration of clang-format.  Prefer the use
of <c-o> to do the normal mode command execution to avoid side-effects of the
escape and re-insertion (cursor movement).  Tweak the macros to use a double
return to avoid having to manually return control to the editor from the
subprocess.

llvm-svn: 220685

10 years agoclang-format: Fix bad merging of lines in nested blocks.
Daniel Jasper [Mon, 27 Oct 2014 16:31:46 +0000 (16:31 +0000)]
clang-format: Fix bad merging of lines in nested blocks.

Before:
  SomeFunction([]() {
  #define A a
    return 43; });

After:
  SomeFunction([]() {
  #define A a
    return 43;
  });

llvm-svn: 220684

10 years agoUnbreak the darwin build.
Adrian Prantl [Mon, 27 Oct 2014 16:20:59 +0000 (16:20 +0000)]
Unbreak the darwin build.
Patch by Ismail Pazarbasi!

llvm-svn: 220683

10 years agoSpeed up clang-tidy when profiling in on.
Samuel Benzaquen [Mon, 27 Oct 2014 15:22:59 +0000 (15:22 +0000)]
Speed up clang-tidy when profiling in on.

Summary:
Speed up clang-tidy when profiling in on.
It makes profiling runs twice as fast by reusing the time samples between the
different actions.
It also joins together the sampling of different matchers of the same check.

Reviewers: alexfh

Subscribers: klimek, cfe-commits

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

llvm-svn: 220682

10 years agoSkip ObjC test on FreeBSD that does not build
Ed Maste [Mon, 27 Oct 2014 15:01:59 +0000 (15:01 +0000)]
Skip ObjC test on FreeBSD that does not build

llvm-svn: 220681

10 years agoAllow thread sanitizer in clang driver on FreeBSD
Viktor Kutuzov [Mon, 27 Oct 2014 13:51:25 +0000 (13:51 +0000)]
Allow thread sanitizer in clang driver on FreeBSD
http://reviews.llvm.org/D5999

llvm-svn: 220680

10 years agoclang-format: [Proto] Change formatting text-formatted options.
Daniel Jasper [Mon, 27 Oct 2014 13:25:59 +0000 (13:25 +0000)]
clang-format: [Proto] Change formatting text-formatted options.

Before:
  optional Type type = 1 [(mutate_options) = {vital : true
                                              abc : false}];

After:
  optional Type type = 1 [(mutate_options) = {
    vital : true
    abc : false
  }];

llvm-svn: 220679

10 years agoPrune CRLF.
NAKAMURA Takumi [Mon, 27 Oct 2014 12:37:26 +0000 (12:37 +0000)]
Prune CRLF.

llvm-svn: 220678

10 years agoRevert rL220675 due to failures on check-clang
Viktor Kutuzov [Mon, 27 Oct 2014 12:33:10 +0000 (12:33 +0000)]
Revert rL220675 due to failures on check-clang

llvm-svn: 220677

10 years ago[Tsan] Enable thread sanitizer tests on FreeBSD
Viktor Kutuzov [Mon, 27 Oct 2014 11:28:53 +0000 (11:28 +0000)]
[Tsan] Enable thread sanitizer tests on FreeBSD
Differential Revision: http://reviews.llvm.org/D5995

llvm-svn: 220676

10 years agoAllow thread sanitizer in clang driver on FreeBSD
Viktor Kutuzov [Mon, 27 Oct 2014 11:26:01 +0000 (11:26 +0000)]
Allow thread sanitizer in clang driver on FreeBSD
Differential Revision: http://reviews.llvm.org/D5994

llvm-svn: 220675

10 years ago[Tsan] Fix references to renamed variables in DPrintf()
Viktor Kutuzov [Mon, 27 Oct 2014 11:22:24 +0000 (11:22 +0000)]
[Tsan] Fix references to renamed variables in DPrintf()
Differential Revision: http://reviews.llvm.org/D5993

llvm-svn: 220674

10 years ago[Tsan] Make calloc() to not track allocated space unless thread is completely initialized
Viktor Kutuzov [Mon, 27 Oct 2014 11:19:08 +0000 (11:19 +0000)]
[Tsan] Make calloc() to not track allocated space unless thread is completely initialized
Differential Revision: http://reviews.llvm.org/D5992

llvm-svn: 220673

10 years ago[Tsan] Fix guessing data range on FreeBSD
Viktor Kutuzov [Mon, 27 Oct 2014 11:14:24 +0000 (11:14 +0000)]
[Tsan] Fix guessing data range on FreeBSD
Differential Revision: http://reviews.llvm.org/D5990

llvm-svn: 220672

10 years ago[ARM] Select VMAXNM and VMINNM regardless of operand order
Oliver Stannard [Mon, 27 Oct 2014 09:23:02 +0000 (09:23 +0000)]
[ARM] Select VMAXNM and VMINNM regardless of operand order

Currently, the ARM backend will select the VMAXNM and VMINNM for these C
expressions:
  (a < b) ? a : b
  (a > b) ? a : b
but not these expressions:
  (a > b) ? b : a
  (a < b) ? b : a

This patch allows all of these expressions to be matched.

llvm-svn: 220671

10 years ago[asan-asm-instrumentation] Added comment describing how asm instrumentation works.
Yuri Gorshenin [Mon, 27 Oct 2014 08:38:54 +0000 (08:38 +0000)]
[asan-asm-instrumentation] Added comment describing how asm instrumentation works.

Summary: [asan-asm-instrumentation] Added comment describing how asm instrumentation works.

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 220670

10 years agoRe-commit r220667.
Rui Ueyama [Mon, 27 Oct 2014 08:16:18 +0000 (08:16 +0000)]
Re-commit r220667.

C++ source given to check_cxx_source_compile should have define "main".

llvm-svn: 220669

10 years agoFix unicode chars into ascii in comment lines.
NAKAMURA Takumi [Mon, 27 Oct 2014 08:08:18 +0000 (08:08 +0000)]
Fix unicode chars into ascii in comment lines.

llvm-svn: 220668

10 years agoRevert "Include stddef.h before including cxxabi.h" to un-break buildbot
Rui Ueyama [Mon, 27 Oct 2014 08:03:21 +0000 (08:03 +0000)]
Revert "Include stddef.h before including cxxabi.h" to un-break buildbot

This reverts commit r220665.

llvm-svn: 220667

10 years agoRemove #ifdef __FreeBSD
Rui Ueyama [Mon, 27 Oct 2014 07:44:40 +0000 (07:44 +0000)]
Remove #ifdef __FreeBSD

r220665 makes configure or CMake to set HAVE_CXXABI_H on FreeBSD 10.0.
We don't need this ugly ifdef condition anymore.

llvm-svn: 220666

10 years agoInclude stddef.h before including cxxabi.h
Rui Ueyama [Mon, 27 Oct 2014 07:37:57 +0000 (07:37 +0000)]
Include stddef.h before including cxxabi.h

On FreeBSD 10.0, size_t needs to be defined before including cxxabi.h.
Currenty HAVE_CXXABI_H is not defined on FreeBSD because of that reason.
This patch teaches cmake and configure how to include it.

http://reviews.llvm.org/D5940

llvm-svn: 220665

10 years agoInstCombine: Fix a combine assuming that icmp operands were integers
David Majnemer [Mon, 27 Oct 2014 05:47:49 +0000 (05:47 +0000)]
InstCombine: Fix a combine assuming that icmp operands were integers

An icmp may have pointer arguments, it isn't limited to integers or
vectors of integers.

This fixes PR21388.

llvm-svn: 220664

10 years ago[Sanitizer] Return code that calculates hash for stacktrace back to StackDepot implem...
Alexey Samsonov [Mon, 27 Oct 2014 03:10:27 +0000 (03:10 +0000)]
[Sanitizer] Return code that calculates hash for stacktrace back to StackDepot implementation

llvm-svn: 220663

10 years agoLinkModules.cpp: don't repeat names in comments.
Rafael Espindola [Mon, 27 Oct 2014 02:35:46 +0000 (02:35 +0000)]
LinkModules.cpp: don't repeat names in comments.

llvm-svn: 220662

10 years agoFix the TestCreateAfterAttach test for llgs-local on ptracer lock-down.
Todd Fiala [Mon, 27 Oct 2014 00:58:27 +0000 (00:58 +0000)]
Fix the TestCreateAfterAttach test for llgs-local on ptracer lock-down.

llvm-svn: 220661

10 years agoFix TestProcessAttach for Linux ptracer lock-down and llgs-local.
Todd Fiala [Mon, 27 Oct 2014 00:31:05 +0000 (00:31 +0000)]
Fix TestProcessAttach for Linux ptracer lock-down and llgs-local.

llvm-svn: 220660

10 years agoFix 80-column and other odd formatting.
Eric Christopher [Sun, 26 Oct 2014 23:40:33 +0000 (23:40 +0000)]
Fix 80-column and other odd formatting.

llvm-svn: 220659

10 years agoRemove some unnecessary casts.
David Blaikie [Sun, 26 Oct 2014 23:37:04 +0000 (23:37 +0000)]
Remove some unnecessary casts.

llvm-svn: 220658

10 years agoMake VFS and FileManager match the current MemoryBuffer API.
Benjamin Kramer [Sun, 26 Oct 2014 22:44:13 +0000 (22:44 +0000)]
Make VFS and FileManager match the current MemoryBuffer API.

This eliminates converting back and forth between the 3 formats and
gives us a more homogeneous interface.

llvm-svn: 220657

10 years agoFix up TestRegisters for Linux ptracer lock-down.
Todd Fiala [Sun, 26 Oct 2014 22:25:33 +0000 (22:25 +0000)]
Fix up TestRegisters for Linux ptracer lock-down.

All of these test fixups are prep work for when llgs is
running with llgs for local process debugging, where these
tests fail without the ptracer lock-down suppression.

llvm-svn: 220656

10 years ago[PBQP] Tidying up as per Dave Blaikie's suggesions for r220642.
Lang Hames [Sun, 26 Oct 2014 22:12:02 +0000 (22:12 +0000)]
[PBQP] Tidying up as per Dave Blaikie's suggesions for r220642.

llvm-svn: 220655

10 years agoFix TestAttachResume test so it doesn't hang on Linux with ptrace lockdown.
Todd Fiala [Sun, 26 Oct 2014 22:08:56 +0000 (22:08 +0000)]
Fix TestAttachResume test so it doesn't hang on Linux with ptrace lockdown.

Similar to previous fix, this augments the test inferior to
immediately indicate it may be ptraced by any Linux process
when the appropriate symbols are defined.

This seems to indicate we need to fix our lldb attach logic to
catch when an attach fails, and trigger an appropriate error
instead of the current behavior of hanging indefinitely.

llvm-svn: 220654

10 years ago[PBQP] Explicitly define copy/move operations for NodeMetadata to keep VS happy.
Lang Hames [Sun, 26 Oct 2014 21:55:54 +0000 (21:55 +0000)]
[PBQP] Explicitly define copy/move operations for NodeMetadata to keep VS happy.

Hopefully this fixes the bug that was introduced in r220642, and not-quite-fixed
in r220649.

llvm-svn: 220653

10 years agoAdd an option to the LTO code generator to disable vectorization during LTO
Arnold Schwaighofer [Sun, 26 Oct 2014 21:50:58 +0000 (21:50 +0000)]
Add an option to the LTO code generator to disable vectorization during LTO

We used to always vectorize (slp and loop vectorize) in the LTO pass pipeline.

r220345 changed it so that we used the PassManager's fields 'LoopVectorize' and
'SLPVectorize' out of the desire to be able to disable vectorization using the
cl::opt flags 'vectorize-loops'/'slp-vectorize' which the before mentioned
fields default to.
Unfortunately, this turns off vectorization because those fields
default to false.
This commit adds flags to the LTO library to disable lto vectorization which
reconciles the desire to optionally disable vectorization during LTO and
the desired behavior of defaulting to enabled vectorization.

We really want tools to set PassManager flags directly to enable/disable
vectorization and not go the route via cl::opt flags *in*
PassManagerBuilder.cpp.

llvm-svn: 220652

10 years agoAdded a missing call to 'Reset'.
Hafiz Abid Qadeer [Sun, 26 Oct 2014 21:38:43 +0000 (21:38 +0000)]
Added a missing call to 'Reset'.
HostThreadWindows::Join() did not call the Reset as is done by
the HostThreadPosix::Join(). As a result, future call to
IsJoinable() can fail.

Committed as obvious.

llvm-svn: 220651

10 years agoFix HelloWorld attach test for Linux kernels with ptrace ancestor lockdown.
Todd Fiala [Sun, 26 Oct 2014 21:37:46 +0000 (21:37 +0000)]
Fix HelloWorld attach test for Linux kernels with ptrace ancestor lockdown.

Similar to a recent test I fixed for gdb-remote attach scenarios, this
fix is for Linux kernels, such as Ubuntu's stock setup on 11.04-ish and
later, where ptrace starts requiring a ptracer to be an ancestor of the
inferior to be ptraced.  This change checks for Linux and the ptrace-related
flags.  If they're found, it tries to switch on the "allow any ptracer" mode
for the inferior as the first statements in the program.  It's a best-effort
solution - if the prctl call fails, the failure is ignored, and probably will
lead to the test failing.

The ptrace security behavior can be modified system-wide, but is outside the
scope of the test to address.  Hence I went with this particular solution.

llvm-svn: 220650

10 years ago[PBQP] Re-commit r220642 with a workaround for quirky Visual Studio behavior.
Lang Hames [Sun, 26 Oct 2014 20:57:16 +0000 (20:57 +0000)]
[PBQP] Re-commit r220642 with a workaround for quirky Visual Studio behavior.

Apparently unique_ptr'ifying NodeMetadata exposed an issue in VS where it
occasionally tries to synthesize copy constructors instead of moves. Hopefully
explicitly deleting the copy constructor and defining the move constructor will
fix this.

llvm-svn: 220649

10 years ago[OCaml] Expose existing documentation in ocamldoc.
Peter Zotov [Sun, 26 Oct 2014 20:45:22 +0000 (20:45 +0000)]
[OCaml] Expose existing documentation in ocamldoc.

Patch by Gabriel Radanne <drupyog@zoho.com>.

llvm-svn: 220648

10 years agoChange the comment on the closing #endif to match the condition on the corresponding...
Marshall Clow [Sun, 26 Oct 2014 20:29:38 +0000 (20:29 +0000)]
Change the comment on the closing #endif to match the condition on the corresponding #ifdef. Thanks to K-ballo for the catch. No functionality change.

llvm-svn: 220647

10 years agoModuleMap.cpp: fix Windows build, take 2
Hans Wennborg [Sun, 26 Oct 2014 20:00:53 +0000 (20:00 +0000)]
ModuleMap.cpp: fix Windows build, take 2

llvm-svn: 220646

10 years agoRevert "[PBQP] Unique-ptrify some PBQP Metadata structures. No functional change...
Hans Wennborg [Sun, 26 Oct 2014 19:50:13 +0000 (19:50 +0000)]
Revert "[PBQP] Unique-ptrify some PBQP Metadata structures. No functional change." (r220642)

It broke the Windows build:

  [1/19] Building CXX object lib\CodeGen\CMakeFiles\LLVMCodeGen.dir\RegAllocPBQP.cpp.obj
  C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\llvm\include\llvm/CodeGen/RegAllocPBQP.h(132) : error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>'

     with
     [
         _Ty=unsigned int []
     ]
     D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\memory(1600) : see declaration of 'std::unique_ptr<_Ty>::unique_ptr'
     with
     [
         _Ty=unsigned int []
     ]
     This diagnostic occurred in the compiler generated function 'llvm::PBQP::RegAlloc::NodeMetadata::NodeMetadata(const llvm::PBQP::RegAlloc::NodeMetadata &)'

llvm-svn: 220645

10 years agoModuleMap.cpp: fix VS2012 build
Hans Wennborg [Sun, 26 Oct 2014 19:39:46 +0000 (19:39 +0000)]
ModuleMap.cpp: fix VS2012 build

llvm-svn: 220644

10 years agoTry to fix the Windows build after r220637
Hans Wennborg [Sun, 26 Oct 2014 19:27:02 +0000 (19:27 +0000)]
Try to fix the Windows build after r220637

llvm-svn: 220643

10 years ago[PBQP] Unique-ptrify some PBQP Metadata structures. No functional change.
Lang Hames [Sun, 26 Oct 2014 18:50:52 +0000 (18:50 +0000)]
[PBQP] Unique-ptrify some PBQP Metadata structures. No functional change.

llvm-svn: 220642

10 years ago[PBQP] Tidy up CostAllocator.h: fix variable case, rename CostPool to ValuePool.
Lang Hames [Sun, 26 Oct 2014 18:16:27 +0000 (18:16 +0000)]
[PBQP] Tidy up CostAllocator.h: fix variable case, rename CostPool to ValuePool.

No functional change. This just brings things more in-line with coding
standards, and makes ValuePool's functionality clearer (it's not tied to pooling
costs, and we may want to use it to hold other things in the future).

llvm-svn: 220641

10 years agoDelete unused method and clangAST dependency it required.
Daniel Jasper [Sun, 26 Oct 2014 14:26:55 +0000 (14:26 +0000)]
Delete unused method and clangAST dependency it required.

llvm-svn: 220640

10 years agoModuleMap::addHeader(): Appease msc17.
NAKAMURA Takumi [Sun, 26 Oct 2014 13:12:35 +0000 (13:12 +0000)]
ModuleMap::addHeader(): Appease msc17.

llvm-svn: 220639

10 years agoAVX-512: Fixed encoding of VPBROADCASTM and added SKX forms of this instruction
Elena Demikhovsky [Sun, 26 Oct 2014 09:52:24 +0000 (09:52 +0000)]
AVX-512: Fixed encoding of VPBROADCASTM and added SKX forms of this instruction

llvm-svn: 220638

10 years agoChange StackDepot interface to use StackTrace more extensively
Alexey Samsonov [Sun, 26 Oct 2014 06:23:07 +0000 (06:23 +0000)]
Change StackDepot interface to use StackTrace more extensively

llvm-svn: 220637

10 years agoFixup deadlock sanitizer after r220635
Alexey Samsonov [Sun, 26 Oct 2014 05:43:17 +0000 (05:43 +0000)]
Fixup deadlock sanitizer after r220635

llvm-svn: 220636

10 years ago[Sanitizer] Make StackTrace a lightweight reference to array of PCs, and
Alexey Samsonov [Sun, 26 Oct 2014 03:35:14 +0000 (03:35 +0000)]
[Sanitizer] Make StackTrace a lightweight reference to array of PCs, and
introduce a BufferedStackTrace class, which owns this array.

Summary:
This change splits __sanitizer::StackTrace class into a lightweight
__sanitizer::StackTrace, which doesn't own array of PCs, and BufferedStackTrace,
which owns it. This would allow us to simplify the interface of StackDepot,
and eventually merge __sanitizer::StackTrace with __tsan::StackTrace.

Test Plan: regression test suite.

Reviewers: kcc, dvyukov

Reviewed By: dvyukov

Subscribers: llvm-commits

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

llvm-svn: 220635

10 years ago[clang-tidy] check_clang_tidy_fix.sh -> check_clang_tidy.sh
Alexander Kornienko [Sun, 26 Oct 2014 02:58:07 +0000 (02:58 +0000)]
[clang-tidy] check_clang_tidy_fix.sh -> check_clang_tidy.sh

Summary: Make the script suitable for checking just messages. Move most of the tests to use it. Clean up the tests: shorten messages, insert line numbers, remove unnecessary RUN: lines, etc.

Reviewers: klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

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

llvm-svn: 220634

10 years ago[clang-tidy] Clean up test.
Alexander Kornienko [Sun, 26 Oct 2014 02:21:32 +0000 (02:21 +0000)]
[clang-tidy] Clean up test.

Simplify RUN lines and make checks stricter, check messages instead of fixes.

llvm-svn: 220633

10 years ago[clang-tidy] Simplify RUN: lines in the test
Alexander Kornienko [Sun, 26 Oct 2014 02:18:06 +0000 (02:18 +0000)]
[clang-tidy] Simplify RUN: lines in the test

llvm-svn: 220632

10 years ago[clang-tidy] Bring order to check registration.
Alexander Kornienko [Sun, 26 Oct 2014 01:41:14 +0000 (01:41 +0000)]
[clang-tidy] Bring order to check registration.

Summary:
Register readability checks in a separate module. Renamed the checks
and test file names accordingly.

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

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

llvm-svn: 220631

10 years agoDriver: reduce search logic duplication
Saleem Abdulrasool [Sat, 25 Oct 2014 23:33:21 +0000 (23:33 +0000)]
Driver: reduce search logic duplication

Refactor the path search into a helper function to avoid duplicating the path
handling for the search.  NFC.

llvm-svn: 220628

10 years agobuiltins: avoid endian.h in favour of compiler builtins
Saleem Abdulrasool [Sat, 25 Oct 2014 20:54:51 +0000 (20:54 +0000)]
builtins: avoid endian.h in favour of compiler builtins

Use the __BYTE_ORDER__ macro which has been available in GCC since 4.6 and is
available in clang as well.

llvm-svn: 220626

10 years agotest: attempt to make test more hermetic
Saleem Abdulrasool [Sat, 25 Oct 2014 20:49:12 +0000 (20:49 +0000)]
test: attempt to make test more hermetic

Add a fake linker in to a sysroot to use for testing the driver's tool
invocation.  Should make the test behave similarly on all platforms.  Addresses
review comments from Reid Kleckner from SVN r220546.

llvm-svn: 220625

10 years agoDriver: assume that all architectures are supported for libstc++
Saleem Abdulrasool [Sat, 25 Oct 2014 20:48:35 +0000 (20:48 +0000)]
Driver: assume that all architectures are supported for libstc++

Rather than asserting that the target is unsupported, make a guess at what the
tree for a port would look like and use that for the search path.

Addresses review comments from Ried Kleckner for SVN r220547.

llvm-svn: 220624

10 years agoLSR: Minor cleanup after Daniel's patch.
Andrew Trick [Sat, 25 Oct 2014 19:59:30 +0000 (19:59 +0000)]
LSR: Minor cleanup after Daniel's patch.

Combine the Inserted an Done sets into a Visited set.

llvm-svn: 220623

10 years agoFix LSR compile time.
Andrew Trick [Sat, 25 Oct 2014 19:42:07 +0000 (19:42 +0000)]
Fix LSR compile time.

This is a simple fix that brings the compilation time from 5min to 5s
on a specific real-world example. It's a large chain of computation in
a crypto routine (always a problem for SCEV). A unit test is not
feasible and there would be no way to check it. The fix is just basic
good practice for dealing with SCEVs, there's no risk of regression.

Patch by Daniel Reynaud!

llvm-svn: 220622

10 years ago[OCaml] hexagon can't run MCJIT tests, XFAIL it.
Peter Zotov [Sat, 25 Oct 2014 19:01:14 +0000 (19:01 +0000)]
[OCaml] hexagon can't run MCJIT tests, XFAIL it.

llvm-svn: 220621

10 years ago[OCaml] Unbreak Llvm_executionengine.initialize_native_target.
Peter Zotov [Sat, 25 Oct 2014 18:50:02 +0000 (18:50 +0000)]
[OCaml] Unbreak Llvm_executionengine.initialize_native_target.

First, return true on success, as it is the OCaml convention.
Second, also initialize the native assembly printer, which is,
despite the name, required for MCJIT operation.

Since this function did not initialize the assembly printer earlier
and no function to initialize native assembly printer was available
elsewhere, it is safe to break its interface: it means that it
simply could not be used successfully before.

llvm-svn: 220620

10 years ago[OCaml] Expose Llvm_executionengine.ExecutionEngine.create_mcjit.
Peter Zotov [Sat, 25 Oct 2014 18:49:56 +0000 (18:49 +0000)]
[OCaml] Expose Llvm_executionengine.ExecutionEngine.create_mcjit.

llvm-svn: 220619

10 years ago[SeparateConstOffsetFromGEP] Fixed a bug related to unsigned modulo
Jingyue Wu [Sat, 25 Oct 2014 18:34:03 +0000 (18:34 +0000)]
[SeparateConstOffsetFromGEP] Fixed a bug related to unsigned modulo

The dividend in "signed % unsigned" is treated as unsigned instead of signed,
causing unexpected behavior such as -64 % (uint64_t)24 == 0.

Added a regression test in split-gep.ll

Patched by Hao Liu.

llvm-svn: 220618

10 years agoUnbreak the build.
Benjamin Kramer [Sat, 25 Oct 2014 18:20:17 +0000 (18:20 +0000)]
Unbreak the build.

llvm-svn: 220617

10 years agoClean up assume intrinsic pattern matching, no need to check that the argument is...
Benjamin Kramer [Sat, 25 Oct 2014 18:09:01 +0000 (18:09 +0000)]
Clean up assume intrinsic pattern matching, no need to check that the argument is a value.

Also make it const safe and remove superfluous casting. NFC.

llvm-svn: 220616

10 years ago[SeparateConstOffsetFromGEP] Fixed a bug in rebuilding OR expressions
Jingyue Wu [Sat, 25 Oct 2014 17:36:21 +0000 (17:36 +0000)]
[SeparateConstOffsetFromGEP] Fixed a bug in rebuilding OR expressions

The two operands of the new OR expression should be NextInChain and TheOther
instead of the two original operands.

Added a regression test in split-gep.ll.

Hao Liu reported this bug, and provded the test case and an initial patch.
Thanks!

llvm-svn: 220615

10 years agoLex: Fix an invalid access into a SmallString
David Majnemer [Sat, 25 Oct 2014 11:40:40 +0000 (11:40 +0000)]
Lex: Fix an invalid access into a SmallString

We would crash because we used operator[] to access past the end of a
SmallString.  This occured because our token had length zero.

Instead, form the pointer using .data() and arithmetic.  This is safe
because this forms a one-past-the-end pointer and it is only used to
compare with another one-past-the-end pointer.

This fixes PR21379.

llvm-svn: 220614

10 years ago[X86][SSE] Vector integer/float conversion memory folding
Simon Pilgrim [Sat, 25 Oct 2014 08:11:20 +0000 (08:11 +0000)]
[X86][SSE] Vector integer/float conversion memory folding

Tidied up some entries in the folding tables so that they are under the correct comment section (they were categorised as AVX2 instructions when they're AVX1).

Minor patch agreed with qcolombet.

llvm-svn: 220613

10 years agoInstCombine: Remove overzealous asserts
David Majnemer [Sat, 25 Oct 2014 07:13:13 +0000 (07:13 +0000)]
InstCombine: Remove overzealous asserts

These asserts can trigger if the worklist iteration order is
sufficiently unlucky.  Instead of adding special case logic to handle
these edge conditions, just bail out on trying to transform them:
InstSimplify will get them when it reaches them on the worklist.

This fixes PR21378.

N.B.  No test case is included because any test would rely on the
fragile worklist iteration order.

llvm-svn: 220612

10 years agoAllow the C API users to keep relying on the OutMessages parameter.
Rafael Espindola [Sat, 25 Oct 2014 04:31:08 +0000 (04:31 +0000)]
Allow the C API users to keep relying on the OutMessages parameter.

Should fix the Ocaml tests.

llvm-svn: 220611

10 years agoRemove unused variable.
Rafael Espindola [Sat, 25 Oct 2014 04:07:53 +0000 (04:07 +0000)]
Remove unused variable.

llvm-svn: 220610

10 years agoUpdate for LLVM api change.
Rafael Espindola [Sat, 25 Oct 2014 04:06:14 +0000 (04:06 +0000)]
Update for LLVM api change.

llvm-svn: 220609

10 years agoUpdate the error handling of lib/Linker.
Rafael Espindola [Sat, 25 Oct 2014 04:06:10 +0000 (04:06 +0000)]
Update the error handling of lib/Linker.

Instead of passing a std::string&, use the new diagnostic infrastructure.

llvm-svn: 220608

10 years ago[NVPTX] aligned byte-buffers for vector return types
Jingyue Wu [Sat, 25 Oct 2014 03:46:16 +0000 (03:46 +0000)]
[NVPTX] aligned byte-buffers for vector return types

Summary:
Fixes PR21100 which is caused by inconsistency between the declared return type
and the expected return type at the call site. The new behavior is consistent
with nvcc and the NVPTXTargetLowering::getPrototype function.

Test Plan: test/Codegen/NVPTX/vector-return.ll

Reviewers: jholewinski

Reviewed By: jholewinski

Subscribers: llvm-commits, meheff, eliben, jholewinski

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

llvm-svn: 220607

10 years agoMake this test a bit stricter by checking clang's output too.
Rafael Espindola [Sat, 25 Oct 2014 01:51:19 +0000 (01:51 +0000)]
Make this test a bit stricter by checking clang's output too.

llvm-svn: 220604

10 years agoAdd a test for the -suppress-warnings option.
Rafael Espindola [Sat, 25 Oct 2014 01:14:15 +0000 (01:14 +0000)]
Add a test for the -suppress-warnings option.

llvm-svn: 220603

10 years agoSetting breakpoints with name mask eFunctionNameTypeBase was broken for straight...
Jim Ingham [Sat, 25 Oct 2014 00:33:55 +0000 (00:33 +0000)]
Setting breakpoints with name mask eFunctionNameTypeBase was broken for straight C names by 220432.  Get
that working again.

llvm-svn: 220602

10 years ago[msan] Make -msan-check-constant-shadow a bit stronger.
Evgeniy Stepanov [Fri, 24 Oct 2014 23:34:15 +0000 (23:34 +0000)]
[msan] Make -msan-check-constant-shadow a bit stronger.

Allow (under the experimental flag) non-Instructions to participate in MSan checks.

llvm-svn: 220601

10 years agoModernize the error handling of the Materialize function.
Rafael Espindola [Fri, 24 Oct 2014 22:50:48 +0000 (22:50 +0000)]
Modernize the error handling of the Materialize function.

llvm-svn: 220600

10 years agoFix a Mach-O assembler segfault for a subtraction expression with an undefined symbol.
Kevin Enderby [Fri, 24 Oct 2014 22:39:40 +0000 (22:39 +0000)]
Fix a Mach-O assembler segfault for a subtraction expression with an undefined symbol.

In a Mach-O object file a relocatable expression of the form
SymbolA - SymbolB + constant is allowed when both symbols are
defined in a section.  But when either symbol is undefined it
is an error.

The code was crashing when it had an undefined symbol in this case.
And should have printed a error message using the location information
in the relocation entry.

rdar://18678402

llvm-svn: 220599

10 years ago[mach-o] Support old style objc class names in export lists
Nick Kledzik [Fri, 24 Oct 2014 22:28:54 +0000 (22:28 +0000)]
[mach-o] Support old style objc class names in export lists

Objective-C switched to a new ABI which uses a different mangling for class
names.  But to keep projects building that use export lists that use the old
class name mangling, the linker recognizes the old names and transforms them
to the new mangling.

llvm-svn: 220598

10 years ago[mach-o] Support data-only dylibs
Nick Kledzik [Fri, 24 Oct 2014 22:19:22 +0000 (22:19 +0000)]
[mach-o] Support data-only dylibs

In final linked shared images, the __TEXT segment contains both code and
the mach-o header/load-commands.  In the case of a data-only dylib, there is
no code, so we need to force the addition of the __TEXT segment.

llvm-svn: 220597

10 years agoImplement explicit thread stack size specification on Windows.
Zachary Turner [Fri, 24 Oct 2014 22:06:29 +0000 (22:06 +0000)]
Implement explicit thread stack size specification on Windows.

llvm-svn: 220596

10 years agoCodeGen: Don't form weak dllexport aliases
David Majnemer [Fri, 24 Oct 2014 22:05:27 +0000 (22:05 +0000)]
CodeGen: Don't form weak dllexport aliases

The MS linker cannot do anything interesting with these, it doesn't make
sense to emit them.

This fixes PR21373.

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

llvm-svn: 220595

10 years agoSink DwarfUnit::constructImportedEntityDIE into DwarfCompileUnit.
Frederic Riss [Fri, 24 Oct 2014 21:31:09 +0000 (21:31 +0000)]
Sink DwarfUnit::constructImportedEntityDIE into DwarfCompileUnit.

So that it has access to getOrCreateGlobalVariableDIE. If we ever support
decsribing using directive in C++ classes (thus requiring support in type
units), it will certainly use another mechanism anyway.

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

llvm-svn: 220594

10 years agotest: correct an overzealous search-and-replace
Saleem Abdulrasool [Fri, 24 Oct 2014 21:23:49 +0000 (21:23 +0000)]
test: correct an overzealous search-and-replace

The temporary initialized is referenced as %0, not as the auto-release pool.
Fixes R+A tests.

llvm-svn: 220593

10 years ago[X86][SSE] Bitcast assertion in XFormVExtractWithShuffleIntoLoad
Simon Pilgrim [Fri, 24 Oct 2014 21:04:41 +0000 (21:04 +0000)]
[X86][SSE] Bitcast assertion in XFormVExtractWithShuffleIntoLoad

Minor patch to fix an issue in XFormVExtractWithShuffleIntoLoad where a load is unary shuffled, then bitcast (to a type with the same number of elements) before extracting an element.

An undef was created for the second shuffle operand using the original (post-bitcasted) vector type instead of the pre-bitcasted type like the rest of the shuffle node - this was then causing an assertion on the different types later on inside SelectionDAG::getVectorShuffle.

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

llvm-svn: 220592

10 years agoRemove duplicated new file content
Ed Maste [Fri, 24 Oct 2014 20:49:50 +0000 (20:49 +0000)]
Remove duplicated new file content

llvm-svn: 220591

10 years agoCodeGen: correct materialize temporary aggregates in ARC mode
Saleem Abdulrasool [Fri, 24 Oct 2014 20:23:43 +0000 (20:23 +0000)]
CodeGen: correct materialize temporary aggregates in ARC mode

Avoid an assertion when materializing a lifetime type aggregate temporary.  When
performing CodeGen for ObjC++, we could generate a lifetime-only aggregate
temporary by using an initializer list (which is effectively an array).  We
would reach through the temporary expression, fishing out the inner expression.
If this expression was a lifetime expression, we would attempt to emit this as a
scalar.  This would eventually result in an assertion as the emission would
eventually assert that the expression being emitted has a scalar evaluation
kind.

Add a case to handle the aggregate expressions.  Use the EmitAggExpr to emit the
aggregate expression rather than the EmitScalarInit.

Addresses PR21347.

llvm-svn: 220590

10 years ago[modules] Support combining 'textual' with 'private'.
Richard Smith [Fri, 24 Oct 2014 20:23:01 +0000 (20:23 +0000)]
[modules] Support combining 'textual' with 'private'.

llvm-svn: 220589

10 years agoItanium ABI: Template template parameters are usable as substitutions
David Majnemer [Fri, 24 Oct 2014 20:22:57 +0000 (20:22 +0000)]
Itanium ABI: Template template parameters are usable as substitutions

Template template parameters weren't added to the list of substitutions.
This would make the substitution map contain inaccurate mappings,
leading to Clang violating the Itanium ABI and breaking compatibility
with GCC.

This fixes PR21351.

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

llvm-svn: 220588

10 years agoCodeGen: trivial conversion to range based loop
Saleem Abdulrasool [Fri, 24 Oct 2014 19:54:32 +0000 (19:54 +0000)]
CodeGen: trivial conversion to range based loop

Switch to a range-based for loop.  NFC.

llvm-svn: 220587

10 years agotest: add -std=c++11
Saleem Abdulrasool [Fri, 24 Oct 2014 19:54:29 +0000 (19:54 +0000)]
test: add -std=c++11

This test uses C++11 features (r-value references) in ObjC++.  Add a -std=c++11
to silence a warning.  NFC.

llvm-svn: 220586

10 years agoCodeGen: GLValue exprs in template parameters should have reference type
David Majnemer [Fri, 24 Oct 2014 19:49:04 +0000 (19:49 +0000)]
CodeGen: GLValue exprs in template parameters should have reference type

This fixes a corner-case where __uuidof as a template argument would
result in us trying to emit a GLValue as an RValue.  This would lead to
a crash down the road.

llvm-svn: 220585

10 years ago[Hexagon] Resubmission of 220427
Colin LeMahieu [Fri, 24 Oct 2014 19:00:32 +0000 (19:00 +0000)]
[Hexagon] Resubmission of 220427
Modified library structure to deal with circular dependency between HexagonInstPrinter and HexagonMCInst.
Adding encoding bits for add opcode.
Adding llvm-mc tests.
Removing unit tests.

http://reviews.llvm.org/D5624

llvm-svn: 220584

10 years agoPatch from ovyalov@google.com:
Jim Ingham [Fri, 24 Oct 2014 18:51:57 +0000 (18:51 +0000)]
Patch from ovyalov@google.com:

Handle pexpect exceptions correctly so that processes spawned with
pexpect are always reaped.

llvm-svn: 220583