platform/upstream/llvm.git
11 years ago[analyzer] Warn about nil elements/keys/values in array and dictionary literals.
Anna Zaks [Mon, 13 May 2013 21:48:20 +0000 (21:48 +0000)]
[analyzer] Warn about nil elements/keys/values in array and dictionary literals.

llvm-svn: 181738

11 years agoPrevent convenience registers from being included in "read register" as they are...
Ashok Thirumurthi [Mon, 13 May 2013 21:45:50 +0000 (21:45 +0000)]
Prevent convenience registers from being included in "read register" as they are derived registers.

- Also refactors TestRegisters.py because test_convenience_registers_with_process_attach now fails with an assert.

TODO: Cross-reference the skipOnLinux decorator with a bugzilla report after root-causing this issue.
llvm-svn: 181737

11 years agoUnset CFLAGS/CXXFLAGS when running tests via cmake/make check targets
Daniel Malea [Mon, 13 May 2013 21:41:35 +0000 (21:41 +0000)]
Unset CFLAGS/CXXFLAGS when running tests via cmake/make check targets
- should fix automatic tests set up on http://llvm-jenkins.debian.net
- needed in order to make Debian package builds depend on passing test suite

llvm-svn: 181736

11 years agoCleanup test output when run via cmake/make check targets
Daniel Malea [Mon, 13 May 2013 21:37:02 +0000 (21:37 +0000)]
Cleanup test output when run via cmake/make check targets

llvm-svn: 181735

11 years agoMove a couple more statistics inside '#ifndef NDEBUG'.
Matt Beaumont-Gay [Mon, 13 May 2013 21:10:49 +0000 (21:10 +0000)]
Move a couple more statistics inside '#ifndef NDEBUG'.

Suppresses an unused-variable warning in -Asserts builds.

llvm-svn: 181733

11 years agoAlign a multiline string literal with the first part.
Daniel Jasper [Mon, 13 May 2013 20:50:15 +0000 (20:50 +0000)]
Align a multiline string literal with the first part.

Before:
  #define A(X)          \
    "aaaaa" #X "bbbbbb" \
               "ccccc"

After:
  #define A(X)          \
    "aaaaa" #X "bbbbbb" \
    "ccccc"

llvm-svn: 181732

11 years agoSuppress GCC warning for no return after covered switch, and remove some
Richard Smith [Mon, 13 May 2013 20:33:30 +0000 (20:33 +0000)]
Suppress GCC warning for no return after covered switch, and remove some
debugging code from an unreachable codepath.

llvm-svn: 181731

11 years agoFix a wrong and confusing comment in CharUnits.h. Neither C nor C++ allows
Richard Smith [Mon, 13 May 2013 20:28:15 +0000 (20:28 +0000)]
Fix a wrong and confusing comment in CharUnits.h. Neither C nor C++ allows
bytes and character units to be different sizes.

llvm-svn: 181730

11 years agoMips assembler: Assembler macro ADDIU $rs,imm
Jack Carter [Mon, 13 May 2013 20:26:46 +0000 (20:26 +0000)]
Mips assembler: Assembler macro ADDIU $rs,imm

This patch adds alias for addiu instruction which enables following syntax:

    addiu $rs,imm

The macro is translated as:

    addiu $rs,$rs,imm

Contributer: Vladimir Medic
llvm-svn: 181729

11 years agoUse atomic instructions on ARM linux.
Rafael Espindola [Mon, 13 May 2013 20:09:47 +0000 (20:09 +0000)]
Use atomic instructions on ARM linux.

This is safe given how the pre-v6 atomic ops funcions in libgcc are
implemented.

This fixes pr15429.

llvm-svn: 181728

11 years agoFixed expression evaluation with convenience registers.
Ashok Thirumurthi [Mon, 13 May 2013 19:56:46 +0000 (19:56 +0000)]
Fixed expression evaluation with convenience registers.

- Also improved test coverage for passing tests to include expr/x
and a sanity check for $eax as the lower half of $rax.

llvm-svn: 181727

11 years ago[objc-arc-opts] Add comment to BBState making it clear that get{TopDown,BottomUp...
Michael Gottesman [Mon, 13 May 2013 19:40:39 +0000 (19:40 +0000)]
[objc-arc-opts] Add comment to BBState making it clear that get{TopDown,BottomUp}PtrState will create a new PtrState object if it does not find a PtrState for Arg.

llvm-svn: 181726

11 years agoFix goofy commentary in PPCTargetObjectFile.cpp.
Bill Schmidt [Mon, 13 May 2013 19:40:36 +0000 (19:40 +0000)]
Fix goofy commentary in PPCTargetObjectFile.cpp.

llvm-svn: 181725

11 years agoFixed build break introduced by r181717
Daniel Malea [Mon, 13 May 2013 19:35:07 +0000 (19:35 +0000)]
Fixed build break introduced by r181717
- added missing ConstString header
- moved "using lldb*" statements to OS-independent section

llvm-svn: 181724

11 years agoPPC64: Constant initializers with dynamic relocations go in .data.rel.ro.
Bill Schmidt [Mon, 13 May 2013 19:34:37 +0000 (19:34 +0000)]
PPC64: Constant initializers with dynamic relocations go in .data.rel.ro.

This fixes warning messages observed in the oggenc application test in
projects/test-suite.  Special handling is needed for the 64-bit
PowerPC SVR4 ABI when a constant is initialized with a pointer to a
function in a shared library.  Because a function address is
implemented as the address of a function descriptor, the use of copy
relocations can lead to problems with initialization.  GNU ld
therefore replaces copy relocations with dynamic relocations to be
resolved by the dynamic linker.  This means the constant cannot reside
in the read-only data section, but instead belongs in .data.rel.ro,
which is designed for constants containing dynamic relocations.

The implementation creates a class PPC64LinuxTargetObjectFile
inheriting from TargetLoweringObjectFileELF, which behaves like its
parent except to place constants of this sort into .data.rel.ro.

The test case is reduced from the oggenc application.

llvm-svn: 181723

11 years agoAdd setting of lldb thread names on Linux.
Matt Kopec [Mon, 13 May 2013 19:33:58 +0000 (19:33 +0000)]
Add setting of lldb thread names on Linux.

Patch by Mike Sartain.

llvm-svn: 181722

11 years agoRemove redundant variable introduced by r181682.
Bob Wilson [Mon, 13 May 2013 19:02:31 +0000 (19:02 +0000)]
Remove redundant variable introduced by r181682.

llvm-svn: 181721

11 years agoRemoved a duplicate entry from the GDB to
Sean Callanan [Mon, 13 May 2013 18:30:58 +0000 (18:30 +0000)]
Removed a duplicate entry from the GDB to
LLDB transition page.  Also fixed a <b>...</b>
tag.

<rdar://problem/13871874>

llvm-svn: 181720

11 years ago[objc-arc] Move the before optimization statistics gathering phase out of OptimizeInd...
Michael Gottesman [Mon, 13 May 2013 18:29:07 +0000 (18:29 +0000)]
[objc-arc] Move the before optimization statistics gathering phase out of OptimizeIndividualCalls.

This makes the statistics gathering completely independent of the actual
optimization occuring, preventing any sort of bleeding over from occuring.

Additionally, it simplifies a switch statement in the non-statistic gathering case.

llvm-svn: 181719

11 years ago[mips] Add option -mno-ldc1-sdc1.
Akira Hatanaka [Mon, 13 May 2013 18:23:35 +0000 (18:23 +0000)]
[mips] Add option -mno-ldc1-sdc1.

This option is used when the user wants to avoid emitting double precision FP
loads and stores. Double precision FP loads and stores are expanded to single
precision instructions after register allocation.

llvm-svn: 181718

11 years ago<rdar://problem/13875830>
Greg Clayton [Mon, 13 May 2013 18:22:55 +0000 (18:22 +0000)]
<rdar://problem/13875830>

Unblock linux builds. The real fix for this is tracked by the above radar, but this temporary hack should fix things for now.

llvm-svn: 181717

11 years agoFix a bug that APFloat::fusedMultiplyAdd() mistakenly evaluate "14.5f * -14.5f +...
Shuxin Yang [Mon, 13 May 2013 18:03:12 +0000 (18:03 +0000)]
Fix a bug that APFloat::fusedMultiplyAdd() mistakenly evaluate "14.5f * -14.5f + 225.0f" to 225.0f.

llvm-svn: 181715

11 years ago[mips] Define a helper function which creates an instruction with the same
Akira Hatanaka [Mon, 13 May 2013 17:57:42 +0000 (17:57 +0000)]
[mips] Define a helper function which creates an instruction with the same
operands as the prototype instruction but with a different opcode.

llvm-svn: 181714

11 years ago[mips] Rename functions. No functionality changes.
Akira Hatanaka [Mon, 13 May 2013 17:43:19 +0000 (17:43 +0000)]
[mips] Rename functions. No functionality changes.

llvm-svn: 181713

11 years agoFix Linux warning about missing virtual destructor in Operation classes
Daniel Malea [Mon, 13 May 2013 17:32:07 +0000 (17:32 +0000)]
Fix Linux warning about missing virtual destructor in Operation classes

llvm-svn: 181712

11 years agoUnbreak cmake builds by skipping Darwin kernel plugin on non-Mac platforms
Daniel Malea [Mon, 13 May 2013 17:30:30 +0000 (17:30 +0000)]
Unbreak cmake builds by skipping Darwin kernel plugin on non-Mac platforms

llvm-svn: 181711

11 years agoObjective-C error recovery. This patch makes a quick
Fariborz Jahanian [Mon, 13 May 2013 17:27:00 +0000 (17:27 +0000)]
Objective-C error recovery. This patch makes a quick
recovery form duplicate method definition error thus
preventing doc parsing to loop trying to find comment
for the invalid redefinition in a previous declaration.
// rdar://13836387

llvm-svn: 181710

11 years ago<rdar://problem/13183720>
Enrico Granata [Mon, 13 May 2013 17:03:52 +0000 (17:03 +0000)]
<rdar://problem/13183720>

Provide a mechanism through which users can disable loading the Python scripts from dSYM files
This relies on a target setting: target.load-script-from-symbol-file which defaults to false ("do NOT load the script")
You need to set it to true before creating your target (or in your lldbinit file if you constantly rely on this feature) to allow the scripts to load

llvm-svn: 181709

11 years agoFix a typo in the comment
Sylvestre Ledru [Mon, 13 May 2013 14:53:09 +0000 (14:53 +0000)]
Fix a typo in the comment

llvm-svn: 181708

11 years agoFix test/CodeGenCXX/captured-statements.cpp on powerpc64
Ben Langmuir [Mon, 13 May 2013 14:45:11 +0000 (14:45 +0000)]
Fix test/CodeGenCXX/captured-statements.cpp on powerpc64

Generalize some attributes that differ on powerpc64 (i32 vs signext i32). Also
fix some copy-and-pasted code that didn't get updated properly.

llvm-svn: 181707

11 years agoRemove unused fields and arguments.
Rafael Espindola [Mon, 13 May 2013 14:34:48 +0000 (14:34 +0000)]
Remove unused fields and arguments.

llvm-svn: 181706

11 years agoThe purpose of the patch is to fix the syntax of ARM mrc and mrc2 instructions when...
Mihai Popa [Mon, 13 May 2013 14:10:04 +0000 (14:10 +0000)]
The purpose of the patch is to fix the syntax of ARM mrc and mrc2 instructions when they are used to write to the APSR. In this case, the destination operand should be APSR_nzcv, and the encoding of the target should be 0b1111 (same as for PC). In pre-UAL syntax, this form used the PC register as a textual target. This is still allowed for backward compatibility.

llvm-svn: 181705

11 years agoFix a gcc warning.
Rafael Espindola [Mon, 13 May 2013 14:05:53 +0000 (14:05 +0000)]
Fix a gcc warning.

In r181677 I removed this llvm_unreachable and it introduced a gcc
warning. Add it back.

Thanks to Patrik Hägglund for noticing it.

llvm-svn: 181704

11 years agoAlso pass the MCRegInfo to createMCAsmInfo. Follow the modification introduced in...
Sylvestre Ledru [Mon, 13 May 2013 13:41:13 +0000 (13:41 +0000)]
Also pass the MCRegInfo to createMCAsmInfo. Follow the modification introduced in commit r181680 of llvm

llvm-svn: 181703

11 years agoA better version of r181699: use raw_string_ostream.str() instead of manually calling...
Alexander Kornienko [Mon, 13 May 2013 12:56:35 +0000 (12:56 +0000)]
A better version of r181699: use raw_string_ostream.str() instead of manually calling .flush().

llvm-svn: 181702

11 years agoFix style according to post-commit review comments.
Manuel Klimek [Mon, 13 May 2013 12:53:04 +0000 (12:53 +0000)]
Fix style according to post-commit review comments.

llvm-svn: 181701

11 years agoImplements brace breaking styles.
Manuel Klimek [Mon, 13 May 2013 12:51:40 +0000 (12:51 +0000)]
Implements brace breaking styles.

We now support "Linux" and "Stroustrup" brace breaking styles, which
gets us one step closer to support formatting WebKit, KDE & Linux code.

Linux brace breaking style:
namespace a
{
class A
{
  void f()
  {
    if (x) {
      f();
    } else {
      g();
    }
  }
}
}

Stroustrup brace breaking style:
namespace a {
class A {
  void f()
  {
    if (x) {
      f();
    } else {
      g();
    }
  }
}
}

llvm-svn: 181700

11 years agoFixes [Bug 15960] YAMLTraits doesn't roundtrip on Windows.
Alexander Kornienko [Mon, 13 May 2013 12:41:08 +0000 (12:41 +0000)]
Fixes [Bug 15960] YAMLTraits doesn't roundtrip on Windows.
Thanks to Kim Gräsman for help!

llvm-svn: 181699

11 years ago[sanitizer] Generic sorting in sanitizer_common.
Sergey Matveev [Mon, 13 May 2013 11:58:48 +0000 (11:58 +0000)]
[sanitizer] Generic sorting in sanitizer_common.

llvm-svn: 181698

11 years ago[sanitizer] Fix StopTheWorld build on non-Android ARM.
Sergey Matveev [Mon, 13 May 2013 10:35:20 +0000 (10:35 +0000)]
[sanitizer] Fix StopTheWorld build on non-Android ARM.

Original patch by Abdoulaye Walsimou Gaye.

llvm-svn: 181697

11 years agoCorrectly preserve the input chain for potential tailcall nodes whose
Lang Hames [Mon, 13 May 2013 10:21:19 +0000 (10:21 +0000)]
Correctly preserve the input chain for potential tailcall nodes whose
return values are bitcasts.

The chain had previously been being clobbered with the entry node to
the dag, which sometimes caused other code in the function to be
erroneously deleted when tailcall optimization kicked in.

<rdar://problem/13827621>

llvm-svn: 181696

11 years agoUnder GNU/Linux, do not build lldbPluginDynamicLoaderDarwinKernel.a. It was breaking...
Sylvestre Ledru [Mon, 13 May 2013 10:18:51 +0000 (10:18 +0000)]
Under GNU/Linux, do not build lldbPluginDynamicLoaderDarwinKernel.a. It was breaking the build

llvm-svn: 181695

11 years agoAdd a new constructor with ConstString (and not only const char *). Hopefully fixes...
Sylvestre Ledru [Mon, 13 May 2013 09:43:11 +0000 (09:43 +0000)]
Add a new constructor with ConstString (and not only const char *). Hopefully fixes the build of lldb

llvm-svn: 181694

11 years agoImplements UseTab for clang-format.
Manuel Klimek [Mon, 13 May 2013 09:22:11 +0000 (09:22 +0000)]
Implements UseTab for clang-format.

This is required for kernel linux kernel style formatting.

llvm-svn: 181693

11 years agoFurther improve optimization for nested calls.
Daniel Jasper [Mon, 13 May 2013 09:19:24 +0000 (09:19 +0000)]
Further improve optimization for nested calls.

Fake parentheses (i.e. emulated parentheses used to correctly handle
binary expressions) used to prevent the optimization implemented in
r180264.

llvm-svn: 181692

11 years agoImplements IndentWidth.
Manuel Klimek [Mon, 13 May 2013 08:42:42 +0000 (08:42 +0000)]
Implements IndentWidth.

This is required for various styles that are for example based on
8-indent.

llvm-svn: 181690

11 years agoSuppress GCC compiler warnings in release builds about variables that are only
Duncan Sands [Mon, 13 May 2013 07:50:47 +0000 (07:50 +0000)]
Suppress GCC compiler warnings in release builds about variables that are only
read in asserts.

llvm-svn: 181689

11 years agoAssume macros to contain declarations.
Daniel Jasper [Mon, 13 May 2013 07:14:40 +0000 (07:14 +0000)]
Assume macros to contain declarations.

This seems to be the vastly more common case. If we find enough
examples to the contrary, we can make it smarter.

Before: #define MACRO void f(int * a)
After:  #define MACRO void f(int *a)
llvm-svn: 181687

11 years agoDebug Info: PR14992: Support values for non-type template parameters of function...
David Blaikie [Mon, 13 May 2013 06:57:50 +0000 (06:57 +0000)]
Debug Info: PR14992: Support values for non-type template parameters of function type

llvm-svn: 181685

11 years agoSLPVectorizer: Swap LHS and RHS. No functionality change.
Nadav Rotem [Mon, 13 May 2013 05:13:13 +0000 (05:13 +0000)]
SLPVectorizer: Swap LHS and RHS. No functionality change.

llvm-svn: 181684

11 years agoOpenMP threadprivate with qualified names.
Alexey Bataev [Mon, 13 May 2013 04:18:18 +0000 (04:18 +0000)]
OpenMP threadprivate with qualified names.

llvm-svn: 181683

11 years agoFix PR15950 A bug in DAG Combiner about undef mask
Hao Liu [Mon, 13 May 2013 02:07:05 +0000 (02:07 +0000)]
Fix PR15950 A bug in DAG Combiner about undef mask

llvm-svn: 181682

11 years agoUpdate for LLVM interface change in r181680.
Rafael Espindola [Mon, 13 May 2013 01:24:18 +0000 (01:24 +0000)]
Update for LLVM interface change in r181680.

llvm-svn: 181681

11 years agoRemove the MachineMove class.
Rafael Espindola [Mon, 13 May 2013 01:16:13 +0000 (01:16 +0000)]
Remove the MachineMove class.

It was just a less powerful and more confusing version of
MCCFIInstruction. A side effect is that, since MCCFIInstruction uses
dwarf register numbers, calls to getDwarfRegNum are pushed out, which
should allow further simplifications.

I left the MachineModuleInfo::addFrameMove interface unchanged since
this patch was already fairly big.

llvm-svn: 181680

11 years agoAdd missing triple to CodeGen test.
Richard Smith [Mon, 13 May 2013 00:29:57 +0000 (00:29 +0000)]
Add missing triple to CodeGen test.

llvm-svn: 181679

11 years agoXFAIL this test for mingw too.
Rafael Espindola [Mon, 13 May 2013 00:18:24 +0000 (00:18 +0000)]
XFAIL this test for mingw too.

llvm-svn: 181678

11 years agoCleanup handling of UniqueExternalLinkage.
Rafael Espindola [Mon, 13 May 2013 00:12:11 +0000 (00:12 +0000)]
Cleanup handling of UniqueExternalLinkage.

This patch renames getLinkage to getLinkageInternal. Only code that
needs to handle UniqueExternalLinkage specially should call this.

Linkage, as defined in the c++ standard, is provided by
getFormalLinkage. It maps UniqueExternalLinkage to ExternalLinkage.

Most places in the compiler actually want isExternallyVisible, which
handles UniqueExternalLinkage as internal.

llvm-svn: 181677

11 years agoDowngrade C++14 "Clarifying memory allocation". We perform non-conforming
Richard Smith [Sun, 12 May 2013 23:39:32 +0000 (23:39 +0000)]
Downgrade C++14 "Clarifying memory allocation". We perform non-conforming
optimizations -- in particular, globalopt will remove calls to ::operator
new(size_t) that did not come from new-expressions.

llvm-svn: 181676

11 years agoFix stack overflow in linkage computation when a function with a deduced return
Richard Smith [Sun, 12 May 2013 23:17:59 +0000 (23:17 +0000)]
Fix stack overflow in linkage computation when a function with a deduced return
type returns a lambda defined within itself. The computation of linkage for the
function looked at the linkage of the lambda, and vice versa.

This is solved by not checking whether an 'auto' in a function return type
deduces to a type with unique external linkage. We don't need this check,
because the type deduced for 'auto' doesn't affect whether two
otherwise-identical declarations would name different functions, so we don't
need to give an ostensibly external-linkage function internal linkage for this
reason. (We also don't need unique-external linkage in C++11 onwards at all,
but that's not implemented yet.)

llvm-svn: 181675

11 years agoSLPVectorizer: Fix a bug in the code that generates extracts for values with multiple...
Nadav Rotem [Sun, 12 May 2013 22:58:45 +0000 (22:58 +0000)]
SLPVectorizer: Fix a bug in the code that generates extracts for values with multiple users.
The external user does not have to be in lane #0. We have to save the lane for each scalar so that we know which vector lane to extract.

llvm-svn: 181674

11 years agoSLPVectorizer: Clear the map that maps between scalars to vectors after each round...
Nadav Rotem [Sun, 12 May 2013 22:55:57 +0000 (22:55 +0000)]
SLPVectorizer: Clear the map that maps between scalars to vectors after each round of vectorization.
Testcase in the next commit.

llvm-svn: 181673

11 years agoDebug Info: Comment changes in r181393 by request of echristo
David Blaikie [Sun, 12 May 2013 18:05:52 +0000 (18:05 +0000)]
Debug Info: Comment changes in r181393 by request of echristo

llvm-svn: 181672

11 years agoC++1y: support for 'switch' statements in constexpr functions. This is somewhat
Richard Smith [Sun, 12 May 2013 17:32:42 +0000 (17:32 +0000)]
C++1y: support for 'switch' statements in constexpr functions. This is somewhat
inefficient; we perform a linear scan of switch labels to find the one matching
the condition, and then walk the body looking for that label. Both parts should
be straightforward to optimize.

llvm-svn: 181671

11 years agoC++1y: provide full 'auto' return type deduction for lambda expressions. This
Richard Smith [Sun, 12 May 2013 03:09:35 +0000 (03:09 +0000)]
C++1y: provide full 'auto' return type deduction for lambda expressions. This
completes the implementation of N3638.

llvm-svn: 181669

11 years agoInstCombine: Flip the order of two urem transforms
David Majnemer [Sun, 12 May 2013 00:07:05 +0000 (00:07 +0000)]
InstCombine: Flip the order of two urem transforms

There are two transforms in visitUrem that conflict with each other.

*) One, if a divisor is a power of two, subtracts one from the divisor
   and turns it into a bitwise-and.
*) The other unwraps both operands if they are surrounded by zext
   instructions.

Flipping the order allows the subtraction to go beneath the sign
extension.

llvm-svn: 181668

11 years agoLoopVectorize: Use the widest induction variable type
Arnold Schwaighofer [Sat, 11 May 2013 23:04:28 +0000 (23:04 +0000)]
LoopVectorize: Use the widest induction variable type

Use the widest induction type encountered for the cannonical induction variable.

We used to turn the following loop into an empty loop because we used i8 as
induction variable type and truncated 1024 to 0 as trip count.

int a[1024];
void fail() {
  int reverse_induction = 1023;
  unsigned char forward_induction = 0;
  while ((reverse_induction) >= 0) {
    forward_induction++;
    a[reverse_induction] = forward_induction;
    --reverse_induction;
  }
}

radar://13862901

llvm-svn: 181667

11 years agoLoopVectorize: Use variable instead of repeated function call
Arnold Schwaighofer [Sat, 11 May 2013 23:04:26 +0000 (23:04 +0000)]
LoopVectorize: Use variable instead of repeated function call

No functionality change intended.

llvm-svn: 181666

11 years agoLoopVectorize: Use IRBuilder interface in more places
Arnold Schwaighofer [Sat, 11 May 2013 23:04:24 +0000 (23:04 +0000)]
LoopVectorize: Use IRBuilder interface in more places

No functionality change intended.

llvm-svn: 181665

11 years agoCorrect parameter name in doc comment to match declaration.
David Blaikie [Sat, 11 May 2013 19:14:10 +0000 (19:14 +0000)]
Correct parameter name in doc comment to match declaration.

(review feedback on r181632 from Dmitri)

llvm-svn: 181664

11 years agoStringRefize some debug accel table bits.
Benjamin Kramer [Sat, 11 May 2013 18:24:28 +0000 (18:24 +0000)]
StringRefize some debug accel table bits.

llvm-svn: 181663

11 years agoCodeGen: Refactor SetLLVMFunctionAttributesForDefinition to use an AttrBuilder.
Benjamin Kramer [Sat, 11 May 2013 12:45:37 +0000 (12:45 +0000)]
CodeGen: Refactor SetLLVMFunctionAttributesForDefinition to use an AttrBuilder.

Adding attributes to a uniqued set has become expensive, don't do it more often
than necessary. No functionality change.

llvm-svn: 181662

11 years agoInstCombine: Turn urem to bitwise-and more often
David Majnemer [Sat, 11 May 2013 09:01:28 +0000 (09:01 +0000)]
InstCombine: Turn urem to bitwise-and more often

Use isKnownToBeAPowerOfTwo in visitUrem so that we may more aggressively
fold away urem instructions.

llvm-svn: 181661

11 years ago[Mips] Add -mldc1-sdc1 / -mno-ldc1-sdc1 command line options.
Simon Atanasyan [Sat, 11 May 2013 06:33:44 +0000 (06:33 +0000)]
[Mips] Add -mldc1-sdc1 / -mno-ldc1-sdc1 command line options.

llvm-svn: 181660

11 years agoC++1y deduced return types: when we deduce a return type for a function which
Richard Smith [Sat, 11 May 2013 05:45:24 +0000 (05:45 +0000)]
C++1y deduced return types: when we deduce a return type for a function which
we loaded from PCH, if we're building another PCH, create an update record to
patch the return type of the earlier declaration.

llvm-svn: 181659

11 years agoUpdate ProcessKDP and ProcessMachCore to use ConstString plugin
Jason Molenda [Sat, 11 May 2013 03:09:05 +0000 (03:09 +0000)]
Update ProcessKDP and ProcessMachCore to use ConstString plugin
names when specifying the DynamicLoaderDarwinKernel.

ProcessGDBRemote wasn't setting the dyld string any more; remove
the remaining code tracking the dyld plugin name altogether from
that process plugin.

llvm-svn: 181658

11 years agoChange getFrameMoves to return a const reference.
Rafael Espindola [Sat, 11 May 2013 02:38:11 +0000 (02:38 +0000)]
Change getFrameMoves to return a const reference.

To add a frame now there is a dedicated addFrameMove which also takes
care of constructing the move itself.

llvm-svn: 181657

11 years agoRemove more dead code.
Rafael Espindola [Sat, 11 May 2013 02:24:41 +0000 (02:24 +0000)]
Remove more dead code.

llvm-svn: 181656

11 years ago[lld] Add help text for -flavor option.
Rui Ueyama [Sat, 11 May 2013 01:24:38 +0000 (01:24 +0000)]
[lld] Add help text for -flavor option.

llvm-svn: 181655

11 years agoAdd -mtriple=mipsel-linux-gnu to the test so that the compiler does
Reed Kotler [Sat, 11 May 2013 01:02:20 +0000 (01:02 +0000)]
Add -mtriple=mipsel-linux-gnu to the test so that the compiler does
not think it can support small data sections.

llvm-svn: 181654

11 years agoA couple of small fixes to make core file debugging less noisy.
Jason Molenda [Sat, 11 May 2013 00:52:25 +0000 (00:52 +0000)]
A couple of small fixes to make core file debugging less noisy.
Don't want about being unable to find a needed objective-c runtime
function when we're core file debugging and can't jit anything
anyway.  Don't warn when quitting a debug session on a core file,
the program state can be reconstructed by re-running lldb on the
same core file again.

llvm-svn: 181653

11 years ago[lld] Fix typo in document.
Rui Ueyama [Sat, 11 May 2013 00:26:26 +0000 (00:26 +0000)]
[lld] Fix typo in document.

llvm-svn: 181652

11 years ago<rdar://problem/13700260>
Greg Clayton [Fri, 10 May 2013 23:48:10 +0000 (23:48 +0000)]
<rdar://problem/13700260>

Avoid a deadlock when using the OperatingSystemPython code and typing "process interrupt". There was a possible lock inversion between the target API lock and the process' thread list lock due to code trying to discard the thread list. This was fixed by adding a boolean to Process::Halt() that indicates if the thread plans should be discarded and doing it in the private state thread when we process the stopped state.

llvm-svn: 181651

11 years agoDebug Info: correct comment
David Blaikie [Fri, 10 May 2013 23:36:06 +0000 (23:36 +0000)]
Debug Info: correct comment

Eric's code review feedback to r181644

llvm-svn: 181650

11 years agoRemove dead code.
Rafael Espindola [Fri, 10 May 2013 23:34:51 +0000 (23:34 +0000)]
Remove dead code.

llvm-svn: 181649

11 years agoSLPVectorizer: Add support for trees with external users.
Nadav Rotem [Fri, 10 May 2013 22:59:33 +0000 (22:59 +0000)]
SLPVectorizer: Add support for trees with external users.

For example:
bar() {
  int a = A[i];
  int b = A[i+1];
  B[i] = a;
  B[i+1] = b;
  foo(a);  <--- a is used outside the vectorized expression.
}

llvm-svn: 181648

11 years agoAdd a debug print
Nadav Rotem [Fri, 10 May 2013 22:56:18 +0000 (22:56 +0000)]
Add a debug print

llvm-svn: 181647

11 years agoAdd an additional testcase for PR15882.
Nadav Rotem [Fri, 10 May 2013 22:55:44 +0000 (22:55 +0000)]
Add an additional testcase for PR15882.

llvm-svn: 181646

11 years agoUse mangled and demangled names when checking for a function in a namespace and a...
Matt Kopec [Fri, 10 May 2013 22:55:24 +0000 (22:55 +0000)]
Use mangled and demangled names when checking for a function in a namespace and a function in an anonymous namespace, respectively.

llvm-svn: 181645

11 years agoDebug Info: Silently accept template argument packs
David Blaikie [Fri, 10 May 2013 22:53:25 +0000 (22:53 +0000)]
Debug Info: Silently accept template argument packs

We could support the GCC extension DW_TAG_GNU_template_parameter_pack if
we're feeling adventurous, at some point - but I don't think GDB's doing
anything useful with it yet anyway.

llvm-svn: 181644

11 years ago[Modules] Make r180934 more efficient by only loading top-level module maps in system...
Douglas Gregor [Fri, 10 May 2013 22:52:27 +0000 (22:52 +0000)]
[Modules] Make r180934 more efficient by only loading top-level module maps in system header directories.

llvm-svn: 181643

11 years agoCheckin in of first of several patches to finish implementation of
Reed Kotler [Fri, 10 May 2013 22:25:39 +0000 (22:25 +0000)]
Checkin in of first of several patches to finish implementation of
mips16/mips32 floating point interoperability.

This patch fixes returns from mips16 functions so that if the function
was in fact called by a mips32 hard float routine, then values
that would have been returned in floating point registers are so returned.

Mips16 mode has no floating point instructions so there is no way to
load values into floating point registers.

This is needed when returning float, double, single complex, double complex
in the Mips ABI.

Helper functions in libc for mips16 are available to do this.

For efficiency purposes, these helper functions have a different calling
convention from normal Mips calls.

Registers v0,v1,a0,a1 are used to pass parameters instead of
a0,a1,a2,a3.

This is because v0,v1,a0,a1 are the natural registers used to return
floating point values in soft float. These values can then be moved
to the appropriate floating point registers with no extra cost.

The only register that is modified is ra in this call.

The helper functions make sure that the return values are in the floating
point registers that they would be in if soft float was not in effect
(which it is for mips16, though the soft float is implemented using a mips32
library that uses hard float).

llvm-svn: 181641

11 years ago[lld] Document about how to enable debug output.
Rui Ueyama [Fri, 10 May 2013 22:19:28 +0000 (22:19 +0000)]
[lld] Document about how to enable debug output.

llvm-svn: 181640

11 years agoMicro-optimization: don't shift an entire bitcode record over to get the code.
Jordan Rose [Fri, 10 May 2013 22:17:10 +0000 (22:17 +0000)]
Micro-optimization: don't shift an entire bitcode record over to get the code.

Previously, BitstreamCursor read an abbreviated record by splatting the
whole thing into a data vector, then extracting and removing the /first/
element. Now, it reads the first element--the record code--separately from
the actual field values.

No (intended) functionality change.

llvm-svn: 181639

11 years ago[Modules] When things go horribly wrong when reading a module, point at the module...
Douglas Gregor [Fri, 10 May 2013 22:15:13 +0000 (22:15 +0000)]
[Modules] When things go horribly wrong when reading a module, point at the module cache.

Sometimes people hack on their system headers. In such cases, they'll
need to delete their module cache, but may not know where it is. Add a
note to show them where it is.

llvm-svn: 181638

11 years agoGive the test from r181632 a target triple.
David Blaikie [Fri, 10 May 2013 22:14:39 +0000 (22:14 +0000)]
Give the test from r181632 a target triple.

llvm-svn: 181637

11 years agoHardened LLDB against NULL conditions being
Sean Callanan [Fri, 10 May 2013 21:58:45 +0000 (21:58 +0000)]
Hardened LLDB against NULL conditions being
passed to breakpoints.

<rdar://problem/13853205>

llvm-svn: 181636

11 years ago[Modules] Extend Darwin hack to include the modification time of SystemVersion.plist.
Douglas Gregor [Fri, 10 May 2013 21:54:08 +0000 (21:54 +0000)]
[Modules] Extend Darwin hack to include the modification time of SystemVersion.plist.

Fixes <rdar://problem/13856838>.

llvm-svn: 181635

11 years agoPR14992: Debug Info: Support more non-type template parameters
David Blaikie [Fri, 10 May 2013 21:53:14 +0000 (21:53 +0000)]
PR14992: Debug Info: Support more non-type template parameters

* Provide DW_TAG_template_value_parameter for pointers, function
  pointers, member pointers, and member function pointers (still missing
  support for template template parameters which GCC encodes as a
  DW_TAG_GNU_template_template_param)
* Provide values for all but the (member & non-member) function pointer case.
  Simple constant integer values for member pointers (offset within the
  object) and address for the value pointer case. GCC doesn't provide a
  value for the member function pointer case so I'm not sure how, if at
  all, GDB supports encoding that. & non-member function pointers should
  follow shortly in a subsequent patch.
* Null pointer value encodings of all of these types, including
  correctly encoding null data member pointers as -1.

llvm-svn: 181634

11 years agoPR14492: Debug Info: Support for values of non-integer non-type template parameters.
David Blaikie [Fri, 10 May 2013 21:52:07 +0000 (21:52 +0000)]
PR14492: Debug Info: Support for values of non-integer non-type template parameters.

This is only tested for global variables at the moment (& includes tests
for the unnamed parameter case, since apparently this entire function
was completely untested previously)

llvm-svn: 181632

11 years ago<rdar://problem/13854277>
Greg Clayton [Fri, 10 May 2013 21:47:16 +0000 (21:47 +0000)]
<rdar://problem/13854277>
<rdar://problem/13594769>

Main changes in this patch include:
- cleanup plug-in interface and use ConstStrings for plug-in names
- Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp
- Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging

The plug-in interface changes:

Modified the lldb_private::PluginInterface class that all plug-ins inherit from:

Changed:

virtual const char * GetPluginName() = 0;

To:

virtual ConstString GetPluginName() = 0;

Removed:

virtual const char * GetShortPluginName() = 0;

- Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names.
- Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc.

llvm-svn: 181631