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

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

llvm-svn: 186000

11 years agoAdd support for Mips break and syscall insructions. The corresponding test cases...
Vladimir Medic [Wed, 10 Jul 2013 10:18:10 +0000 (10:18 +0000)]
Add support for Mips break and syscall insructions. The corresponding test cases are added.

llvm-svn: 185999

11 years agoFix a bug in the readdir_r interceptor: when we reach the end of the
Chandler Carruth [Wed, 10 Jul 2013 09:50:29 +0000 (09:50 +0000)]
Fix a bug in the readdir_r interceptor: when we reach the end of the
directory stream, the entry is not written to, instead *result is set to
NULL and the entry is not written to at all.

I'm still somewhat suspicious of the correct instrumention here --
I feel like it should be marking the written range as the pointer in
*result and the length (*result)->d_reclen in case the implementation
decides not to use the passed-in entry (if that's even allowed).
Finally, the definition of 'struct dirent' analog used in the
interceptor is wrong in 32-bit mode with _FILE_OFFSET_BITS=64 as it hard
codes the use of a pointer-sized offset.

I've added a somewhat goofy test for the bug I fixed via ASan --
suggestions on how to better test the interceptor logic itself welcome.

llvm-svn: 185998

11 years agoFixed comment of Sema::FindInstantiatedDecl.
Serge Pavlov [Wed, 10 Jul 2013 04:59:14 +0000 (04:59 +0000)]
Fixed comment of Sema::FindInstantiatedDecl.

llvm-svn: 185997

11 years agoCall xmlFree on the node contents returned by xmlNodeGetContent, as the docs say...
Jim Ingham [Wed, 10 Jul 2013 02:21:57 +0000 (02:21 +0000)]
Call xmlFree on the node contents returned by xmlNodeGetContent, as the docs say to do.

<rdar://problem/14391836>

llvm-svn: 185996

11 years agoFix typo
Stephen Lin [Wed, 10 Jul 2013 01:57:39 +0000 (01:57 +0000)]
Fix typo

llvm-svn: 185995

11 years agoExplicitly define ARMISelLowering::isFMAFasterThanFMulAndFAdd. No functionality change.
Stephen Lin [Wed, 10 Jul 2013 01:54:24 +0000 (01:54 +0000)]
Explicitly define ARMISelLowering::isFMAFasterThanFMulAndFAdd. No functionality change.

Currently ARM is the only backend that supports FMA instructions (for at least some subtargets) but does not implement this virtual, so FMAs are never generated except from explicit fma intrinsic calls. Apparently this is due to the fact that it supports both fused (one rounding step) and unfused (two rounding step) multiply + add instructions. This patch clarifies that this the case without changing behavior by implementing the virtual function to simply return false, as the default TargetLoweringBase version does.

It is possible that some cpus perform the fused version faster than the unfused version and vice-versa, so the function implementation should be revisited if hard data is found.

llvm-svn: 185994

11 years agoUn-break the buildbot by tweaking the indirection flag.
Adrian Prantl [Wed, 10 Jul 2013 01:53:37 +0000 (01:53 +0000)]
Un-break the buildbot by tweaking the indirection flag.
Pulled in a testcase from the debuginfo-test suite.

llvm-svn: 185993

11 years agoDocument a known limitation of the status quo.
Adrian Prantl [Wed, 10 Jul 2013 01:53:30 +0000 (01:53 +0000)]
Document a known limitation of the status quo.

llvm-svn: 185992

11 years agoFinish off mangling locals in block literals.
Eli Friedman [Wed, 10 Jul 2013 01:33:19 +0000 (01:33 +0000)]
Finish off mangling locals in block literals.

Specifically, handle the case where the block is in a default argument
in a class method.  The mangling here follows what we do for lambdas.

llvm-svn: 185991

11 years agoCleanup on the unified section list changes. Main changes are:
Greg Clayton [Wed, 10 Jul 2013 01:23:25 +0000 (01:23 +0000)]
Cleanup on the unified section list changes. Main changes are:
- ObjectFile::GetSymtab() and ObjectFile::ClearSymtab() no longer takes any flags
- Module coordinates with the object files and contain a unified section list so that object file and symbol file can share sections when they need to, yet contain their own sections.

Other cleanups:
- Fixed Symbol::GetByteSize() to not have the symbol table compute the byte sizes on the fly
- Modified the ObjectFileMachO class to compute symbol sizes all at once efficiently
- Modified the Symtab class to store a file address lookup table for more efficient lookups
- Removed Section::Finalize() and SectionList::Finalize() as they did nothing
- Improved performance of the detection of symbol files that have debug maps by excluding stripped files and core files, debug files, object files and stubs
- Added the ability to tell if an ObjectFile has been stripped with ObjectFile::IsStripped() (used this for the above performance improvement)

llvm-svn: 185990

11 years agoGet rid of dead/useless code for block mangling.
Eli Friedman [Wed, 10 Jul 2013 01:13:27 +0000 (01:13 +0000)]
Get rid of dead/useless code for block mangling.

llvm-svn: 185989

11 years agoFixed the CommunicationKDP::SendRequestAndGetReply() to correctly be able to deal...
Greg Clayton [Wed, 10 Jul 2013 01:05:05 +0000 (01:05 +0000)]
Fixed the CommunicationKDP::SendRequestAndGetReply() to correctly be able to deal with getting a reply from a previous packet without resending the packet again.

llvm-svn: 185988

11 years agoCorrect comment.
Duncan Sands [Wed, 10 Jul 2013 00:52:41 +0000 (00:52 +0000)]
Correct comment.

llvm-svn: 185987

11 years agoMore local mangling fixes.
Eli Friedman [Wed, 10 Jul 2013 00:30:46 +0000 (00:30 +0000)]
More local mangling fixes.

Compute mangling numbers for externally visible local variables and tags.
Change the mangler to consistently use discriminators where necessary.
Tweak the scheme we use to number decls which are not externally visible
to avoid unnecessary discriminators in common cases now that we request
them more consistently.

Fixes <rdar://problem/14204721>.

llvm-svn: 185986

11 years agoobjc migrator: More refinment of property
Fariborz Jahanian [Wed, 10 Jul 2013 00:20:11 +0000 (00:20 +0000)]
objc migrator: More refinment of property
attributes in migration. Specialli use of
'copy' attribute for retainable object types.

llvm-svn: 185985

11 years agoFix comment.
Eric Christopher [Tue, 9 Jul 2013 23:48:45 +0000 (23:48 +0000)]
Fix comment.

llvm-svn: 185984

11 years agoAdd silent option to command source.
Michael Sartain [Tue, 9 Jul 2013 23:22:53 +0000 (23:22 +0000)]
Add silent option to command source.
Patch from Matthew Sorrels

llvm-svn: 185983

11 years agoARM: Fix incorrect pack pattern for thumb2
Jim Grosbach [Tue, 9 Jul 2013 22:59:22 +0000 (22:59 +0000)]
ARM: Fix incorrect pack pattern for thumb2

Propagate the fix from r185712 to Thumb2 codegen as well. Original
commit message applies here as well:

A "pkhtb x, x, y asr #num" uses the lower 16 bits of "y asr #num" and
packs them in the bottom half of "x". An arithmetic and logic shift are
only equivalent in this context if the shift amount is 16. We would be
shifting in ones into the bottom 16bits instead of zeros if "y" is
negative.

rdar://14338767

llvm-svn: 185982

11 years agoReverting ProcessMonitor shared pointer changes
Andrew Kaylor [Tue, 9 Jul 2013 22:36:48 +0000 (22:36 +0000)]
Reverting ProcessMonitor shared pointer changes

llvm-svn: 185981

11 years ago[asan] Update blacklists to use categories.
Peter Collingbourne [Tue, 9 Jul 2013 22:04:28 +0000 (22:04 +0000)]
[asan] Update blacklists to use categories.

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

llvm-svn: 185980

11 years agoApply BlackList -> SpecialCaseList rename in Clang.
Peter Collingbourne [Tue, 9 Jul 2013 22:03:30 +0000 (22:03 +0000)]
Apply BlackList -> SpecialCaseList rename in Clang.

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

llvm-svn: 185979

11 years agoImplement categories for special case lists.
Peter Collingbourne [Tue, 9 Jul 2013 22:03:17 +0000 (22:03 +0000)]
Implement categories for special case lists.

A special case list can now specify categories for specific globals,
which can be used to instruct an instrumentation pass to treat certain
functions or global variables in a specific way, such as by omitting
certain aspects of instrumentation while keeping others, or informing
the instrumentation pass that a specific uninstrumentable function
has certain semantics, thus allowing the pass to instrument callers
according to those semantics.

For example, AddressSanitizer now uses the "init" category instead of
global-init prefixes for globals whose initializers should not be
instrumented, but which in all other respects should be instrumented.

The motivating use case is DataFlowSanitizer, which will have a
number of different categories for uninstrumentable functions, such
as "functional" which specifies that a function has pure functional
semantics, or "discard" which indicates that a function's return
value should not be labelled.

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

llvm-svn: 185978

11 years agoAdd some SpecialCaseList unit tests.
Peter Collingbourne [Tue, 9 Jul 2013 22:03:12 +0000 (22:03 +0000)]
Add some SpecialCaseList unit tests.

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

llvm-svn: 185977

11 years agoIntroduce a SpecialCaseList ctor which takes a MemoryBuffer to make
Peter Collingbourne [Tue, 9 Jul 2013 22:03:09 +0000 (22:03 +0000)]
Introduce a SpecialCaseList ctor which takes a MemoryBuffer to make
it more unit testable, and fix memory leak in the other ctor.

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

llvm-svn: 185976

11 years agoRename BlackList class to SpecialCaseList and move it to Transforms/Utils.
Peter Collingbourne [Tue, 9 Jul 2013 22:02:49 +0000 (22:02 +0000)]
Rename BlackList class to SpecialCaseList and move it to Transforms/Utils.

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

llvm-svn: 185975

11 years agoObjective-C: merge objc_requires_super attribute of
Fariborz Jahanian [Tue, 9 Jul 2013 22:02:20 +0000 (22:02 +0000)]
Objective-C: merge objc_requires_super attribute of
method declaration into its implementation to
prevent a bogus warning about mismatched attributes.
then make sure the warning about missing call to super comes out
of the method implementation. // rdar://14251387

llvm-svn: 185974

11 years agoInstSimplify: X >> X -> 0
David Majnemer [Tue, 9 Jul 2013 22:01:22 +0000 (22:01 +0000)]
InstSimplify: X >> X -> 0

llvm-svn: 185973

11 years agomove test into the appropriate subdir.
Adrian Prantl [Tue, 9 Jul 2013 21:44:11 +0000 (21:44 +0000)]
move test into the appropriate subdir.

llvm-svn: 185972

11 years agoTypo.
Adrian Prantl [Tue, 9 Jul 2013 21:44:06 +0000 (21:44 +0000)]
Typo.

llvm-svn: 185971

11 years agoFix PR16571, which is a bug in the code that checks that all of the types in the...
Nadav Rotem [Tue, 9 Jul 2013 21:38:08 +0000 (21:38 +0000)]
Fix PR16571, which is a bug in the code that checks that all of the types in the bundle are uniform.

llvm-svn: 185970