platform/upstream/llvm.git
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

11 years ago[sanitizer] Remove optional arguments from clone() invocation.
Sergey Matveev [Thu, 11 Jul 2013 16:37:44 +0000 (16:37 +0000)]
[sanitizer] Remove optional arguments from clone() invocation.

Unbreaks compilation on older systems. Patch by Andy Jost.

llvm-svn: 186103

11 years agoPPCDAGToDAGISel::isRunOfOnes should return false on zero
Hal Finkel [Thu, 11 Jul 2013 16:31:51 +0000 (16:31 +0000)]
PPCDAGToDAGISel::isRunOfOnes should return false on zero

This fixes a bug (found by csmith) at -O0 where we attempt to create a RLWIMI
with an out-of-range operand. Most uses of the isRunOfOnes function are guarded
by a condition that the value is not zero. This was not true in two places, and
in both places a zero input would result in an out-of-rage MB value (= 32).

To fix this, isRunOfOnes returns false on a zero input (and I've remove one
now-redundant guard).

llvm-svn: 186101

11 years agoUse SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.
Craig Topper [Thu, 11 Jul 2013 16:22:38 +0000 (16:22 +0000)]
Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.

llvm-svn: 186098

11 years agoAdd back code for supporting old mingw versions. Should bring the bots back.
Rafael Espindola [Thu, 11 Jul 2013 16:11:21 +0000 (16:11 +0000)]
Add back code for supporting old mingw versions. Should bring the bots back.

llvm-svn: 186096

11 years agoDon't use a potentially expensive shift if all we want is one set bit.
Benjamin Kramer [Thu, 11 Jul 2013 16:05:50 +0000 (16:05 +0000)]
Don't use a potentially expensive shift if all we want is one set bit.

No functionality change.

llvm-svn: 186095

11 years agoInsertBefore is the same as AddBefore. Delete it.
Rafael Espindola [Thu, 11 Jul 2013 15:54:53 +0000 (15:54 +0000)]
InsertBefore is the same as AddBefore. Delete it.

llvm-svn: 186094

11 years agocpp11-migrate: Add missing file headers in unit tests
Edwin Vane [Thu, 11 Jul 2013 15:54:06 +0000 (15:54 +0000)]
cpp11-migrate: Add missing file headers in unit tests

Differential: http://llvm-reviews.chandlerc.com/D1124
Author: Guillaume Papin <guillaume.papin@epitech.eu>
llvm-svn: 186093

11 years agoLooks like some versions of mingw don't have errno_t. Use int.
Rafael Espindola [Thu, 11 Jul 2013 15:47:04 +0000 (15:47 +0000)]
Looks like some versions of mingw don't have errno_t. Use int.

llvm-svn: 186092

11 years agoUse move semantics if possible to construct ConstantRanges.
Benjamin Kramer [Thu, 11 Jul 2013 15:37:27 +0000 (15:37 +0000)]
Use move semantics if possible to construct ConstantRanges.

Arithmetic on ConstantRanges creates a lot of large temporary APInts that
benefit from move semantics.

llvm-svn: 186091

11 years agoFix a FIXME about the format and add a test.
Rafael Espindola [Thu, 11 Jul 2013 15:35:23 +0000 (15:35 +0000)]
Fix a FIXME about the format and add a test.

While at it, use strftime on Unix too and use the thread safe versions
of localtime.

llvm-svn: 186090

11 years agoBill Fisher: This patch fixes a less likely case where '\b' can back up into invalid...
Howard Hinnant [Thu, 11 Jul 2013 15:32:55 +0000 (15:32 +0000)]
Bill Fisher: This patch fixes a less likely case where '\b' can back up into invalid memory, when driven by a regex_iterator (for case 1, see r185273 or llvm.org/bugs/show_bug.cgi?id=16240)

The attached test program also supplies a test for the case 1 fix in r185273.

llvm-svn: 186089

11 years agoLoopVectorize: Vectorize all accesses in address space zero with unit stride
Arnold Schwaighofer [Thu, 11 Jul 2013 15:21:55 +0000 (15:21 +0000)]
LoopVectorize: Vectorize all accesses in address space zero with unit stride

We can vectorize them because in the case where we wrap in the address space the
unvectorized code would have had to access a pointer value of zero which is
undefined behavior in address space zero according to the LLVM IR semantics.
(Thank you Duncan, for pointing this out to me).

Fixes PR16592.

llvm-svn: 186088

11 years agoImprove detection of trailing return types.
Daniel Jasper [Thu, 11 Jul 2013 14:33:06 +0000 (14:33 +0000)]
Improve detection of trailing return types.

Trailing return types can only occur in declaration contexts.

Before:
  void f() { auto a = b -> c(); }

After:
  void f() { auto a = b->c(); }

llvm-svn: 186087

11 years agoAdd stub GetThreadName for FreeBSD, missed in r186033.
Ed Maste [Thu, 11 Jul 2013 14:12:16 +0000 (14:12 +0000)]
Add stub GetThreadName for FreeBSD, missed in r186033.

On FreeBSD inferior thread names are available through ptrace, so we won't
use Host::GetThreadName anyway.

llvm-svn: 186086

11 years agoFix indentation problem for comments in call chains
Daniel Jasper [Thu, 11 Jul 2013 13:48:16 +0000 (13:48 +0000)]
Fix indentation problem for comments in call chains

Before:
SomeObject
    // Calling someFunction on SomeObject
        .someFunction();

After:
SomeObject
    // Calling someFunction on SomeObject
    .someFunction();

llvm-svn: 186085

11 years agoMerge these tests.
Rafael Espindola [Thu, 11 Jul 2013 13:44:10 +0000 (13:44 +0000)]
Merge these tests.

llvm-svn: 186084

11 years agoUse a more unique name to avoid conflicting with directory.ll tests when running
Rafael Espindola [Thu, 11 Jul 2013 13:31:38 +0000 (13:31 +0000)]
Use a more unique name to avoid conflicting with directory.ll tests when running
in parallel.

llvm-svn: 186083

11 years agoAdd a test for llvm-ar's 'd' operation.
Rafael Espindola [Thu, 11 Jul 2013 13:24:27 +0000 (13:24 +0000)]
Add a test for llvm-ar's 'd' operation.

llvm-svn: 186082

11 years agoAdd tests for the 'x' operation.
Rafael Espindola [Thu, 11 Jul 2013 13:13:09 +0000 (13:13 +0000)]
Add tests for the 'x' operation.

llvm-svn: 186081

11 years agoRemove the 'N' modifier from llvm-ar.
Rafael Espindola [Thu, 11 Jul 2013 13:03:27 +0000 (13:03 +0000)]
Remove the 'N' modifier from llvm-ar.

* It is not present on OS X.
* It is untested.
* It is not needed for using ar in a build system.

llvm-svn: 186080

11 years agoDelete dead code.
Rafael Espindola [Thu, 11 Jul 2013 12:54:11 +0000 (12:54 +0000)]
Delete dead code.

llvm-svn: 186079

11 years agoRemove support for truncating names in archives.
Rafael Espindola [Thu, 11 Jul 2013 12:38:02 +0000 (12:38 +0000)]
Remove support for truncating names in archives.

* All systems we support have some form of long name support.
* The options has different names and semantics in different implementations
  ('f' on gnu, 'T' on OS X), which makes it unlikely it is normally used on
  build systems.
* It was completely untested.

llvm-svn: 186078

11 years agoKeep trailing annotations close to their argument.
Daniel Jasper [Thu, 11 Jul 2013 12:34:23 +0000 (12:34 +0000)]
Keep trailing annotations close to their argument.

Before:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa GUARDED_BY(
    aaaaaaaaaaaa);

After:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    GUARDED_BY(aaaaaaaaaaaa);

llvm-svn: 186077

11 years agoSync llvm-ar's help string with the options it supports.
Rafael Espindola [Thu, 11 Jul 2013 12:28:36 +0000 (12:28 +0000)]
Sync llvm-ar's help string with the options it supports.

llvm-svn: 186076

11 years agoReduce the number of indirections in the attributes implementation.
Benjamin Kramer [Thu, 11 Jul 2013 12:13:16 +0000 (12:13 +0000)]
Reduce the number of indirections in the attributes implementation.

- Coallocate entires for AttributeSetImpls and Nodes after the class itself.
- Remove mutable iterators from immutable classes.
- Remove unused context field from AttributeImpl.
- Derive Enum/Align/String attribute implementations from AttributeImpl instead
  of having a whole new inheritance tree for them.
- Derive AlignAttributeImpl from EnumAttributeImpl.

llvm-svn: 186075

11 years ago[SystemZ] Add testcase missing from r186073
Richard Sandiford [Thu, 11 Jul 2013 09:10:38 +0000 (09:10 +0000)]
[SystemZ] Add testcase missing from r186073

llvm-svn: 186074

11 years ago[SystemZ] Use zeroing form of RISBG for shift-and-AND sequences
Richard Sandiford [Thu, 11 Jul 2013 09:10:09 +0000 (09:10 +0000)]
[SystemZ] Use zeroing form of RISBG for shift-and-AND sequences

Extend r186072 to handle shifts and ANDs.

llvm-svn: 186073

11 years ago[SystemZ] Use zeroing form of RISBG for some AND sequences
Richard Sandiford [Thu, 11 Jul 2013 08:59:12 +0000 (08:59 +0000)]
[SystemZ] Use zeroing form of RISBG for some AND sequences

RISBG can handle some ANDs for which no AND IMMEDIATE exists.
It also acts as a three-operand AND for some cases where an
AND IMMEDIATE could be used instead.

It might be worth adding a pass to replace RISBG with AND IMMEDIATE
in cases where the register operands end up being the same and where
AND IMMEDIATE is smaller.

llvm-svn: 186072

11 years ago[PECOFF] Support linking against DLL.
Rui Ueyama [Thu, 11 Jul 2013 08:46:21 +0000 (08:46 +0000)]
[PECOFF] Support linking against DLL.

This patch adds a new pass, IdataPass, to transform shared atom references
to real references and to construct the .idata section data. With this patch
lld can produce a working Hello World program by linking it against
kernel32.dll and user32.dll.

Reviewers: Bigcheese

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1096

llvm-svn: 186071

11 years ago[SystemZ] Allow 8-bit operands to RISBG
Richard Sandiford [Thu, 11 Jul 2013 08:37:13 +0000 (08:37 +0000)]
[SystemZ] Allow 8-bit operands to RISBG

RISBG has three 8-bit operands (I3, I4 and I5).  I'd originally
restricted all three to 6 bits, since that's the only range we intended
to use at the time.  However, the top bit of I4 acts as a "zero" flag for
RISBG, while the top bit of I3 acts as a "test" flag for RNSBG & co.
This patch therefore allows them to have the full 8-bit range.
I've left the fifth operand as a 6-bit value for now since the
upper 2 bits have no defined meaning.

llvm-svn: 186070

11 years agoTryToSimplifyUncondBranchFromEmptyBlock was checking that any common
Duncan Sands [Thu, 11 Jul 2013 08:28:20 +0000 (08:28 +0000)]
TryToSimplifyUncondBranchFromEmptyBlock was checking that any common
predecessors of the two blocks it is attempting to merge supply the
same incoming values to any phi in the successor block.  This change
allows merging in the case where there is one or more incoming values
that are undef.  The undef values are rewritten to match the non-undef
value that flows from the other edge.  Patch by Mark Lacey.

llvm-svn: 186069

11 years agoInitialize AsmPrinter::MF in the constructor
Hal Finkel [Thu, 11 Jul 2013 06:41:14 +0000 (06:41 +0000)]
Initialize AsmPrinter::MF in the constructor

MF is normally initialized in AsmPrinter::SetupMachineFunction, but if the file
contains only globals (no functions), then we need this to be initialized
because, when encountering an error, lowerConstant() references it.

This should fix the non-deterministic failures of
test/CodeGen/X86/nonconst-static-iv.ll, etc.

llvm-svn: 186068

11 years agoRegScavenger should not exclude undef uses
Hal Finkel [Thu, 11 Jul 2013 05:55:57 +0000 (05:55 +0000)]
RegScavenger should not exclude undef uses

When computing currently-live registers, the register scavenger excludes undef
uses. As a result, undef uses are ignored when computing the restore points of
registers spilled into the emergency slots. While the register scavenger
normally excludes from consideration, when scavenging, registers used by the
current instruction, we need to not exclude undef uses. Otherwise, we might end
up requiring more emergency spill slots than we have (in the case where the
undef use *is* the currently-spilled register).

Another bug found by llvm-stress.

llvm-svn: 186067

11 years ago[PECOFF][Writer] Fixed a bug that an empty section is emit to the section header.
Rui Ueyama [Thu, 11 Jul 2013 05:43:38 +0000 (05:43 +0000)]
[PECOFF][Writer] Fixed a bug that an empty section is emit to the section header.

llvm-svn: 186066

11 years agoFix indentation. No functional change.
Craig Topper [Thu, 11 Jul 2013 05:39:44 +0000 (05:39 +0000)]
Fix indentation. No functional change.

llvm-svn: 186065

11 years agoFix a warning.
Nadav Rotem [Thu, 11 Jul 2013 05:39:02 +0000 (05:39 +0000)]
Fix a warning.

llvm-svn: 186064

11 years agoConsolidate more lit tests.
Nadav Rotem [Thu, 11 Jul 2013 05:15:11 +0000 (05:15 +0000)]
Consolidate more lit tests.

llvm-svn: 186063

11 years agoConsolidate some of the lit tests.
Nadav Rotem [Thu, 11 Jul 2013 05:11:33 +0000 (05:11 +0000)]
Consolidate some of the lit tests.

llvm-svn: 186062

11 years agoPR5066: If a declarator cannot have an identifier, and cannot possibly be
Richard Smith [Thu, 11 Jul 2013 05:10:21 +0000 (05:10 +0000)]
PR5066: If a declarator cannot have an identifier, and cannot possibly be
followed by an identifier, then diagnose an identifier as being a bogus part of
the declarator instead of tripping over it. Improves diagnostics for cases like

  std::vector<const int *p> my_vec;

llvm-svn: 186061

11 years agoConsolidate some of the lit tests.
Nadav Rotem [Thu, 11 Jul 2013 05:01:50 +0000 (05:01 +0000)]
Consolidate some of the lit tests.

llvm-svn: 186060

11 years agoDocumentation fixes - the rest of DeclCXX.h:
James Dennett [Thu, 11 Jul 2013 05:01:16 +0000 (05:01 +0000)]
Documentation fixes - the rest of DeclCXX.h:
* More \brief additions/fixes;
* Fix some misleading comments about C++11's explicit conversion operators;
* Mark up some \code examples;
* Add \file documentation.

llvm-svn: 186059

11 years agoSLPVectorizer: refactor the code that places extracts. Place the code that decides...
Nadav Rotem [Thu, 11 Jul 2013 04:54:05 +0000 (04:54 +0000)]
SLPVectorizer: refactor the code that places extracts. Place the code that decides where to put extracts in the build-tree phase. This allows us to take the cost of the extracts into account.

llvm-svn: 186058

11 years agoTeach TailRecursionElimination to handle certain cases of nocapture escaping allocas.
Michael Gottesman [Thu, 11 Jul 2013 04:40:01 +0000 (04:40 +0000)]
Teach TailRecursionElimination to handle certain cases of nocapture escaping allocas.

Without the changes introduced into this patch, if TRE saw any allocas at all,
TRE would not perform TRE *or* mark callsites with the tail marker.

Because TRE runs after mem2reg, this inadequacy is not a death sentence. But
given a callsite A without escaping alloca argument, A may not be able to have
the tail marker placed on it due to a separate callsite B having a write-back
parameter passed in via an argument with the nocapture attribute.

Assume that B is the only other callsite besides A and B only has nocapture
escaping alloca arguments (*NOTE* B may have other arguments that are not passed
allocas). In this case not marking A with the tail marker is unnecessarily
conservative since:

  1. By assumption A has no escaping alloca arguments itself so it can not
     access the caller's stack via its arguments.

  2. Since all of B's escaping alloca arguments are passed as parameters with
     the nocapture attribute, we know that B does not stash said escaping
     allocas in a manner that outlives B itself and thus could be accessed
     indirectly by A.

With the changes introduced by this patch:

  1. If we see any escaping allocas passed as a capturing argument, we do
     nothing and bail early.

  2. If we do not see any escaping allocas passed as captured arguments but we
     do see escaping allocas passed as nocapture arguments:

       i. We do not perform TRE to avoid PR962 since the code generator produces
          significantly worse code for the dynamic allocas that would be created
          by the TRE algorithm.

       ii. If we do not return twice, mark call sites without escaping allocas
           with the tail marker. *NOTE* This excludes functions with escaping
           nocapture allocas.

  3. If we do not see any escaping allocas at all (whether captured or not):

       i. If we do not have usage of setjmp, mark all callsites with the tail
          marker.

       ii. If there are no dynamic/variable sized allocas in the function,
           attempt to perform TRE on all callsites in the function.

Based off of a patch by Nick Lewycky.

rdar://14324281.

llvm-svn: 186057

11 years agoDocumentation cleanup for DeclCXX.h:
James Dennett [Thu, 11 Jul 2013 03:51:36 +0000 (03:51 +0000)]
Documentation cleanup for DeclCXX.h:
* Fixing up \brief summaries (adding some, making some briefer);
* Standardizing on \commands, not @commands;
* Update C++0x references to C++11;
* Fix typos and Doxygen warnings.

llvm-svn: 186056

11 years agoclang/test/CodeGen/c11atomics.c: Fix testcase for -Asserts since r186054.
NAKAMURA Takumi [Thu, 11 Jul 2013 03:45:54 +0000 (03:45 +0000)]
clang/test/CodeGen/c11atomics.c: Fix testcase for -Asserts since r186054.

llvm-svn: 186055

11 years agoFix build.
Eli Friedman [Thu, 11 Jul 2013 02:28:36 +0000 (02:28 +0000)]
Fix build.

Sorry about that.

llvm-svn: 186054

11 years agoAdd a __builtin_addressof that performs the same functionality as the built-in
Richard Smith [Thu, 11 Jul 2013 02:27:57 +0000 (02:27 +0000)]
Add a __builtin_addressof that performs the same functionality as the built-in
& operator (ignoring any overloaded operator& for the type). The purpose of
this builtin is for use in std::addressof, to allow it to be made constexpr;
the existing implementation technique (reinterpret_cast to some reference type,
take address, reinterpert_cast back) does not permit this because
reinterpret_cast between reference types is not permitted in a constant
expression in C++11 onwards.

llvm-svn: 186053

11 years agoMake CheckAddressOfOperand a member of Sema so it can be reused by
Richard Smith [Thu, 11 Jul 2013 02:26:56 +0000 (02:26 +0000)]
Make CheckAddressOfOperand a member of Sema so it can be reused by
__builtin_addressof.

llvm-svn: 186052

11 years agoMove r186044 tests into CodeGen/X86
Hal Finkel [Thu, 11 Jul 2013 01:55:55 +0000 (01:55 +0000)]
Move r186044 tests into CodeGen/X86

I had thought that these tests could be target-neutral, but in practice this is
not the case (on some targets, like Hexagon and Darwin), they trigger an assert
(a different assert than the one that r186044 fixes).

llvm-svn: 186051

11 years agoAdd a -remote-file option to “target create” to specify the location of the executabl...
Jim Ingham [Thu, 11 Jul 2013 01:47:46 +0000 (01:47 +0000)]
Add a -remote-file option to “target create” to specify the location of the executable on a remote system (if debugging remotely using debugserver on the target system.)  This gets us closer to being able to set up a remote debugging session from the lldb command line.

llvm-svn: 186050

11 years agoSimplify atomic load/store IRGen.
Eli Friedman [Thu, 11 Jul 2013 01:32:21 +0000 (01:32 +0000)]
Simplify atomic load/store IRGen.

Also fixes a couple minor bugs along the way; see testcases.

llvm-svn: 186049

11 years agoFix some grammar errors.
Richard Smith [Thu, 11 Jul 2013 00:34:42 +0000 (00:34 +0000)]
Fix some grammar errors.

llvm-svn: 186048

11 years agoFix documentation:
Richard Smith [Thu, 11 Jul 2013 00:27:05 +0000 (00:27 +0000)]
Fix documentation:

  #if defined(__has_foo("X")) && __has_foo("X")

is not a correct way to portably use __has_foo, because it is expanded to

  #if 0 && 0("X")

... which is ill-formed.

Also add a missing ')'.

llvm-svn: 186047

11 years agoSet REQUIRES shell on the test cases for r186044
Hal Finkel [Wed, 10 Jul 2013 23:25:03 +0000 (23:25 +0000)]
Set REQUIRES shell on the test cases for r186044

Trying to fix the i686-mingw32 build.

llvm-svn: 186046

11 years agoXFAIL the test cases for r186044 on Hexagon
Hal Finkel [Wed, 10 Jul 2013 23:11:14 +0000 (23:11 +0000)]
XFAIL the test cases for r186044 on Hexagon

For some reason, the Hexagon backend does not reject these invalid static
initializer expressions, but instead crashes in AsmPrinter::EmitGlobalConstant.

llvm-svn: 186045

11 years agoDon't assert if we can't constant fold extract/insertvalue
Hal Finkel [Wed, 10 Jul 2013 22:51:01 +0000 (22:51 +0000)]
Don't assert if we can't constant fold extract/insertvalue

A non-constant-foldable static initializer expression containing insertvalue or
extractvalue had been causing an assert:

  Constants.cpp:1971: Assertion `FC && "ExtractValue constant expr couldn't be
                                 folded!"' failed.

Now we report a more-sensible "Unsupported expression in static initializer"
error instead.

Fixes PR15417.

llvm-svn: 186044

11 years agoRemove this test for now.
Rafael Espindola [Wed, 10 Jul 2013 22:15:29 +0000 (22:15 +0000)]
Remove this test for now.

It is not reliable to depend on the output of llvm_unreachable. The original
change will have proper tests when llvm-ar moves to lib/Object (soon).

llvm-svn: 186043

11 years agoCommandLine.rst: remove tiny bit of bad mark-up
Hans Wennborg [Wed, 10 Jul 2013 22:09:22 +0000 (22:09 +0000)]
CommandLine.rst: remove tiny bit of bad mark-up

llvm-svn: 186042

11 years agoFind the symbol table on archives created on OS X.
Rafael Espindola [Wed, 10 Jul 2013 22:07:59 +0000 (22:07 +0000)]
Find the symbol table on archives created on OS X.

llvm-svn: 186041

11 years agoIf we friend a declaration twice, that should not make it visible to name
Richard Smith [Wed, 10 Jul 2013 22:04:13 +0000 (22:04 +0000)]
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: 186040

11 years agoStop process monitor from ProcessPOSIX::Finalize
Andrew Kaylor [Wed, 10 Jul 2013 21:57:27 +0000 (21:57 +0000)]
Stop process monitor from ProcessPOSIX::Finalize

llvm-svn: 186039

11 years agoMove tests from test/Archive to test/Object.
Rafael Espindola [Wed, 10 Jul 2013 21:47:16 +0000 (21:47 +0000)]
Move tests from test/Archive to test/Object.

There is no lib/Archive anymore and some archive tests were in test/Archive and
others in test/Object. Since archive is just one of the formats supported by
lib/Object, test/Object is probably the best location.

llvm-svn: 186038

11 years agoObjC migrator: Improve on hueristics.
Fariborz Jahanian [Wed, 10 Jul 2013 21:30:22 +0000 (21:30 +0000)]
ObjC migrator: Improve on hueristics.
migrate to 'copy attribute if Object
class implements NSCopying otherwise
assume implied 'strong'. Remove
lifetime qualifier on property as it has
moved to property's attribute. Added TODO
comment for future work by poking into
setter implementation.

llvm-svn: 186037

11 years agoAdd a comment.
Adrian Prantl [Wed, 10 Jul 2013 21:08:02 +0000 (21:08 +0000)]
Add a comment.

llvm-svn: 186035

11 years agoPut ELF COMDAT relocations into the relevant COMDAT group.
Tim Northover [Wed, 10 Jul 2013 20:58:17 +0000 (20:58 +0000)]
Put ELF COMDAT relocations into the relevant COMDAT group.

Patch from Игорь Пашев  (I do hope we support utf-8 commit messages; I
also hope he'll forgive me for transliterating it as Igor Pashev in
case things go horribly wrong).

llvm-svn: 186034

11 years agoAdd support for listing inferior thread names on Linux.
Matt Kopec [Wed, 10 Jul 2013 20:53:11 +0000 (20:53 +0000)]
Add support for listing inferior thread names on Linux.

llvm-svn: 186033

11 years agoRemove trailing whitespac
Stephen Lin [Wed, 10 Jul 2013 20:47:39 +0000 (20:47 +0000)]
Remove trailing whitespac

llvm-svn: 186032

11 years agoAdd a testcase for r186014.
Adrian Prantl [Wed, 10 Jul 2013 20:43:29 +0000 (20:43 +0000)]
Add a testcase for r186014.

llvm-svn: 186031

11 years agoUse a LexicalScope here since it is one and it will encapsulate
Eric Christopher [Wed, 10 Jul 2013 20:14:36 +0000 (20:14 +0000)]
Use a LexicalScope here since it is one and it will encapsulate
the two sets of debug scope and cleanup scope.

llvm-svn: 186030

11 years agoDon't crash in 'llvm -s' when an archive has no symtab.
Rafael Espindola [Wed, 10 Jul 2013 20:14:22 +0000 (20:14 +0000)]
Don't crash in 'llvm -s' when an archive has no symtab.

llvm-svn: 186029

11 years ago[analyzer] Remove bogus assert: in C++11, 'new' can do list-initialization.
Jordan Rose [Wed, 10 Jul 2013 19:14:10 +0000 (19:14 +0000)]
[analyzer] Remove bogus assert: in C++11, 'new' can do list-initialization.

Previously, we asserted that whenever 'new' did not include a constructor
call, the type must be a non-record type. In C++11, however, uniform
initialization syntax (braces) allow 'new' to construct records with
list-initialization: "new Point{1, 2}".

Removing this assertion should be perfectly safe; the code here matches
what VisitDeclStmt does for regions allocated on the stack.

<rdar://problem/14403437>

llvm-svn: 186028

11 years agoFix %t typo in Ocaml bindings test.
Reid Kleckner [Wed, 10 Jul 2013 18:55:06 +0000 (18:55 +0000)]
Fix %t typo in Ocaml bindings test.

llvm-svn: 186027

11 years ago[objc-arc] Changed 'mode: c++' => 'C++' at Nick Lewycky's suggestion. Also removed...
Michael Gottesman [Wed, 10 Jul 2013 18:49:00 +0000 (18:49 +0000)]
[objc-arc] Changed 'mode: c++' => 'C++' at Nick Lewycky's suggestion. Also removed unnecessary mode: c++ lines from .cpp files.

llvm-svn: 186026

11 years agoChanged "mode: c++" => "C++" at the suggestion of Nick Lewycky.
Michael Gottesman [Wed, 10 Jul 2013 18:40:49 +0000 (18:40 +0000)]
Changed "mode: c++" => "C++" at the suggestion of Nick Lewycky.

llvm-svn: 186025

11 years agoAdd a hook RecursiveASTVisitor::TraverseLambdaBody, to enable visitors to
James Dennett [Wed, 10 Jul 2013 18:29:15 +0000 (18:29 +0000)]
Add a hook RecursiveASTVisitor::TraverseLambdaBody, to enable visitors to
use/maintain additional state from the LambdaExpr while visiting the body
of a LambdaExpr.

One use for this arises because Clang's AST currently holds lambda bodies
in a form prior to their adjustment to refer to captured copies of local
variables, and so some clients will need access to the lambda's closure
type in order to query how to map VarDecl*s to the FieldDecls of their
by-copy captures. This hook is sufficient for at least one such client;
to do this without such a hook would require the client to re-implement
the whole of TraverseLambdaExpr, which is non-trivial and would likely be
more brittle.

llvm-svn: 186024

11 years agoAdding a summary for ObjC blocks
Enrico Granata [Wed, 10 Jul 2013 18:25:45 +0000 (18:25 +0000)]
Adding a summary for ObjC blocks

llvm-svn: 186023

11 years agoImproved tests (and fixed a bug in the tests); thanks to Richard Smith for the suggestion
Marshall Clow [Wed, 10 Jul 2013 18:01:34 +0000 (18:01 +0000)]
Improved tests (and fixed a bug in the tests); thanks to Richard Smith for the suggestion

llvm-svn: 186022

11 years agoUpdate doxygen comment to match renamed parameters.
Benjamin Kramer [Wed, 10 Jul 2013 18:01:16 +0000 (18:01 +0000)]
Update doxygen comment to match renamed parameters.

Found by -Wdocumentation.

llvm-svn: 186021

11 years agoFixed an issue introduced with my last fix where the command and sequence ID extracti...
Greg Clayton [Wed, 10 Jul 2013 17:58:19 +0000 (17:58 +0000)]
Fixed an issue introduced with my last fix where the command and sequence ID extraction were moved causing them to be reversed.

llvm-svn: 186020

11 years agoOffer typo suggestions for 'using' declarations.
Kaelyn Uhrain [Wed, 10 Jul 2013 17:34:22 +0000 (17:34 +0000)]
Offer typo suggestions for 'using' declarations.

Patch courtesy of Luke Zarko <zarko@google.com>

llvm-svn: 186019

11 years agoMemoryBuffer::getFile handles zero sized files, no need to duplicate the test.
Rafael Espindola [Wed, 10 Jul 2013 17:30:39 +0000 (17:30 +0000)]
MemoryBuffer::getFile handles zero sized files, no need to duplicate the test.

llvm-svn: 186018

11 years agoReplacing an empty switch with its moral equivalent. No functional changes intended.
Aaron Ballman [Wed, 10 Jul 2013 17:19:22 +0000 (17:19 +0000)]
Replacing an empty switch with its moral equivalent.  No functional changes intended.

llvm-svn: 186017

11 years agoUse status to implement file_size.
Rafael Espindola [Wed, 10 Jul 2013 17:16:40 +0000 (17:16 +0000)]
Use status to implement file_size.

The status function is already using a syscall that returns the file size.
Remember it and implement file_size as a simple wrapper.

No functionally change, but clients that already use status now can avoid
calling file_size.

llvm-svn: 186016

11 years agoUse the appropriate unsigned int type for the offset.
Adrian Prantl [Wed, 10 Jul 2013 16:56:52 +0000 (16:56 +0000)]
Use the appropriate unsigned int type for the offset.

llvm-svn: 186015

11 years agoSafeguard DBG_VALUE handling. Unbreaks the ASAN buildbot.
Adrian Prantl [Wed, 10 Jul 2013 16:56:47 +0000 (16:56 +0000)]
Safeguard DBG_VALUE handling. Unbreaks the ASAN buildbot.

llvm-svn: 186014

11 years agoSimplify code.
Craig Topper [Wed, 10 Jul 2013 16:38:35 +0000 (16:38 +0000)]
Simplify code.

llvm-svn: 186013

11 years agoR600/SI: Initial local memory support
Michel Danzer [Wed, 10 Jul 2013 16:37:07 +0000 (16:37 +0000)]
R600/SI: Initial local memory support

Enough for the radeonsi driver to use it for calculating derivatives.

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

11 years agoR600/SI: Add pattern for the AMDGPU.barrier.local intrinsic
Michel Danzer [Wed, 10 Jul 2013 16:36:57 +0000 (16:36 +0000)]
R600/SI: Add pattern for the AMDGPU.barrier.local intrinsic

lit test coverage to follow in the next commit.

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

11 years agoR600/SI: Add intrinsic for retrieving the current thread ID
Michel Danzer [Wed, 10 Jul 2013 16:36:52 +0000 (16:36 +0000)]
R600/SI: Add intrinsic for retrieving the current thread ID

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

11 years agoR600/SI: Initial support for LDS/GDS instructions
Michel Danzer [Wed, 10 Jul 2013 16:36:43 +0000 (16:36 +0000)]
R600/SI: Initial support for LDS/GDS instructions

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

11 years agoR600/SI: Add intrinsics for texture sampling with user derivatives
Michel Danzer [Wed, 10 Jul 2013 16:36:36 +0000 (16:36 +0000)]
R600/SI: Add intrinsics for texture sampling with user derivatives

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

11 years agoGenerate a unique filename for a given header
Tareq A. Siraj [Wed, 10 Jul 2013 16:09:36 +0000 (16:09 +0000)]
Generate a unique filename for a given header

This patch is in preparation for writing the header replacement to disk.
Added getUniqueHeaderName() that generates a unique header filename in
the same directory as the header file.

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

llvm-svn: 186007

11 years agoRemove llvm/ADT/NullablePtr.h, there are no uses of it in-tree.
Argyrios Kyrtzidis [Wed, 10 Jul 2013 15:33:20 +0000 (15:33 +0000)]
Remove llvm/ADT/NullablePtr.h, there are no uses of it in-tree.

llvm-svn: 186006

11 years agoPPC: Add a better comment about the i64 FI fixup
Hal Finkel [Wed, 10 Jul 2013 15:29:01 +0000 (15:29 +0000)]
PPC: Add a better comment about the i64 FI fixup

In discussing this change with Bill Schmidt, it was decided that the original
comment about negative FIs was incorrect. We'll still exclude them for now, but
now with a more-accurate explanation.

llvm-svn: 186005

11 years ago[sanitizer] More checks in mbstowcs-like interceptors.
Evgeniy Stepanov [Wed, 10 Jul 2013 14:17:46 +0000 (14:17 +0000)]
[sanitizer] More checks in mbstowcs-like interceptors.

llvm-svn: 186004

11 years agoAdd experimental flag for adaptive parameter bin-packing.
Daniel Jasper [Wed, 10 Jul 2013 14:02:49 +0000 (14:02 +0000)]
Add experimental flag for adaptive parameter bin-packing.

This is not activated for any style, might change or go away
completely.

For those that want to play around with it, set
ExperimentalAutoDetectBinPacking to true.

clang-format will then:
Look at whether function calls/declarations/definitions are currently
formatted with one parameter per line (on a case-by-case basis). If so,
clang-format will avoid bin-packing the parameters. If all parameters
are on one line (thus that line is "inconclusive"), clang-format will
make the choice dependent on whether there are other bin-packed
calls/declarations in the same file.

The reason for this change is that bin-packing in some situations can be
really bad and an author might opt to put one parameter on each line. If
the author does that, he might want clang-format not to mess with that.
If the author is unhappy with the one-per-line formatting, clang-format
can easily be convinced to bin-pack by putting any two parameters on the
same line.

llvm-svn: 186003

11 years ago[sanitizer] Fix handling of edge cases in mbstowcs-like interceptors.
Evgeniy Stepanov [Wed, 10 Jul 2013 14:01:51 +0000 (14:01 +0000)]
[sanitizer] Fix handling of edge cases in mbstowcs-like interceptors.

llvm-svn: 186002

11 years agoReverting commit r185999 due to buildboot failure.
Vladimir Medic [Wed, 10 Jul 2013 12:27:25 +0000 (12:27 +0000)]
Reverting commit r185999 due to buildboot failure.

llvm-svn: 186001