platform/upstream/llvm.git
9 years ago[mips] [IAS] Make the mips-expansions-bad.s test more readable. NFC.
Toma Tabacu [Fri, 10 Apr 2015 10:46:59 +0000 (10:46 +0000)]
[mips] [IAS] Make the mips-expansions-bad.s test more readable. NFC.

Move the check lines below the code lines and change the indentation from 8
spaces to 2 spaces.

llvm-svn: 234584

9 years ago[OPENMP] Codegen for 'reduction' clause in 'parallel' directive.
Alexey Bataev [Fri, 10 Apr 2015 10:43:45 +0000 (10:43 +0000)]
[OPENMP] Codegen for 'reduction' clause in 'parallel' directive.

Emit a code for reduction clause. Next code should be emitted for reductions:

static kmp_critical_name lock = { 0 };

void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
  ...
  *(Type<i> *)lhs[i] = RedOp<i>(*(Type<i> *)lhs[i], *(Type<i> *)rhs[i]);
  ...
}

... void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n> - 1]};
switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) {
case 1:
  ...
  <LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]);
  ...
  __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
  break;
case 2:
  ...
  Atomic(<LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]));
  ...
  break;
default:
  ;
}
Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation.

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

llvm-svn: 234583

9 years ago[ARM] Replace dyn_cast with isa check
Denis Protivensky [Fri, 10 Apr 2015 10:30:04 +0000 (10:30 +0000)]
[ARM] Replace dyn_cast with isa check

llvm-svn: 234582

9 years agoRemove threshold for inserting lifetime markers for named temporaries
Arnaud A. de Grandmaison [Fri, 10 Apr 2015 10:13:52 +0000 (10:13 +0000)]
Remove threshold for inserting lifetime markers for named temporaries

Now that TailRecursionElimination has been fixed with r222354, the
threshold on size for lifetime marker insertion can be removed. This
only affects named temporary though, as the patch for unnamed temporaries
is still in progress.

My previous commit (r222993) was not handling debuginfo correctly, but
this could only be seen with some asan tests. Basically, lifetime markers
are just instrumentation for the compiler's usage and should not affect
debug information; however, the cleanup infrastructure was assuming it
contained only destructors, i.e. actual code to be executed, and was
setting the breakpoint for the end of the function to the closing '}', and
not the return statement, in order to show some destructors have been
called when leaving the function. This is wrong when the cleanups are only
lifetime markers, and this is now fixed.

llvm-svn: 234581

9 years ago[ARM] Improve veneer handling and introduce handlePlain method
Denis Protivensky [Fri, 10 Apr 2015 09:54:10 +0000 (09:54 +0000)]
[ARM] Improve veneer handling and introduce handlePlain method

Handle veneers only for call-like relocations.

llvm-svn: 234580

9 years ago[sanitizer][MIPS] Fix warnings on MIPS
Dmitry Vyukov [Fri, 10 Apr 2015 09:45:22 +0000 (09:45 +0000)]
[sanitizer][MIPS] Fix warnings on MIPS
Fixed:
- stack frame size warning.
- msse3 flag unused warning.
- GoTsanRuntimeCheck dependency warning reported by cmake.

Change by Sagar Thakur
Reviewed in http://reviews.llvm.org/D8963

llvm-svn: 234579

9 years agoReverting test commit.
Szabolcs Sipos [Fri, 10 Apr 2015 08:43:58 +0000 (08:43 +0000)]
Reverting test commit.

llvm-svn: 234578

9 years agoTest commit.
Szabolcs Sipos [Fri, 10 Apr 2015 08:42:08 +0000 (08:42 +0000)]
Test commit.

llvm-svn: 234577

9 years ago[ARM] Remove unused variable in dynamic pass
Denis Protivensky [Fri, 10 Apr 2015 07:53:18 +0000 (07:53 +0000)]
[ARM] Remove unused variable in dynamic pass

llvm-svn: 234576

9 years ago[OPENMP] Fixed cleanup of OpenMP code.
Alexey Bataev [Fri, 10 Apr 2015 07:48:12 +0000 (07:48 +0000)]
[OPENMP] Fixed cleanup of OpenMP code.

llvm-svn: 234575

9 years agoFix typo in test. There is no %clangcxx, but there is %clangxx.
Nick Lewycky [Fri, 10 Apr 2015 07:43:19 +0000 (07:43 +0000)]
Fix typo in test. There is no %clangcxx, but there is %clangxx.

llvm-svn: 234574

9 years ago[ARM] Add skeleton for dynamic relocation pass
Denis Protivensky [Fri, 10 Apr 2015 07:42:08 +0000 (07:42 +0000)]
[ARM] Add skeleton for dynamic relocation pass

llvm-svn: 234573

9 years ago[OPENMP] Fixing troubles with lambdas in cleanups.
Alexey Bataev [Fri, 10 Apr 2015 06:33:45 +0000 (06:33 +0000)]
[OPENMP] Fixing troubles with lambdas in cleanups.

llvm-svn: 234572

9 years ago[lib/Fuzzer] Section: How good is my fuzzer?
Kostya Serebryany [Fri, 10 Apr 2015 06:32:29 +0000 (06:32 +0000)]
[lib/Fuzzer] Section: How good is my fuzzer?

llvm-svn: 234571

9 years ago[lib/Fuzzer] explain compatibility with AFL
Kostya Serebryany [Fri, 10 Apr 2015 05:44:43 +0000 (05:44 +0000)]
[lib/Fuzzer] explain compatibility with AFL

llvm-svn: 234570

9 years ago[OPENMP] Fixed incompatibility with MSVC, NFC.
Alexey Bataev [Fri, 10 Apr 2015 05:32:31 +0000 (05:32 +0000)]
[OPENMP] Fixed incompatibility with MSVC, NFC.

llvm-svn: 234568

9 years agoDivergence analysis for GPU programs
Jingyue Wu [Fri, 10 Apr 2015 05:03:50 +0000 (05:03 +0000)]
Divergence analysis for GPU programs

Summary:
Some optimizations such as jump threading and loop unswitching can negatively
affect performance when applied to divergent branches. The divergence analysis
added in this patch conservatively estimates which branches in a GPU program
can diverge. This information can then help LLVM to run certain optimizations
selectively.

Test Plan: test/Analysis/DivergenceAnalysis/NVPTX/diverge.ll

Reviewers: resistor, hfinkel, eliben, meheff, jholewinski

Subscribers: broune, bjarke.roune, madhur13490, tstellarAMD, dberlin, echristo, jholewinski, llvm-commits

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

llvm-svn: 234567

9 years ago[WinEHPrepare] Don't rely on the order of IR
David Majnemer [Fri, 10 Apr 2015 04:56:17 +0000 (04:56 +0000)]
[WinEHPrepare] Don't rely on the order of IR

The IPToState table must be emitted after we have generated labels for
all functions in the table.  Don't rely on the order of the list of
globals.  Instead, utilize WinEHFuncInfo to tell us how many catch
handlers we expect to outline.  Once we know we've visited all the catch
handlers, emit the cppxdata.

llvm-svn: 234566

9 years ago[Sema] Don't assume that an initializer list has an initializer
David Majnemer [Fri, 10 Apr 2015 04:52:06 +0000 (04:52 +0000)]
[Sema] Don't assume that an initializer list has an initializer

Given something like 'int({}, 1)', we would try to emit a diagnostic
regarding the excess element in the scalar initializer.  However, we
assumed that the initializer list had an element in it.

llvm-svn: 234565

9 years ago[OPENMP] Refactoring of codegen for OpenMP directives.
Alexey Bataev [Fri, 10 Apr 2015 04:50:10 +0000 (04:50 +0000)]
[OPENMP] Refactoring of codegen for OpenMP directives.

Refactored API of OpenMPRuntime for compatibility with combined directives.
Differential Revision: http://reviews.llvm.org/D8859

llvm-svn: 234564

9 years agoRevert r234532 for a bit, it very likely caused http://crbug.com/475768
Nico Weber [Fri, 10 Apr 2015 04:33:03 +0000 (04:33 +0000)]
Revert r234532 for a bit, it very likely caused crbug.com/475768

llvm-svn: 234563

9 years agoRemove 'z' modifier from printf/sscanf operations in AdbClient - the modifier isn...
Oleksiy Vyalov [Fri, 10 Apr 2015 03:59:52 +0000 (03:59 +0000)]
Remove 'z' modifier from printf/sscanf operations in AdbClient  - the modifier isn't supported by MS C++ compiler.

llvm-svn: 234562

9 years ago[PowerPC] Don't crash on PPC32 i64 fp_to_uint on modern cores
Hal Finkel [Fri, 10 Apr 2015 03:39:00 +0000 (03:39 +0000)]
[PowerPC] Don't crash on PPC32 i64 fp_to_uint on modern cores

When we have an instruction for this (and, thus, don't generate a runtime
call), we need to custom type legalize this (in a trivial way, just as we do
for fp_to_sint).

Fixes PR23173.

llvm-svn: 234561

9 years ago_mm256_blend_epi16 is being cast to __m256d instead of __m256i. Fixing this.
Ekaterina Romanova [Fri, 10 Apr 2015 02:39:45 +0000 (02:39 +0000)]
_mm256_blend_epi16 is being cast to __m256d instead of __m256i. Fixing this.

llvm-svn: 234560

9 years agoWrap socket error handling with SetLastError and IsInterrupted internal functions...
Oleksiy Vyalov [Fri, 10 Apr 2015 02:31:37 +0000 (02:31 +0000)]
Wrap socket error handling with SetLastError and IsInterrupted internal functions which can properly treat Windows and POSIX errors.

http://reviews.llvm.org/D8939

llvm-svn: 234559

9 years agoRemove redundant parentheses.
Rui Ueyama [Fri, 10 Apr 2015 02:18:23 +0000 (02:18 +0000)]
Remove redundant parentheses.

llvm-svn: 234558

9 years agoDo not use default arguments for trivial functions.
Rui Ueyama [Fri, 10 Apr 2015 02:15:13 +0000 (02:15 +0000)]
Do not use default arguments for trivial functions.

llvm-svn: 234557

9 years agoRemove unused return values.
Rui Ueyama [Fri, 10 Apr 2015 02:06:28 +0000 (02:06 +0000)]
Remove unused return values.

llvm-svn: 234556

9 years ago[modules] Remove unused MACRO_TABLE record.
Richard Smith [Fri, 10 Apr 2015 02:02:24 +0000 (02:02 +0000)]
[modules] Remove unused MACRO_TABLE record.

llvm-svn: 234555

9 years agoFix a problem where 'process launch' was not correctly re-quoting arguments for the...
Enrico Granata [Fri, 10 Apr 2015 01:55:57 +0000 (01:55 +0000)]
Fix a problem where 'process launch' was not correctly re-quoting arguments for the inferior process when handing them down for the actual launch

This covers most of rdar://20490076, but leaves one corner case still open - namely the case where we try to have arguments of the form foo\ bar (unquoted, but slashed) go through argdumper

llvm-svn: 234554

9 years agoReapply r234378, with test fixed (by emaste).
Davide Italiano [Fri, 10 Apr 2015 01:40:25 +0000 (01:40 +0000)]
Reapply r234378, with test fixed (by emaste).

Hopefully this time the build won't be broken.

llvm-svn: 234553

9 years agoELF: Don't use APPLY_RELOC macro.
Rui Ueyama [Fri, 10 Apr 2015 00:19:41 +0000 (00:19 +0000)]
ELF: Don't use APPLY_RELOC macro.

In other ELF ports, we don't use the macro. This patch removes the
macro for consistency and readability.

llvm-svn: 234552

9 years agoELF: Move Hexagon linker helper function to Hexagon directory.
Rui Ueyama [Fri, 10 Apr 2015 00:11:54 +0000 (00:11 +0000)]
ELF: Move Hexagon linker helper function to Hexagon directory.

Because no one except Hexagon uses the header, we don't need to maintain
the header in the common directory. Also de-template the function for
readability.

llvm-svn: 234551

9 years ago[AArch64] Promote f16 operations to f32.
Ahmed Bougacha [Fri, 10 Apr 2015 00:08:48 +0000 (00:08 +0000)]
[AArch64] Promote f16 operations to f32.

For the most common ones (such as fadd), we already did the promotion.
Do the same thing for all the others.

Currently, we'll just crash/assert on all these operations, as
there's no hardware or libcall support whatsoever.

f16 (half) is specified as an interchange - not arithmetic - format,
and is expected to be promoted to single-precision for arithmetic
operations.

While there, teach the legalizer about promoting some of the (mostly
floating-point) operations that we never needed before.

Differential Revision: http://reviews.llvm.org/D8648
See related discussion on the thread for: http://reviews.llvm.org/D8755

llvm-svn: 234550

9 years agoSkip lldb-server tests according to bug 23181
Ilia K [Fri, 10 Apr 2015 00:04:59 +0000 (00:04 +0000)]
Skip lldb-server tests according to bug 23181

llvm-svn: 234549

9 years agoRemove dead code.
Rui Ueyama [Fri, 10 Apr 2015 00:04:44 +0000 (00:04 +0000)]
Remove dead code.

llvm-svn: 234548

9 years agoAdd Clang support for remaining integer divide and permute instructions from ISA...
Nemanja Ivanovic [Thu, 9 Apr 2015 23:58:16 +0000 (23:58 +0000)]
Add Clang support for remaining integer divide and permute instructions from ISA 2.06

This patch corresponds to review:
http://reviews.llvm.org/D8398

It adds some builtin functions to access the extended divide and bit permute instructions.

llvm-svn: 234547

9 years agoAdd LLVM support for remaining integer divide and permute instructions from ISA 2.06
Nemanja Ivanovic [Thu, 9 Apr 2015 23:54:37 +0000 (23:54 +0000)]
Add LLVM support for remaining integer divide and permute instructions from ISA 2.06

This is the patch corresponding to review:
http://reviews.llvm.org/D8406

It adds some missing instructions from ISA 2.06 to the PPC back end.

llvm-svn: 234546

9 years ago[Objective-C Sema] It is permissable to bridge cast to 'id'
Fariborz Jahanian [Thu, 9 Apr 2015 23:39:53 +0000 (23:39 +0000)]
[Objective-C Sema] It is permissable to bridge cast to 'id'
of a CFType bridged to some unknown Objective-C type.
rdar://20113785

llvm-svn: 234545

9 years agoUpdate test case for r234543.
Benjamin Kramer [Thu, 9 Apr 2015 22:54:53 +0000 (22:54 +0000)]
Update test case for r234543.

llvm-svn: 234544

9 years ago[CodeGen] Do a more principled fix for PR231653, always use the inner type.
Benjamin Kramer [Thu, 9 Apr 2015 22:50:07 +0000 (22:50 +0000)]
[CodeGen] Do a more principled fix for PR231653, always use the inner type.

We were still using the MaterializeTemporaryExpr's type to check if the
transform is legal. Always use the inner Expr type.

llvm-svn: 234543

9 years agoRevert r234477, "Differential Revision: http://reviews.llvm.org/D7249"
Peter Collingbourne [Thu, 9 Apr 2015 22:42:01 +0000 (22:42 +0000)]
Revert r234477, "Differential Revision: reviews.llvm.org/D7249"

Should unbreak fuzzer buildbot.

llvm-svn: 234542

9 years agoFix undefined behavior.
Rui Ueyama [Thu, 9 Apr 2015 22:04:45 +0000 (22:04 +0000)]
Fix undefined behavior.

Having std:move(mb) and mb->getBuffer() in the same argument list is not safe
because the order of evaluation is not defined.

llvm-svn: 234541

9 years agoELF: Move CreateELF() from its own file to ELFReader.h.
Rui Ueyama [Thu, 9 Apr 2015 21:55:47 +0000 (21:55 +0000)]
ELF: Move CreateELF() from its own file to ELFReader.h.

CreateELF.h was included only by ELFReader.h, and it was used only
by ELFReader class. By making the function a member of the class,
we can remove template parameters.

llvm-svn: 234540

9 years agoDon't hardcode the name of the plugin - or it will get out of date, and this code...
Enrico Granata [Thu, 9 Apr 2015 21:52:19 +0000 (21:52 +0000)]
Don't hardcode the name of the plugin - or it will get out of date, and this code will be broken

Thanks Greg!

llvm-svn: 234539

9 years agoPropagate usage of std:unique_ptr a bit. NFC.
Rafael Espindola [Thu, 9 Apr 2015 21:50:11 +0000 (21:50 +0000)]
Propagate usage of std:unique_ptr a bit. NFC.

llvm-svn: 234538

9 years agoThe dyld shared cache class table is not present in the iOS simulator, so do not...
Enrico Granata [Thu, 9 Apr 2015 21:33:57 +0000 (21:33 +0000)]
The dyld shared cache class table is not present in the iOS simulator, so do not actually warn to people when running under the simulator

rdar://20403987

llvm-svn: 234537

9 years agoUpdate for LLVM api changes.
Rafael Espindola [Thu, 9 Apr 2015 21:06:11 +0000 (21:06 +0000)]
Update for LLVM api changes.

llvm-svn: 234536

9 years agoSimplify use of formatted_raw_ostream.
Rafael Espindola [Thu, 9 Apr 2015 21:06:08 +0000 (21:06 +0000)]
Simplify use of formatted_raw_ostream.

formatted_raw_ostream is a wrapper over another stream to add column and line
number tracking.

It is used only for asm printing.

This patch moves the its creation down to where we know we are printing
assembly. This has the following advantages:

* Simpler lifetime management: std::unique_ptr
* We don't compute column and line number of object files :-)

llvm-svn: 234535

9 years agoUpdate design.rst to remove a mention about round-trip tests.
Rui Ueyama [Thu, 9 Apr 2015 20:43:38 +0000 (20:43 +0000)]
Update design.rst to remove a mention about round-trip tests.

llvm-svn: 234534

9 years agoUse Linux sysroot in Driver test case from r234521
Reid Kleckner [Thu, 9 Apr 2015 20:37:38 +0000 (20:37 +0000)]
Use Linux sysroot in Driver test case from r234521

We don't actually need a real Mac sysroot to make the test pass, just a
linker.  This makes the test pass in environments where no ld is on
PATH.

llvm-svn: 234533

9 years ago[SEH] Outline finally blocks using the new variable capture support
Reid Kleckner [Thu, 9 Apr 2015 20:37:24 +0000 (20:37 +0000)]
[SEH] Outline finally blocks using the new variable capture support

WinEHPrepare was going to have to pattern match the control flow merge
and split that the old lowering used, and that wasn't really feasible.

Now we can teach WinEHPrepare to pattern match this, which is much
simpler:
  %fp = call i8* @llvm.frameaddress(i32 0)
  call void @func(iN [01], i8* %fp)

This prototype happens to match the prototype used by the Win64 SEH
personality function, so this is really simple.

llvm-svn: 234532

9 years agoFix printf format specifier to silence warning.
Chaoren Lin [Thu, 9 Apr 2015 20:21:42 +0000 (20:21 +0000)]
Fix printf format specifier to silence warning.

llvm-svn: 234531

9 years ago[CodeGen] Combine concat_vector of trunc'd scalar to scalar_to_vector.
Ahmed Bougacha [Thu, 9 Apr 2015 20:04:47 +0000 (20:04 +0000)]
[CodeGen] Combine concat_vector of trunc'd scalar to scalar_to_vector.

We already do:
  concat_vectors(scalar, undef) -> scalar_to_vector(scalar)
When the scalar is legal.
When it's not, but is a truncated legal scalar, we can also do:
  concat_vectors(trunc(scalar), undef) -> scalar_to_vector(scalar)
Which is equivalent, since the upper lanes are undef anyway.
While there, teach the combine to look at more than 2 operands.

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

llvm-svn: 234530

9 years ago[AArch64][FastISel] Fix integer extend optimization.
Juergen Ributzka [Thu, 9 Apr 2015 20:00:46 +0000 (20:00 +0000)]
[AArch64][FastISel] Fix integer extend optimization.

The integer extend optimization tries to fold the extend into the load
instruction. This requires us to identify if the extend has already been
emitted or not and act accordingly on it.

The check that was originally performed for this was not sufficient. Besides
checking the ValueMap for a mapped register we also need to check if the
virtual register has already an associated machine instruction that defines it.

This fixes rdar://problem/20470788.

llvm-svn: 234529

9 years ago[Sema] Diagnose references to unbound arrays in function definitions
David Majnemer [Thu, 9 Apr 2015 19:53:25 +0000 (19:53 +0000)]
[Sema] Diagnose references to unbound arrays in function definitions

A [*] is only allowed in a declaration for a function, not in its
definition.  We didn't correctly recurse on reference types while
looking for it, causing us to crash in CodeGen instead of rejecting it.

llvm-svn: 234528

9 years ago[ItaniumABILanguageRuntime] Remove an unneccesary 'typename' keyword.
Siva Chandra [Thu, 9 Apr 2015 19:51:56 +0000 (19:51 +0000)]
[ItaniumABILanguageRuntime] Remove an unneccesary 'typename' keyword.

Summary: This will get the windows bots going.

Test Plan: Build LLDB on Windows.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 234527

9 years agoProperly implement warn_unused_result checking for classes/structs.
Kaelyn Takata [Thu, 9 Apr 2015 19:43:04 +0000 (19:43 +0000)]
Properly implement warn_unused_result checking for classes/structs.

The previous implementation would copy the attribute from the class to
functions that have the class as their return type when the functions
are first declared. This proved to have two flaws:
  1) if the class is forward-declared without the attribute and a
     function or method with the class as a its return type is declared,
     and afterward the class is defined with warn_unused_result, the
     function or method would never inherit the attribute, and
  2) the check simply failed for functions and methods that are part of
     a template instantiation, regardless of whether the class with
     warn_unused_result is part of a specific instantiation or part of
     the template itself (presumably because those function/method
     declaration does not hit the same code path as a non-template one
     and so never inherits the attribute).

The new approach is to instead modify the two places where a function or
method call is checked for the warn_unused_result attribute on the decl
by extending the checks to also look for the attribute on the decl's
return type.

Additionally, the check for return types that have the warn_unused_result
now excludes pointers and references to such types, as such return types do
not necessarily imply a transfer of ownership for the underlying object
being referred to by the return value. This does not change the behavior
of functions that are directly given the warn_unused_result attribute.

llvm-svn: 234526

9 years agoRemove duplicated code and consolidate initializers.
Eric Christopher [Thu, 9 Apr 2015 19:20:37 +0000 (19:20 +0000)]
Remove duplicated code and consolidate initializers.

llvm-svn: 234525

9 years ago[RenderScriptRuntime] Fix build after r234522.
Siva Chandra [Thu, 9 Apr 2015 19:13:54 +0000 (19:13 +0000)]
[RenderScriptRuntime] Fix build after r234522.

Test Plan: Build LLDB

Reviewers: domipheus

Subscribers: lldb-commits

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

llvm-svn: 234524

9 years ago[TestBitfields] Correct the attribute name to "aligned" in the testcase.
Siva Chandra [Thu, 9 Apr 2015 18:49:42 +0000 (18:49 +0000)]
[TestBitfields] Correct the attribute name to "aligned" in the testcase.

Summary:
This makes all parts of the test pass with Clang and GCC. They are
enabled with this patch.

Test Plan: dotest.py -C <clang|gcc> -p TestBitfields

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 234523

9 years ago[IRForTarget] Strenghten handling of alternate mangling.
Siva Chandra [Thu, 9 Apr 2015 18:48:34 +0000 (18:48 +0000)]
[IRForTarget] Strenghten handling of alternate mangling.

Summary:
This fixes an issue with GCC generated binaries wherein an expression
with method invocations on std::string variables was failing. Such use
cases are tested in TestSTL (albeit, in a test marked with
@unittest2.expectedFailure because of other reasons).

The reason for this particular failure with GCC is that the generated
DWARF for std::basic_string<...> is incomplete, which makes clang not
to use the alternate mangling scheme. GCC correctly generates the name
of basic_string<...>:

DW_AT_name "basic_string<char, std::char_traits<char>, std::allocator<char> >"

It also lists the template parameters of basic_string correctly:

DW_TAG_template_type_parameter
    DW_AT_name                  "_CharT"
    DW_AT_type                  <0x0000009c>
DW_TAG_template_type_parameter
    DW_AT_name                  "_Traits"
    DW_AT_type                  <0x00000609>
DW_TAG_template_type_parameter
    DW_AT_name                  "_Alloc"
    DW_AT_type                  <0x000007fb>

However, it does not list the template parameters of std::char_traits<>.
This makes Clang feel (while parsing the expression) that the string
variable is not actually a basic_string instance, and consequently does
not use the alternate mangling scheme.

Test Plan:
dotest.py -C gcc -p TestSTL
          -- See it go past the "for" loop expression successfully.

Reviewers: clayborg, spyffe

Reviewed By: clayborg, spyffe

Subscribers: tberghammer, zturner, lldb-commits

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

llvm-svn: 234522

9 years ago[ASan] Don't link against libc++abi when not using libc++
Hans Wennborg [Thu, 9 Apr 2015 18:47:01 +0000 (18:47 +0000)]
[ASan] Don't link against libc++abi when not using libc++

This is a follow-up to r233860 which added -lc++abi when using ASan
on Mac, and broke Chromium's ASan build which doesn't use libc++.

llvm-svn: 234521

9 years ago[Objective-C modern translation]. Patch to fix type of
Fariborz Jahanian [Thu, 9 Apr 2015 18:36:50 +0000 (18:36 +0000)]
[Objective-C modern translation]. Patch to fix type of
objc_msgSend's first argument to "Class" because
objc_getClass is passed. rdar://20477025

llvm-svn: 234520

9 years agoclang-format bits of code to make a followup patch easy to read.
Rafael Espindola [Thu, 9 Apr 2015 18:32:58 +0000 (18:32 +0000)]
clang-format bits of code to make a followup patch easy to read.

llvm-svn: 234519

9 years agoRevert "Refactoring and enhancement to FMA combine."
Rafael Espindola [Thu, 9 Apr 2015 18:29:32 +0000 (18:29 +0000)]
Revert "Refactoring and enhancement to FMA combine."

This reverts commit r234513. It was failing on the bots.

llvm-svn: 234518

9 years agoFix Debugger::HandleProcessEvent in case when ProcessIOHandler doesn't exist
Ilia K [Thu, 9 Apr 2015 18:18:10 +0000 (18:18 +0000)]
Fix Debugger::HandleProcessEvent in case when ProcessIOHandler doesn't exist

Summary:
Previously the Debugger::HandleProcessEvent hid a top IOHandler if the
process's IOHandler was inactive and later refreshed it. Usually the
IOHandler.Refresh() prints the (lldb) prompt. The problem was in case of
iOS remote platform when trying to execute 'command source' command.
On this platform the process's IOHandler is empty, therefore the
Debugger::HandleProcessEvent hid a top IOHandler and later refreshed it.
So that the (lldb) prompt was printed with a program output in mixed
order:
was:
```
  longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
  longlonglonglonglonglonglonglonglonglonglonglonglonglonglon(lldb)
  glonglonglonglonglonglonglonglonglonglonglonglong string
```

now:
```
  longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
  longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
  longlonglonglonglonglonglonglonglong string
```

Reviewers: zturner, jingham, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, jingham, zturner, clayborg

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

llvm-svn: 234517

9 years ago[Python] Fix issue configuring sys.path during startup.
Zachary Turner [Thu, 9 Apr 2015 18:08:50 +0000 (18:08 +0000)]
[Python] Fix issue configuring sys.path during startup.

Previously, users on Windows had to manually specify PYTHONPATH
to point to the site-packages directory before running LLDB.
The reason for this was because sys.path was being initialized
with a path containing unescaped backslashes, causing escape
sequences to end up in the paths.

llvm-svn: 234516

9 years agoDefine a function with "... llvm::func...".
Rafael Espindola [Thu, 9 Apr 2015 18:08:15 +0000 (18:08 +0000)]
Define a function with "... llvm::func...".

Using this instead of
namespace llvm {
  func...
}

Has the advantage that the build fails with a compiler error if it gets out
of sync with the .h file.

llvm-svn: 234515

9 years agoFix @skipUnlessPlatform and @skipIfPlatform decorators to work on classes.
Robert Flack [Thu, 9 Apr 2015 18:07:58 +0000 (18:07 +0000)]
Fix @skipUnlessPlatform and @skipIfPlatform decorators to work on classes.

The decorators to skip if or unless certain platforms relied on calling
skipTest, which only worked if they were decorating individual test cases.
However for decorating entire classes it needs different behavior. This behavior
is already encapsulated in unittest2.skipIf and unittest2.skipUnless so this
modifies the platform decorators to use these unittest skip decorators.

Test Plan:
./dotest.py -t -p TestObjCMethods2.py
See skipped tests on linux, and see tests run on macosx.

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

llvm-svn: 234514

9 years agoRefactoring and enhancement to FMA combine.
Olivier Sallenave [Thu, 9 Apr 2015 17:55:26 +0000 (17:55 +0000)]
Refactoring and enhancement to FMA combine.

llvm-svn: 234513

9 years ago[clang-tidy] Ignore expressions with incompatible deleters.
Samuel Benzaquen [Thu, 9 Apr 2015 17:51:01 +0000 (17:51 +0000)]
[clang-tidy] Ignore expressions with incompatible deleters.

Summary:
Do not warn on .reset(.release()) expressions if the deleters are not
compatible.
Using plain assignment will probably not work.

Reviewers: klimek

Subscribers: curdeius, cfe-commits

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

llvm-svn: 234512

9 years agoInstall a diagnostic consumer into each new AST
Sean Callanan [Thu, 9 Apr 2015 17:42:48 +0000 (17:42 +0000)]
Install a diagnostic consumer into each new AST
context as the first thing we do.  This prevents
crashes if some of the initial setup produces
messages or errors.

<rdar://problem/20457882>

llvm-svn: 234511

9 years agoIR: Preserve use-list order by default in bitcode
Duncan P. N. Exon Smith [Thu, 9 Apr 2015 17:41:20 +0000 (17:41 +0000)]
IR: Preserve use-list order by default in bitcode

Pull the `-preserve-*-use-list-order` flags out of "experimental" mode,
and preserve use-list order by default when serializing to bitcode.

llvm-svn: 234510

9 years agoAdded flag to disable isel instruction on PPC target. Using regular branches instead...
Olivier Sallenave [Thu, 9 Apr 2015 17:38:50 +0000 (17:38 +0000)]
Added flag to disable isel instruction on PPC target. Using regular branches instead of isel is more efficient in some cases.

llvm-svn: 234509

9 years agoAdded the RenderScript language runtime plugin
Sean Callanan [Thu, 9 Apr 2015 17:26:21 +0000 (17:26 +0000)]
Added the RenderScript language runtime plugin
to the .xcodeproj.

llvm-svn: 234508

9 years agoUse a raw_svector_ostream instead of a raw_string_ostream.
Rafael Espindola [Thu, 9 Apr 2015 17:16:25 +0000 (17:16 +0000)]
Use a raw_svector_ostream instead of a raw_string_ostream.

It saves a bit of copying.

llvm-svn: 234507

9 years agoDon't repeat name in comment. NFC.
Rafael Espindola [Thu, 9 Apr 2015 17:10:57 +0000 (17:10 +0000)]
Don't repeat name in comment. NFC.

llvm-svn: 234506

9 years ago[NFC] add more comments for SLSR
Jingyue Wu [Thu, 9 Apr 2015 17:04:28 +0000 (17:04 +0000)]
[NFC] add more comments for SLSR

llvm-svn: 234505

9 years agoMisc cleanup. NFC.
Rafael Espindola [Thu, 9 Apr 2015 16:59:07 +0000 (16:59 +0000)]
Misc cleanup. NFC.

These were lost when I reverted the raw_ostream changes.

llvm-svn: 234504

9 years agoInitial language runtime support for RenderScript.
Colin Riley [Thu, 9 Apr 2015 16:49:25 +0000 (16:49 +0000)]
Initial language runtime support for RenderScript.

Plan is to have this initialized on a per-process basis somewhat the same as the ObjC library on module loading, but this commit is simply the foundation work and will be incrementally built upon to add that detection functionality.

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

llvm-svn: 234503

9 years agoclang-format. NFC.
Rafael Espindola [Thu, 9 Apr 2015 16:43:22 +0000 (16:43 +0000)]
clang-format. NFC.

llvm-svn: 234502

9 years agoclang-format this constructor.
Rafael Espindola [Thu, 9 Apr 2015 16:37:11 +0000 (16:37 +0000)]
clang-format this constructor.

llvm-svn: 234501

9 years agoFix Xcode build after MipsLinuxSignals.cpp was added.
Greg Clayton [Thu, 9 Apr 2015 16:37:10 +0000 (16:37 +0000)]
Fix Xcode build after MipsLinuxSignals.cpp was added.

llvm-svn: 234500

9 years ago[CodeGen] When promoting a reference temporary to a global use the inner type to...
Benjamin Kramer [Thu, 9 Apr 2015 16:09:29 +0000 (16:09 +0000)]
[CodeGen] When promoting a reference temporary to a global use the inner type to fold it.

The MaterializeTemporaryExpr can have a different type than the inner
expression, miscompiling the constant. PR23165.

llvm-svn: 234499

9 years agoDon't repeat names in comments.
Rafael Espindola [Thu, 9 Apr 2015 16:06:26 +0000 (16:06 +0000)]
Don't repeat names in comments.

llvm-svn: 234498

9 years agoUse implicit calls to parent constructor. NFC.
Rafael Espindola [Thu, 9 Apr 2015 16:00:24 +0000 (16:00 +0000)]
Use implicit calls to parent constructor. NFC.

llvm-svn: 234497

9 years ago[ASan/Win] Add a test that makes sure coverage works at least in the simple cases
Timur Iskhodzhanov [Thu, 9 Apr 2015 15:58:38 +0000 (15:58 +0000)]
[ASan/Win] Add a test that makes sure coverage works at least in the simple cases

llvm-svn: 234496

9 years agoThis reverts commit r234460 and r234461.
Rafael Espindola [Thu, 9 Apr 2015 15:54:59 +0000 (15:54 +0000)]
This reverts commit r234460 and r234461.

Revert "Add classof implementations to the raw_ostream classes."
Revert "Use the cast machinery to remove dummy uses of formatted_raw_ostream."

The underlying issue can be fixed without classof.

llvm-svn: 234495

9 years ago[ASan/Win] Add more support for file operations
Timur Iskhodzhanov [Thu, 9 Apr 2015 15:25:21 +0000 (15:25 +0000)]
[ASan/Win] Add more support for file operations

llvm-svn: 234494

9 years agoProcess the -freciprocal-math optimization flag (PR20912)
Sanjay Patel [Thu, 9 Apr 2015 15:03:23 +0000 (15:03 +0000)]
Process the -freciprocal-math optimization flag (PR20912)

The driver currently accepts but ignores the -freciprocal-math flag.
This patch passes the flag through and enables 'arcp' fast-math-flag
generation in IR.

Note that this change does not actually enable the optimization for
any target. The reassociation optimization that this flag specifies
was implemented by http://reviews.llvm.org/D6334 :
http://llvm.org/viewvc/llvm-project?view=revision&revision=222510

Because the optimization is done in the backend rather than IR,
the backend must be modified to understand instruction-level
fast-math-flags or a new function-level attribute must be created.

Also note that -freciprocal-math is independent of any target-specific
usage of reciprocal estimate hardware instructions. That requires
its own flag ('-mrecip').

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

llvm-svn: 234493

9 years agoFix expectedFailureLLGS to expect failure when host platform is not linux.
Robert Flack [Thu, 9 Apr 2015 14:54:26 +0000 (14:54 +0000)]
Fix expectedFailureLLGS to expect failure when host platform is not linux.

expectedFailureLLGS has an early return false if the platform is not linux
except it should be checking the target platform on which the server is
running for remote tests.

Test Plan:
Verify expected failure when running from mac to remote linux llgs:
TestBreakAfterJoin.py, TestCreateDuringStep.py, TestExitDuringBreak.py,
TestProcessLaunch.py, TestThreadStates.py

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

llvm-svn: 234492

9 years agoUse error_t rather than int in a couple of places where we handle files
Timur Iskhodzhanov [Thu, 9 Apr 2015 14:49:53 +0000 (14:49 +0000)]
Use error_t rather than int in a couple of places where we handle files

llvm-svn: 234491

9 years agoUse RenameFile instead of internal_rename in non-POSIX code
Timur Iskhodzhanov [Thu, 9 Apr 2015 14:45:17 +0000 (14:45 +0000)]
Use RenameFile instead of internal_rename in non-POSIX code

llvm-svn: 234490

9 years agoAdd info on running remote test suite to the website
Pavel Labath [Thu, 9 Apr 2015 14:23:24 +0000 (14:23 +0000)]
Add info on running remote test suite to the website

Reviewers: tberghammer, zturner

Subscribers: lldb-commits

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

llvm-svn: 234489

9 years ago[ARM] add support for Cortex-R4/R4F
Javed Absar [Thu, 9 Apr 2015 14:12:10 +0000 (14:12 +0000)]
[ARM] add support for Cortex-R4/R4F

Adds ARM Cortex-R4 and R4F support and tests in Clang. Though Cortex-R4
support was present, the support for hwdiv in thumb-mode was not defined
or tested properly. This has also been added.

llvm-svn: 234488

9 years agoUse WriteToFile instead of internal_write in non-POSIX code
Timur Iskhodzhanov [Thu, 9 Apr 2015 14:11:25 +0000 (14:11 +0000)]
Use WriteToFile instead of internal_write in non-POSIX code

llvm-svn: 234487

9 years ago[ARM] support for Cortex-R4/R4F
Javed Absar [Thu, 9 Apr 2015 14:07:28 +0000 (14:07 +0000)]
[ARM] support for Cortex-R4/R4F

Currently, llvm (backend) doesn't know cortex-r4, even though it is the
default target for armv7r. Using "--target=armv7r-arm-none-eabi" provokes
'cortex-r4' is not a recognized processor for this target' by llvm.
This patch adds support for cortex-r4 and, very closely related, r4f.

llvm-svn: 234486

9 years agoUse ReadFromFile instead of internal_read in non-POSIX code
Timur Iskhodzhanov [Thu, 9 Apr 2015 13:38:14 +0000 (13:38 +0000)]
Use ReadFromFile instead of internal_read in non-POSIX code

llvm-svn: 234485

9 years agoNothing inherits from the asm streamer.
Rafael Espindola [Thu, 9 Apr 2015 13:04:20 +0000 (13:04 +0000)]
Nothing inherits from the asm streamer.

Make that explicit and remove protected:

llvm-svn: 234484