platform/upstream/llvm.git
11 years agoAdded Repr() and Str() member functions to our PythonObject class to allow easy conve...
Enrico Granata [Fri, 12 Jul 2013 21:11:02 +0000 (21:11 +0000)]
Added Repr() and Str() member functions to our PythonObject class to allow easy conversion to-string of every PythonObject

llvm-svn: 186205

11 years agoRemove empty directory.
Rafael Espindola [Fri, 12 Jul 2013 20:54:34 +0000 (20:54 +0000)]
Remove empty directory.

llvm-svn: 186203

11 years agoRename directory to avoid problems on windows.
Rafael Espindola [Fri, 12 Jul 2013 20:53:23 +0000 (20:53 +0000)]
Rename directory to avoid problems on windows.

llvm-svn: 186202

11 years agoAdding information on the scriptable keywords ${target|process|thread|frame.script...
Enrico Granata [Fri, 12 Jul 2013 20:46:02 +0000 (20:46 +0000)]
Adding information on the scriptable keywords ${target|process|thread|frame.script:function} to the LLDB documentation

llvm-svn: 186201

11 years agofix autoconf build
Rafael Espindola [Fri, 12 Jul 2013 20:45:01 +0000 (20:45 +0000)]
fix autoconf build

llvm-svn: 186200

11 years agoUnrevert r186040, reverted in r186185, with fix for PR16597.
Richard Smith [Fri, 12 Jul 2013 20:38:49 +0000 (20:38 +0000)]
Unrevert r186040, reverted in r186185, with fix for PR16597.

Original commit log:
  If we friend a declaration twice, that should not make it visible to
  name lookup in the surrounding context. Slightly rework how we handle
  friend declarations to inherit the visibility of the prior
  declaration, rather than setting a friend declaration to be visible
  whenever there was a prior declaration.

llvm-svn: 186199

11 years agoFix the build with c++03.
Rafael Espindola [Fri, 12 Jul 2013 20:28:02 +0000 (20:28 +0000)]
Fix the build with c++03.

llvm-svn: 186198

11 years agoChange llvm-ar to use lib/Object.
Rafael Espindola [Fri, 12 Jul 2013 20:21:39 +0000 (20:21 +0000)]
Change llvm-ar to use lib/Object.

This fixes two bugs is lib/Object that the use in llvm-ar found:
* In OS X created archives, the name can be padded with nulls. Strip them.
* In the constructor, remember the first non special member and use that in
  begin_children. This makes sure we skip all special members, not just the
  first one.

The change to llvm-ar itself consist of
* Using lib/Object for reading archives instead of ArchiveReader.cpp.
* Writing the modified archive directly, instead of creating an in memory
  representation.

The old Archive library was way more general than what is needed, as can
be seen by the diffstat of this patch.

Having llvm-ar using lib/Object now opens the way for creating regular symbol
tables for both native objects and bitcode files so that we can use those
archives for LTO.

llvm-svn: 186197

11 years agoR600: Remove unsafe type punning. No intended functionality change.
Benjamin Kramer [Fri, 12 Jul 2013 20:18:05 +0000 (20:18 +0000)]
R600: Remove unsafe type punning. No intended functionality change.

llvm-svn: 186196

11 years agoFix the linux gcc 4.6.3 buildbot failures that happened after my recent types checkin.
Greg Clayton [Fri, 12 Jul 2013 20:08:35 +0000 (20:08 +0000)]
Fix the linux gcc 4.6.3 buildbot failures that happened after my recent types checkin.

llvm-svn: 186195

11 years agoEnabled the "--debug" option functionality that will SIGSTOP the current process...
Greg Clayton [Fri, 12 Jul 2013 20:08:00 +0000 (20:08 +0000)]
Enabled the "--debug" option functionality that will SIGSTOP the current process allowing a debugger to attach.

llvm-svn: 186194

11 years agoWork-around for GCC issue where setting a breakpoint on a vector definition also...
Daniel Malea [Fri, 12 Jul 2013 19:46:47 +0000 (19:46 +0000)]
Work-around for GCC issue where setting a breakpoint on a vector definition also adds a breakpoint on the d'tor call

llvm-svn: 186193

11 years agoAdd a test for llvm-ar's u option.
Rafael Espindola [Fri, 12 Jul 2013 19:34:24 +0000 (19:34 +0000)]
Add a test for llvm-ar's u option.

llvm-svn: 186192

11 years agoR600: Remove the fpconst64.ll test which was failing on non-x86 buildbots
Tom Stellard [Fri, 12 Jul 2013 19:29:54 +0000 (19:29 +0000)]
R600: Remove the fpconst64.ll test which was failing on non-x86 buildbots

I'm guessing the failure had something to do with the double precision
floating point constant used in the test.

llvm-svn: 186191

11 years agoHandle BreakNotify for threads whose tid doesn't match the ThreadSpec of the Breakpoi...
Ashok Thirumurthi [Fri, 12 Jul 2013 19:19:15 +0000 (19:19 +0000)]
Handle BreakNotify for threads whose tid doesn't match the ThreadSpec of the BreakpointSite
to avoid asserts when stepping in a multi-threaded application.

Note: Test to follow shortly.
llvm-svn: 186190

11 years agoX86 cost model: Add cost for vectorized gather/scather
Arnold Schwaighofer [Fri, 12 Jul 2013 19:16:07 +0000 (19:16 +0000)]
X86 cost model: Add cost for vectorized gather/scather

radar://14351991

llvm-svn: 186189

11 years agoARM cost model: Add cost for gather/scather
Arnold Schwaighofer [Fri, 12 Jul 2013 19:16:04 +0000 (19:16 +0000)]
ARM cost model: Add cost for gather/scather

Fixes a 35% degradation compared to unvectorized code in
MiBench/automotive-susan and an equally serious regression on a private
image processing benchmark.

radar://14351991

llvm-svn: 186188

11 years agoTargetTransformInfo: address calculation parameter for gather/scather
Arnold Schwaighofer [Fri, 12 Jul 2013 19:16:02 +0000 (19:16 +0000)]
TargetTransformInfo: address calculation parameter for gather/scather

Address calculation for gather/scather in vectorized code can incur a
significant cost making vectorization unbeneficial. Add infrastructure to add
cost.
Tests and cost model for targets will be in follow-up commits.

radar://14351991

llvm-svn: 186187

11 years agoRelax the test a bit more to handle different UIDs and GIDs.
Rafael Espindola [Fri, 12 Jul 2013 19:13:16 +0000 (19:13 +0000)]
Relax the test a bit more to handle different UIDs and GIDs.

llvm-svn: 186186

11 years agoRevert r186040 to fix PR16597 while Richard investigates what the best
Chandler Carruth [Fri, 12 Jul 2013 18:54:40 +0000 (18:54 +0000)]
Revert r186040 to fix PR16597 while Richard investigates what the best
fix is.

Original commit log:
  If we friend a declaration twice, that should not make it visible to
  name lookup in the surrounding context. Slightly rework how we handle
  friend declarations to inherit the visibility of the prior
  declaration, rather than setting a friend declaration to be visible
  whenever there was a prior declaration.

llvm-svn: 186185

11 years agoRelax test a bit to handle umask differences.
Rafael Espindola [Fri, 12 Jul 2013 18:54:28 +0000 (18:54 +0000)]
Relax test a bit to handle umask differences.

llvm-svn: 186184

11 years agoAdd a test for the 'o' option in llvm-ar.
Rafael Espindola [Fri, 12 Jul 2013 18:51:25 +0000 (18:51 +0000)]
Add a test for the 'o' option in llvm-ar.

llvm-svn: 186183

11 years agoR600/SI: Add support for f64 kernel arguments
Tom Stellard [Fri, 12 Jul 2013 18:15:26 +0000 (18:15 +0000)]
R600/SI: Add support for f64 kernel arguments

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 186182

11 years agoR600/SI: Implement select and compares for SI
Tom Stellard [Fri, 12 Jul 2013 18:15:19 +0000 (18:15 +0000)]
R600/SI: Implement select and compares for SI

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 186181

11 years agoR600/SI: Add fsqrt pattern for SI
Tom Stellard [Fri, 12 Jul 2013 18:15:13 +0000 (18:15 +0000)]
R600/SI: Add fsqrt pattern for SI

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 186180

11 years agoR600/SI: Add double precision fsub pattern for SI
Tom Stellard [Fri, 12 Jul 2013 18:15:08 +0000 (18:15 +0000)]
R600/SI: Add double precision fsub pattern for SI

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 186179

11 years agoR600/SI: SI support for 64bit ConstantFP
Tom Stellard [Fri, 12 Jul 2013 18:15:02 +0000 (18:15 +0000)]
R600/SI: SI support for 64bit ConstantFP

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 186178

11 years agoR600/SI: Add initial double precision support for SI
Tom Stellard [Fri, 12 Jul 2013 18:14:56 +0000 (18:14 +0000)]
R600/SI: Add initial double precision support for SI

Patch by: Niels Ole Salscheider

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 186177

11 years agoR600: Add ISA documents to the CompilerWriterInfo page
Tom Stellard [Fri, 12 Jul 2013 18:14:40 +0000 (18:14 +0000)]
R600: Add ISA documents to the CompilerWriterInfo page

llvm-svn: 186176

11 years agoFixed comment in header of Block Frequency Impl and added text for C++ mode.
Michael Gottesman [Fri, 12 Jul 2013 18:11:14 +0000 (18:11 +0000)]
Fixed comment in header of Block Frequency Impl and added text for C++ mode.

This is a generic block implementation that works on more than machine blocks.
The C++ mode addition is a bonus due to the extra space provided.

llvm-svn: 186175

11 years agoX86: Shrink certain forms of movsx.
Benjamin Kramer [Fri, 12 Jul 2013 18:06:44 +0000 (18:06 +0000)]
X86: Shrink certain forms of movsx.

In particular:
movsbw %al, %ax   --> cbtw
movswl %ax, %eax  --> cwtl
movslq %eax, %rax --> cltq

According to Intel's manual those have the same performance characteristics but
come with a smaller encoding.

llvm-svn: 186174

11 years ago[analyzer] Treat nullPtrType as a location type.
Anna Zaks [Fri, 12 Jul 2013 17:58:33 +0000 (17:58 +0000)]
[analyzer] Treat nullPtrType as a location type.

Fixes PR16584 (radar://14415223).

llvm-svn: 186172

11 years agofixes a typo caught by Jordan.
Fariborz Jahanian [Fri, 12 Jul 2013 16:41:56 +0000 (16:41 +0000)]
fixes a typo caught by Jordan.

llvm-svn: 186171

11 years agoAdd static.
Rafael Espindola [Fri, 12 Jul 2013 16:29:27 +0000 (16:29 +0000)]
Add static.

llvm-svn: 186170

11 years agoObjective-C: Produce gcc compatible encoding of
Fariborz Jahanian [Fri, 12 Jul 2013 16:19:11 +0000 (16:19 +0000)]
Objective-C: Produce gcc compatible encoding of
ivar type in meta-data while preventing recursive
encoding in a corner case. // rdar://14408244

llvm-svn: 186169

11 years agoThe correct max value for size_t variables is SIZE_MAX not UINT64_MAX. Removes lots...
Jim Ingham [Fri, 12 Jul 2013 16:16:44 +0000 (16:16 +0000)]
The correct max value for size_t variables is SIZE_MAX not UINT64_MAX.  Removes lots of warnings when building on 32 bit hosts.

llvm-svn: 186168

11 years ago[scan-build] Add missing comma to ccc-analyzer.
Jordan Rose [Fri, 12 Jul 2013 16:07:33 +0000 (16:07 +0000)]
[scan-build] Add missing comma to ccc-analyzer.

Thanks, Dmitry!

llvm-svn: 186167

11 years agoFix gcc buildbot failures, re-enable tests disabled due to llvm.org/pr16575
Daniel Malea [Fri, 12 Jul 2013 16:02:25 +0000 (16:02 +0000)]
Fix gcc buildbot failures, re-enable tests disabled due to llvm.org/pr16575

llvm-svn: 186166

11 years agoX86: fold SSE2/AVX2 logical shift by immediate amount into zero vector when possible
Stephen Lin [Fri, 12 Jul 2013 15:31:36 +0000 (15:31 +0000)]
X86: fold SSE2/AVX2 logical shift by immediate amount into zero vector when possible

Patch by Andrea Di Biagio

llvm-svn: 186165

11 years agoclang-format: Improve <<-formatting.
Daniel Jasper [Fri, 12 Jul 2013 15:14:05 +0000 (15:14 +0000)]
clang-format: Improve <<-formatting.

This fixes a regression caused by r186115.

Before:
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
       bbbbbbbbb) << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                  << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbb)
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

llvm-svn: 186164

11 years agoStart using CHECK-LABEL in some tests.
Stephen Lin [Fri, 12 Jul 2013 14:54:12 +0000 (14:54 +0000)]
Start using CHECK-LABEL in some tests.

llvm-svn: 186163

11 years agoAdd new directive called CHECK-LABEL to FileCheck.
Stephen Lin [Fri, 12 Jul 2013 14:51:05 +0000 (14:51 +0000)]
Add new directive called CHECK-LABEL to FileCheck.

CHECK-LABEL is meant to be used in place on CHECK on lines containing identifiers or other unique labels (they need not actually be labels in the source or output language, though.) This is used to break up the input stream into separate blocks delineated by CHECK-LABEL lines, each of which is checked independently. This greatly improves the accuracy of errors and fix-it hints in many cases, and allows for FileCheck to recover from errors in one block by continuing to subsequent blocks.

Some tests will be converted to use this new directive in forthcoming patches.

llvm-svn: 186162

11 years agocpp11-migrate: FileOverrides/Transform refactoring.
Tareq A. Siraj [Fri, 12 Jul 2013 14:36:20 +0000 (14:36 +0000)]
cpp11-migrate: FileOverrides/Transform refactoring.

This commit include the following changes:
 - SourceOverrides is now a class
   - it simplifies the usage for the Transform class, since now the
     replacements can be applied directly to the file overrides with
     SourceOverrides::applyReplacements().
   - it contains a method applyRewrites() which was previously named
     collectResults() in Transform.cpp. The method has been "optimized"
     a bit to re-use the allocated buffer (std::string::clear() is called).
   - since the class has some logic it's now unit tested
 - Now FileOverrides is a class (not a std::map typedef) and store pointers
   to the SourceOverrides. The reason is that the SourceOverrides can't be
   copied anymore (which was already something to avoid since it's can be a
   quite large object).

Author: Guillaume Papin <guillaume.papin@epitech.eu>

Differential Revision: http://llvm-reviews.chandlerc.com/D1122

llvm-svn: 186161

11 years agoTypeHierarchyNavigator was removed in r186130
Ed Maste [Fri, 12 Jul 2013 13:41:18 +0000 (13:41 +0000)]
TypeHierarchyNavigator was removed in r186130

llvm-svn: 186160

11 years agoDon't reject an empty archive.
Rafael Espindola [Fri, 12 Jul 2013 13:32:28 +0000 (13:32 +0000)]
Don't reject an empty archive.

llvm-svn: 186159

11 years agoCompletely revert all mbstowcs-and-friends changes from r186109. They were unintentional
Alexey Samsonov [Fri, 12 Jul 2013 12:33:23 +0000 (12:33 +0000)]
Completely revert all mbstowcs-and-friends changes from r186109. They were unintentional

llvm-svn: 186158

11 years ago[lsan] Increase the hardcoded limit on number of leaks.
Sergey Matveev [Fri, 12 Jul 2013 12:31:22 +0000 (12:31 +0000)]
[lsan] Increase the hardcoded limit on number of leaks.

We never expected to see so many leaks in the real world. Until we did.

llvm-svn: 186157

11 years agoMark MDNode::getOperand as readonly.
Benjamin Kramer [Fri, 12 Jul 2013 12:05:13 +0000 (12:05 +0000)]
Mark MDNode::getOperand as readonly.

We can't inline it but we can still CSE calls to it.

llvm-svn: 186156

11 years ago[Sanitizer] Revert some parts of r186109 related to mbstowcs-and-friends interceptors
Alexey Samsonov [Fri, 12 Jul 2013 11:59:58 +0000 (11:59 +0000)]
[Sanitizer] Revert some parts of r186109 related to mbstowcs-and-friends interceptors

llvm-svn: 186155

11 years agoclang-format: Fix string literal breaking.
Daniel Jasper [Fri, 12 Jul 2013 11:37:05 +0000 (11:37 +0000)]
clang-format: Fix string literal breaking.

Before this patch, it did not cooperate with
Style::AlwaysBreakBeforeMultilineStrings. Thus, it would turn

  aaaaaaaaaaaa(aaaaaaaaaaaaa, "aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa");

into:

  aaaaaaaaaaaa(aaaaaaaaaaaaa, "aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa "
                              "aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa");

and only a second format step would lead to the desired (with that
option):

  aaaaaaaaaaaa(aaaaaaaaaaaaa,
               "aaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa "
               "aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa");

This could even lead to clang-format breaking the string at a different
character and thus leading to a completely different end result.

llvm-svn: 186154

11 years agoclang-format: Break before/between array subscript expressions.
Daniel Jasper [Fri, 12 Jul 2013 11:19:37 +0000 (11:19 +0000)]
clang-format: Break before/between array subscript expressions.

clang-format used to treat array subscript expressions much like
function call (just replacing () with []). However, this is not really
appropriate especially for expressions with multiple subscripts.

Although it might seem counter-intuitive, the most consistent solution
seems to be to always (if necessary) break before a square bracket,
never after it. Also, multiple subscripts of the same expression should
be aligned if they are on subsequent lines.

Before:
  aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaaaa][
      bbbbbbbbbbbbbbbbbbbbbbbbb] = c;
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa][
      bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = ccccccccccc;

After:
  aaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaaaa]
                           [bbbbbbbbbbbbbbbbbbbbbbbbb] = c;
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
      [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]
      [bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = ccccccccccc;

llvm-svn: 186153

11 years agoRevert "indvars: Improve LFTR by eliminating truncation when comparing
Chandler Carruth [Fri, 12 Jul 2013 11:18:55 +0000 (11:18 +0000)]
Revert "indvars: Improve LFTR by eliminating truncation when comparing
against a constant."

This reverts commit r186107. It didn't handle wrapping arithmetic in the
loop correctly and thus caused the following C program to count from
0 to UINT64_MAX instead of from 0 to 255 as intended:

  #include <stdio.h>
  int main() {
    unsigned char first = 0, last = 255;
    do { printf("%d\n", first); } while (first++ != last);
  }

Full test case and instructions to reproduce with just the -indvars pass
sent to the original review thread rather than to r186107's commit.

llvm-svn: 186152

11 years agoAdd support for Mips break and syscall insructions. The corresponding test cases...
Vladimir Medic [Fri, 12 Jul 2013 09:25:35 +0000 (09:25 +0000)]
Add support for Mips break and syscall insructions. The corresponding test cases are added.

llvm-svn: 186151

11 years ago[SystemZ] Add test missing from r186148
Richard Sandiford [Fri, 12 Jul 2013 09:20:14 +0000 (09:20 +0000)]
[SystemZ] Add test missing from r186148

Sigh, twice in two days sorry.  One day I'll remember...

llvm-svn: 186150

11 years ago[SystemZ] Optimize sign-extends of vector setccs
Richard Sandiford [Fri, 12 Jul 2013 09:17:10 +0000 (09:17 +0000)]
[SystemZ] Optimize sign-extends of vector setccs

Normal (sext (setcc ...)) sequences are optimised into
(select_cc ..., -1, 0) by DAGCombiner::visitSIGN_EXTEND.
However, this is deliberately not done for vectors, and after
vector type legalization we have (sext_inreg (setcc ...)) instead.

I wondered about trying to extend DAGCombiner to handle this case too,
but it seemed to be a loss on some other targets I tried, even those for
which SETCC isn't "legal" and SELECT_CC is.

llvm-svn: 186149

11 years ago[SystemZ] Fix parsing of inline asm registers
Richard Sandiford [Fri, 12 Jul 2013 09:08:12 +0000 (09:08 +0000)]
[SystemZ] Fix parsing of inline asm registers

GPR and FPR constraints like "{r2}" and "{f2}" weren't handled correctly
because the name-to-regno mapping depends on the value type and
(because of that) the internal names in RegStrings are not the
same as the AsmName.

CC constraints like "{cc}" didn't work either because there was no
associated register class.

llvm-svn: 186148

11 years ago[SystemZ] Improve spilling of LGDR and LDGR
Richard Sandiford [Fri, 12 Jul 2013 08:37:17 +0000 (08:37 +0000)]
[SystemZ] Improve spilling of LGDR and LDGR

If the source of these instructions is spilled we should load the destination.
If the destination is spilled we should store the source.

llvm-svn: 186147

11 years agoStylistic change.
Shuxin Yang [Fri, 12 Jul 2013 07:25:38 +0000 (07:25 +0000)]
Stylistic change.

Thank Nick for figuring out these problems.

llvm-svn: 186146

11 years agoSLPVectorizer: Sink and enable CSE for ExtractElements.
Nadav Rotem [Fri, 12 Jul 2013 06:09:24 +0000 (06:09 +0000)]
SLPVectorizer: Sink and enable CSE for ExtractElements.

llvm-svn: 186145

11 years agoTarget/X86: Add explicit Win64 and System V/x86-64 calling conventions.
Charles Davis [Fri, 12 Jul 2013 06:02:35 +0000 (06:02 +0000)]
Target/X86: Add explicit Win64 and System V/x86-64 calling conventions.

Summary:
This patch adds explicit calling convention types for the Win64 and
System V/x86-64 ABIs. This allows code to override the default, and use
the Win64 convention on a target that wants to use SysV (and
vice-versa). This is needed to implement the `ms_abi` and `sysv_abi` GNU
attributes.

Reviewers:

CC:

llvm-svn: 186144

11 years agollvm/test/Object/archive-toc.test: Use env(1) to satisfy win32 hosts.
NAKAMURA Takumi [Fri, 12 Jul 2013 02:34:45 +0000 (02:34 +0000)]
llvm/test/Object/archive-toc.test: Use env(1) to satisfy win32 hosts.

llvm-svn: 186143

11 years agoWindows/TimeValue.inc: Mute prefixed '0' on %d to emulate %e.
NAKAMURA Takumi [Fri, 12 Jul 2013 02:13:03 +0000 (02:13 +0000)]
Windows/TimeValue.inc: Mute prefixed '0' on %d to emulate %e.

It fixes compatibility in llvm/test/Object/archive-toc.test.

llvm-svn: 186142

11 years agoPEI: refactor replaceFrameIndices(MF) to call replaceFrameIndices(BB).
Manman Ren [Fri, 12 Jul 2013 00:37:01 +0000 (00:37 +0000)]
PEI: refactor replaceFrameIndices(MF) to call replaceFrameIndices(BB).

replaceFrameIndices(MF) will iterate over the BBs and call
replaceFrameIndices(BB). No functionality change.

llvm-svn: 186141

11 years ago[analyzer] Add support for __builtin_addressof.
Jordan Rose [Fri, 12 Jul 2013 00:26:14 +0000 (00:26 +0000)]
[analyzer] Add support for __builtin_addressof.

...so we don't regress on std::addressof.

llvm-svn: 186140

11 years agoSLPVectorize: Replace the code that checks for vectorization candidates in successor...
Nadav Rotem [Fri, 12 Jul 2013 00:04:18 +0000 (00:04 +0000)]
SLPVectorize: Replace the code that checks for vectorization candidates in successor blocks with code that scans PHINodes.
Before we could vectorize PHINodes scanning successors was a good way of finding candidates. Now we can vectorize the phinodes which is simpler.

llvm-svn: 186139

11 years ago[scan-build] Pass through all -f and -O flags, along with -Wwrite-strings.
Jordan Rose [Thu, 11 Jul 2013 23:56:12 +0000 (23:56 +0000)]
[scan-build] Pass through all -f and -O flags, along with -Wwrite-strings.

These flags control language options and user-visible macros, so it's
important to preserve them when analyzing. Rather than try to keep up
with all the -f flags, we'll pass them all through and then ban the ones
we don't want (like -fsyntax-only).

-Wwrite-strings is really an f-flag in disguise: it implies -fconst-strings.

Patch by Keaton Mowry, modified by me.

llvm-svn: 186138

11 years agoFix crash on zero-argument assignment operator.
Eli Friedman [Thu, 11 Jul 2013 23:55:07 +0000 (23:55 +0000)]
Fix crash on zero-argument assignment operator.

Make sure we don't crash when checking whether an assignment operator
without any arguments is a special member.  <rdar://problem/14397774>.

llvm-svn: 186137

11 years agoPort make_[un]signed tests to platforms where sizeof(wchar_t) == 2.
Howard Hinnant [Thu, 11 Jul 2013 23:51:05 +0000 (23:51 +0000)]
Port make_[un]signed tests to platforms where sizeof(wchar_t) == 2.

llvm-svn: 186136

11 years agoAdd the ability to use guarded malloc when running clang's lit tests.
David Dean [Thu, 11 Jul 2013 23:37:50 +0000 (23:37 +0000)]
Add the ability to use guarded malloc when running clang's lit tests.

llvm-svn: 186135

11 years agoAdd the ability to use guarded malloc when running llvm lit tests.
David Dean [Thu, 11 Jul 2013 23:36:57 +0000 (23:36 +0000)]
Add the ability to use guarded malloc when running llvm lit tests.

llvm-svn: 186134

11 years agoUnblock buildbot.
Greg Clayton [Thu, 11 Jul 2013 23:36:31 +0000 (23:36 +0000)]
Unblock buildbot.

llvm-svn: 186133

11 years agoGet debugserver to call task_set_state to prime the control registers so that watchpoints
Jim Ingham [Thu, 11 Jul 2013 23:20:35 +0000 (23:20 +0000)]
Get debugserver to call task_set_state to prime the control registers so that watchpoints
take for threads created while the program is running.  Remove the testcase skips from TestConcurrentEvents.py,
since they all pass now, and fix TestWatchpointMultipleThreads.py - which should have caught this problem -
so it doesn't artificially break on new thread creation before the watchpoint triggers.

llvm.org/pr16566
<rdar://problem/14383244>

llvm-svn: 186132

11 years agollvm-ar: Clean up memory management with OwningPtr.
Benjamin Kramer [Thu, 11 Jul 2013 23:15:05 +0000 (23:15 +0000)]
llvm-ar: Clean up memory management with OwningPtr.

llvm-svn: 186131

11 years agoHuge change to clean up types.
Greg Clayton [Thu, 11 Jul 2013 22:46:58 +0000 (22:46 +0000)]
Huge change to clean up types.

A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error.

This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness.

llvm-svn: 186130

11 years agoTentatively re-enabling TestBreakAfterJoin on Linux
Daniel Malea [Thu, 11 Jul 2013 22:40:52 +0000 (22:40 +0000)]
Tentatively re-enabling TestBreakAfterJoin on Linux
- Unable to reproduce llvm.org/pr16170 locally

llvm-svn: 186129

11 years agoProvide a fixit hint for changing '->' to '.' if there is no operator->
Kaelyn Uhrain [Thu, 11 Jul 2013 22:38:30 +0000 (22:38 +0000)]
Provide a fixit hint for changing '->' to '.' if there is no operator->
defined for a class.

llvm-svn: 186128

11 years agoAdded a memory.py module that contains a 'memfind' command which allows you to search...
Greg Clayton [Thu, 11 Jul 2013 22:38:00 +0000 (22:38 +0000)]
Added a memory.py module that contains a 'memfind' command which allows you to search memory for a byte pattern.

llvm-svn: 186127

11 years agoEnable Mac OS X tests disabled due to llvm.org/pr16567
Daniel Malea [Thu, 11 Jul 2013 22:28:17 +0000 (22:28 +0000)]
Enable Mac OS X tests disabled due to llvm.org/pr16567
- thread count remains correct now that we use pthread_kill() instead of kill() to deliver signals

llvm-svn: 186126

11 years agoMake CXXBaseSpecifier::getType return unqual type.
Eli Friedman [Thu, 11 Jul 2013 22:22:22 +0000 (22:22 +0000)]
Make CXXBaseSpecifier::getType return unqual type.

Various pieces of code, like base initialization in Sema and RTTI IRGen,
don't properly ignore qualifiers on base classes.  Instead of auditing the
whole codebase, just strip them off in the getter.  (The type as written is
still available in the TypeSourceInfo for code that cares.)

Fixes PR16596.

llvm-svn: 186125

11 years agoImprove TestConcurrentEvents.py
Daniel Malea [Thu, 11 Jul 2013 22:14:47 +0000 (22:14 +0000)]
Improve TestConcurrentEvents.py
- code cleanup, improved reporting when failures take place
- ensure known thread is interrupted by using pthread_kill() instead of kill() in the signal worker thread
- above should avoid llvm.org/pr16567 on Mac OS X (though kill() could still cause threads to pop out of existance temporarily)
- added an additional check that all threads have exited after worker threads are all join()ed
- logged llvm.org/pr16603 for the new Linux bug discovered

llvm-svn: 186124

11 years agoSync SmallBitVector with BitVector. Add unit tests for the missing methods.
Benjamin Kramer [Thu, 11 Jul 2013 21:59:16 +0000 (21:59 +0000)]
Sync SmallBitVector with BitVector. Add unit tests for the missing methods.

llvm-svn: 186123

11 years agoTweaks to the Python reference and example command to use the preferred print style...
Enrico Granata [Thu, 11 Jul 2013 21:49:38 +0000 (21:49 +0000)]
Tweaks to the Python reference and example command to use the preferred print style and the (finally available :-) SetError API

llvm-svn: 186122

11 years agoFixed up comments in TargetLowering.h to conform to the LLVM Style Guide.
Michael Gottesman [Thu, 11 Jul 2013 21:38:33 +0000 (21:38 +0000)]
Fixed up comments in TargetLowering.h to conform to the LLVM Style Guide.

llvm-svn: 186121

11 years agoclang-format: Fix bug concerning the alignment of "}".
Daniel Jasper [Thu, 11 Jul 2013 21:27:40 +0000 (21:27 +0000)]
clang-format: Fix bug concerning the alignment of "}".

Before:
    int i;  // indented 2 space more than clang-format would use.
    SomeReturnType  // clang-format invoked on this line.
    SomeFunctionMakingLBraceEndInColumn80() {
  }  // This is the indent clang-format would prefer.

After:
    int i;  // indented 2 space more than clang-format would use.
    SomeReturnType  // clang-format invoked on this line.
    SomeFunctionMakingLBraceEndInColumn80() {
    }

llvm-svn: 186120

11 years agoIn response to dblaikie's comment on r186035, replacing the
Adrian Prantl [Thu, 11 Jul 2013 21:16:14 +0000 (21:16 +0000)]
In response to dblaikie's comment on r186035, replacing the
(reduced LLVM IR) + (full source in comment)
with the
(full LLVM IR) + (reduced src in comment)

llvm-svn: 186119

11 years agoAdd tests for the before and after modifiers.
Rafael Espindola [Thu, 11 Jul 2013 21:11:55 +0000 (21:11 +0000)]
Add tests for the before and after modifiers.

llvm-svn: 186118

11 years agoclang-format: Break before trailing annotations.
Daniel Jasper [Thu, 11 Jul 2013 21:02:56 +0000 (21:02 +0000)]
clang-format: Break before trailing annotations.

(if they are not function-like).

Before:
  SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      OVERRIDE;

After:
  SomeFunction(aaaaaaaaaaaaaaaaaaaaaa,
               aaaaaaaaaaaaaaaaaaaaaaaa) OVERRIDE;

llvm-svn: 186117

11 years agoRemove an argument that we dont use anymore.
Nadav Rotem [Thu, 11 Jul 2013 20:56:13 +0000 (20:56 +0000)]
Remove an argument that we dont use anymore.

llvm-svn: 186116

11 years agoclang-format: Avoid line breaks before the first <<.
Daniel Jasper [Thu, 11 Jul 2013 20:41:21 +0000 (20:41 +0000)]
clang-format: Avoid line breaks before the first <<.

This puts a slight penalty on the linebreak before the first "<<", so
that clang-format generally tries to keep things on the first line.

User feedback has shown that this is generally desirable.

Before:
  llvm::outs()
      << "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =" << aaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
  llvm::outs() << "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ="
               << aaaaaaaaaaaaaaaaaaaaaaaaaaa;

llvm-svn: 186115

11 years agoAdds methods to ObjectFileELF to access data in ELF segments
Ashok Thirumurthi [Thu, 11 Jul 2013 20:39:00 +0000 (20:39 +0000)]
Adds methods to ObjectFileELF to access data in ELF segments
in preparation to add support for ELF core files.

Patch by Samuel Jacob!

llvm-svn: 186114

11 years agoUse %llu to print a 64 bit number. Should fix the ARM bots.
Rafael Espindola [Thu, 11 Jul 2013 20:01:30 +0000 (20:01 +0000)]
Use %llu to print a 64 bit number. Should fix the ARM bots.

llvm-svn: 186113

11 years agoFix unhandled SIGTRAP signal on Linux causing assertion.
Matt Kopec [Thu, 11 Jul 2013 20:01:22 +0000 (20:01 +0000)]
Fix unhandled SIGTRAP signal on Linux causing assertion.

llvm-svn: 186112

11 years agoRestore warning to its original text when
Fariborz Jahanian [Thu, 11 Jul 2013 19:13:34 +0000 (19:13 +0000)]
Restore warning to its original text when
certain familiy of methods have the wrong type.
// rdar://14408244

llvm-svn: 186111

11 years agoAdd a test for llvm-ar's m operation.
Rafael Espindola [Thu, 11 Jul 2013 19:09:04 +0000 (19:09 +0000)]
Add a test for llvm-ar's m operation.

llvm-svn: 186110

11 years agoFix a veritable conucopia of bugs in the readdir_r interceptors.
Chandler Carruth [Thu, 11 Jul 2013 18:51:40 +0000 (18:51 +0000)]
Fix a veritable conucopia of bugs in the readdir_r interceptors.

First, the reason I came here: I forgot to look at readdir64_r which had
the exact same bug as readdir_r. However, upon applying the same
quick-fix and testing it I discovered that it still didn't work at all.
As a consequence, I spent some time studying the code and thinking about
it and fixed several other problems.

Second, the code was checking for a null entry and result pointer, but
there is no indication that null pointers are viable here. Certainly,
the spec makes it extremely clear that there is no non-error case where
the implementation of readdir_r fails to dereference the 'result'
pointer and store NULL to it. Thus, our checking for a non-null 'result'
pointer before reflecting that write in the instrumentation was
trivially dead. Remove it.

Third, the interceptor was marking the write to the actual dirent struct
by looking at the entry pointer, but nothing in the spec requires that
the dirent struct written is actually written into the entry structure
provided. A threadlocal buffer would be just as conforming, and the spec
goes out of its way to say the pointer to the *actual* result dirent
struct is stored into *result, so *that* is where the interceptor should
reflect a write occuring. This also obviates the need to even consider
whether the 'entry' parameter is null.

Fourth, I got to the bottom of why nothing at all worked in readdir64_r
-- the interceptor structure for dirent64 was completely wrong in that
it was the same as dirent. I fixed this struct to be correct (64-bit
inode and 64-bit offset! just a 64-bit offset isn't enough!) and added
several missing tests for the size and layout of this struct.

llvm-svn: 186109

11 years agoPPC: Add some missing V_SET0 patterns
Hal Finkel [Thu, 11 Jul 2013 17:43:32 +0000 (17:43 +0000)]
PPC: Add some missing V_SET0 patterns

We had patterns to match v4i32 immAllZerosV -> V_SET0, but not patterns for
v8i16 (which occurs in the test case) or v16i8. The same was true for
V_SETALLONES (so I added the associated patterns for those as well).

Another bug found by llvm-stress.

llvm-svn: 186108

11 years agoindvars: Improve LFTR by eliminating truncation when comparing against a constant.
Andrew Trick [Thu, 11 Jul 2013 17:08:59 +0000 (17:08 +0000)]
indvars: Improve LFTR by eliminating truncation when comparing against a constant.

Patch by Michele Scandale!

Adds a special handling of the case where, during the loop exit
condition rewriting, the exit value is a constant of bitwidth lower
than the type of the induction variable: instead of introducing a
trunc operation in order to match correctly the operand types, it
allows to convert the constant value to an equivalent constant,
depending on the initial value of the induction variable and the trip
count, in order have an equivalent comparison between the induction
variable and the new constant.

llvm-svn: 186107

11 years agoSimplify GetBuiltinNames by hoising the NoBuiltins argument out of it.
Eli Bendersky [Thu, 11 Jul 2013 16:53:04 +0000 (16:53 +0000)]
Simplify GetBuiltinNames by hoising the NoBuiltins argument out of it.

llvm-svn: 186106

11 years agoObjectiveC arc[qoi]: When due to change of certain methods'
Fariborz Jahanian [Thu, 11 Jul 2013 16:48:06 +0000 (16:48 +0000)]
ObjectiveC arc[qoi]: When due to change of certain methods'
result type, a diagnostic being issued, issue a 'note'
mentioning reason behind the unexpected warning.
// rdar://14121570.

llvm-svn: 186105

11 years agoFix "source list -n printf" on Linux (printf is symbol alias for __printf)
Michael Sartain [Thu, 11 Jul 2013 16:40:56 +0000 (16:40 +0000)]
Fix "source list -n printf" on Linux (printf is symbol alias for __printf)

Differential Revision: http://llvm-reviews.chandlerc.com/D1109

llvm-svn: 186104