platform/upstream/llvm.git
11 years agoAdd bitcast to store of personality function.
Kai Nacke [Tue, 14 May 2013 16:30:51 +0000 (16:30 +0000)]
Add bitcast to store of personality function.

The personality function is user defined and may have an arbitrary result type.
The code assumes always i8*. This results in an assertion failure if a different
type is used. A bitcast to i8* is added to prevent this failure.

Reviewed by: Renato Golin, Bob Wilson

llvm-svn: 181802

11 years agoFix ARM FastISel tests, as a first step to enabling ARM FastISel
Derek Schuff [Tue, 14 May 2013 16:26:38 +0000 (16:26 +0000)]
Fix ARM FastISel tests, as a first step to enabling ARM FastISel

ARM FastISel is currently only enabled for iOS non-Thumb1, and I'm working on
enabling it for other targets. As a first step I've fixed some of the tests.
Changes to ARM FastISel tests:
- Different triples don't generate the same relocations (especially
  movw/movt versus constant pool loads). Use a regex to allow either.
- Mangling is different. Use a regex to allow either.
- The reserved registers are sometimes different, so registers get
  allocated in a different order. Capture the names only where this
  occurs.
- Add -verify-machineinstrs to some tests where it works. It doesn't
  work everywhere it should yet.
- Add -fast-isel-abort to many tests that didn't have it before.
- Split out the VarArg test from fast-isel-call.ll into its own
  test. This simplifies test setup because of --check-prefix.

Patch by JF Bastien

llvm-svn: 181801

11 years agoPPC32: Fix stack collision between FP and CR save areas.
Bill Schmidt [Tue, 14 May 2013 16:08:32 +0000 (16:08 +0000)]
PPC32: Fix stack collision between FP and CR save areas.

The changes to CR spill handling missed a case for 32-bit PowerPC.
The code in PPCFrameLowering::processFunctionBeforeFrameFinalized()
checks whether CR spill has occurred using a flag in the function
info.  This flag is only set by storeRegToStackSlot and
loadRegFromStackSlot.  spillCalleeSavedRegisters does not call
storeRegToStackSlot, but instead produces MI directly.  Thus we don't
see the CR is spilled when assigning frame offsets, and the CR spill
ends up colliding with some other location (generally the FP slot).

This patch sets the flag in spillCalleeSavedRegisters for PPC32 so
that the CR spill is properly detected and gets its own slot in the
stack frame.

llvm-svn: 181800

11 years agoHexagon: Test case to check if branch probabilities are properly reflected in
Jyotsna Verma [Tue, 14 May 2013 15:50:49 +0000 (15:50 +0000)]
Hexagon: Test case to check if branch probabilities are properly reflected in
the jump instructions in the form of taken/not-taken hint.

llvm-svn: 181799

11 years agoAdd LeakSanitizer.rst to docs.
Sergey Matveev [Tue, 14 May 2013 15:48:54 +0000 (15:48 +0000)]
Add LeakSanitizer.rst to docs.

llvm-svn: 181798

11 years agoHexagon: Remove dead-code after unconditional return from addPreSched2.
Jyotsna Verma [Tue, 14 May 2013 15:33:27 +0000 (15:33 +0000)]
Hexagon: Remove dead-code after unconditional return from addPreSched2.

llvm-svn: 181797

11 years ago[sanitizer] Fix Android build.
Sergey Matveev [Tue, 14 May 2013 15:22:39 +0000 (15:22 +0000)]
[sanitizer] Fix Android build.

llvm-svn: 181796

11 years agoFix inline stepping test case on Linux because Thread::ThreadStoppedForAReason ignore...
Daniel Malea [Tue, 14 May 2013 15:20:12 +0000 (15:20 +0000)]
Fix inline stepping test case on Linux because Thread::ThreadStoppedForAReason ignored virtual steps.
- add IsVirtualStep() virtual function to ThreadPlan, and implement it for
  ThreadPlanStepInRange
- make GetPrivateStopReason query the current thread plan for a virtual stop to
  decide if the current stop reason needs to be preserved
- remove extra check for an existing process in GetPrivateStopReason

llvm-svn: 181795

11 years ago[sanitizer] Fixed a bug in GetListOfModules.
Sergey Matveev [Tue, 14 May 2013 14:48:58 +0000 (14:48 +0000)]
[sanitizer] Fixed a bug in GetListOfModules.

llvm-svn: 181793

11 years agoR600/SI: Add processor type for Hainan asic
Tom Stellard [Tue, 14 May 2013 14:42:56 +0000 (14:42 +0000)]
R600/SI: Add processor type for Hainan asic

Patch by: Alex Deucher

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
NOTE: This is a candidate for the 3.3 branch.
llvm-svn: 181792

11 years ago[sanitizer] Filtering in GetListOfModules.
Sergey Matveev [Tue, 14 May 2013 14:04:06 +0000 (14:04 +0000)]
[sanitizer] Filtering in GetListOfModules.

llvm-svn: 181791

11 years agoAdd sanitizer syscall hooks to the tool's export lists.
Evgeniy Stepanov [Tue, 14 May 2013 13:55:21 +0000 (13:55 +0000)]
Add sanitizer syscall hooks to the tool's export lists.

llvm-svn: 181790

11 years agoAvoid $rax for 32-bit inferiors to fix a failing i386 test on the darwin buildbots.
Ashok Thirumurthi [Tue, 14 May 2013 13:34:25 +0000 (13:34 +0000)]
Avoid $rax for 32-bit inferiors to fix a failing i386 test on the darwin buildbots.

llvm-svn: 181789

11 years agoGet the unittests compiling when building with cmake and the setting
Duncan Sands [Tue, 14 May 2013 13:29:16 +0000 (13:29 +0000)]
Get the unittests compiling when building with cmake and the setting
-DLLVM_ENABLE_THREADS=false.

llvm-svn: 181788

11 years ago[sanitizer] LibraryNameIs in sanitizer_linux
Sergey Matveev [Tue, 14 May 2013 13:24:46 +0000 (13:24 +0000)]
[sanitizer] LibraryNameIs in sanitizer_linux

llvm-svn: 181787

11 years ago[sanitizer] Minor fixes in sanitizer_common tests.
Sergey Matveev [Tue, 14 May 2013 13:19:33 +0000 (13:19 +0000)]
[sanitizer] Minor fixes in sanitizer_common tests.

llvm-svn: 181786

11 years agoDeclare __clear_cache.
Rafael Espindola [Tue, 14 May 2013 13:02:37 +0000 (13:02 +0000)]
Declare __clear_cache.

GCC declares __clear_cache in the gnu modes (-std=gnu++98,
-std=gnu++11), but not in the strict modes (-std=c++98, -std=c++11). This patch
declares it and therefore fixes the build when using one of the strict modes.

llvm-svn: 181785

11 years agoFix __clear_cache on ARM.
Rafael Espindola [Tue, 14 May 2013 12:45:47 +0000 (12:45 +0000)]
Fix __clear_cache on ARM.

Current gcc's produce an error if __clear_cache is anything but

__clear_cache(char *a, char *b);

It looks like we had just implemented a gcc bug that is now fixed.

llvm-svn: 181784

11 years agoLink dynamic ast matchers with the ast matchers library. Unbreaks shared cmake build.
Benjamin Kramer [Tue, 14 May 2013 12:41:50 +0000 (12:41 +0000)]
Link dynamic ast matchers with the ast matchers library. Unbreaks shared cmake build.

llvm-svn: 181783

11 years agoRevert accidental commit.
Benjamin Kramer [Tue, 14 May 2013 12:23:08 +0000 (12:23 +0000)]
Revert accidental commit.

llvm-svn: 181782

11 years agoTake a stab at trying to unbreak the makefile build.
Benjamin Kramer [Tue, 14 May 2013 12:21:21 +0000 (12:21 +0000)]
Take a stab at trying to unbreak the makefile build.

There is no clangRewrite.a.

llvm-svn: 181781

11 years agoHopefully fix configure build.
Manuel Klimek [Tue, 14 May 2013 11:59:20 +0000 (11:59 +0000)]
Hopefully fix configure build.

llvm-svn: 181780

11 years agoFix uninitialized value bug found by valgrind.
Daniel Jasper [Tue, 14 May 2013 10:44:17 +0000 (10:44 +0000)]
Fix uninitialized value bug found by valgrind.

llvm-svn: 181779

11 years agoCorrectly determine ranges for clang-format.
Daniel Jasper [Tue, 14 May 2013 10:31:09 +0000 (10:31 +0000)]
Correctly determine ranges for clang-format.

We have been assuming that CharSourceRange::getTokenRange() by itself
expands a range until the end of a token, but in fact it only sets
IsTokenRange to true. Thus, we have so far only considered the first
character of the last token to belong to an unwrapped line. This
did not really manifest in symptoms as all edit integrations
expand ranges to fully lines.

llvm-svn: 181778

11 years ago[SystemZ] Add disassembler support
Richard Sandiford [Tue, 14 May 2013 10:17:52 +0000 (10:17 +0000)]
[SystemZ] Add disassembler support

llvm-svn: 181777

11 years agoR600/SI: Add lit test coverage for the remaining patterns added recently
Michel Danzer [Tue, 14 May 2013 09:53:30 +0000 (09:53 +0000)]
R600/SI: Add lit test coverage for the remaining patterns added recently

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 181775

11 years ago[SystemZ] Add extra testscases for r181773
Richard Sandiford [Tue, 14 May 2013 09:49:11 +0000 (09:49 +0000)]
[SystemZ] Add extra testscases for r181773

Forgot to svn add these...

llvm-svn: 181774

11 years ago[SystemZ] Rework handling of constant PC-relative operands
Richard Sandiford [Tue, 14 May 2013 09:47:26 +0000 (09:47 +0000)]
[SystemZ] Rework handling of constant PC-relative operands

The GNU assembler treats things like:

        brasl   %r14, 100

in the same way as:

        brasl   %r14, .+100

rather than as a branch to absolute address 100.  We implemented this in
LLVM by creating an immediate operand rather than the usual expr operand,
and by handling immediate operands specially in the code emitter.
This was undesirable for (at least) three reasons:

- the specialness of immediate operands was exposed to the backend MC code,
  rather than being limited to the assembler parser.

- in disassembly, an immediate operand really is an absolute address.
  (Note that this means reassembling printed disassembly can't recreate
  the original code.)

- it would interfere with any assembly manipulation that we might
  try in future.  E.g. operations like branch shortening can change
  the relative position of instructions, but any code that updates
  sym+offset addresses wouldn't update an immediate "100" operand
  in the same way as an explicit ".+100" operand.

This patch changes the implementation so that the assembler creates
a "." label for immediate PC-relative operands, so that the operand
to the MCInst is always the absolute address.  The patch also adds
some error checking of the offset.

llvm-svn: 181773

11 years ago[SystemZ] Remove bogus isAsmParserOnly
Richard Sandiford [Tue, 14 May 2013 09:38:07 +0000 (09:38 +0000)]
[SystemZ] Remove bogus isAsmParserOnly

Marking instructions as isAsmParserOnly stops them from being disassembled.
However, in cases where separate asm and codegen versions exist, we actually
want to disassemble to the asm ones.

No functional change intended.

llvm-svn: 181772

11 years ago[SystemZ] Match operands to fields by name rather than by order
Richard Sandiford [Tue, 14 May 2013 09:36:44 +0000 (09:36 +0000)]
[SystemZ] Match operands to fields by name rather than by order

The SystemZ port currently relies on the order of the instruction operands
matching the order of the instruction field lists.  This isn't desirable
for disassembly, where the two are matched only by name.  E.g. the R1 and R2
fields of an RR instruction should have corresponding R1 and R2 operands.

The main complication is that addresses are compound operands,
and as far as I know there is no mechanism to allow individual
suboperands to be selected by name in "let Inst{...} = ..." assignments.
Luckily it doesn't really matter though.  The SystemZ instruction
encoding groups all address fields together in a predictable order,
so it's just as valid to see the entire compound address operand as
a single field.  That's the approach taken in this patch.

Matching by name in turn means that the operands to COPY SIGN and
CONVERT TO FIXED instructions can be given in natural order.
(It was easier to do this at the same time as the rename,
since otherwise the intermediate step was too confusing.)

No functional change intended.

llvm-svn: 181771

11 years agoFix clang-format bug in unwrapped-line merging.
Daniel Jasper [Tue, 14 May 2013 09:30:02 +0000 (09:30 +0000)]
Fix clang-format bug in unwrapped-line merging.

Before (in styles that allow it), clang-format would not merge an
if statement onto a single line, if only the second line was format
(e.g. in an editor integration):

if (a)
  return; // clang-format invoked on this line.

With this patch, this gets properly merged to:

if (a) return; // ...

llvm-svn: 181770

11 years ago[SystemZ] Match operands to fields by name rather than by order
Richard Sandiford [Tue, 14 May 2013 09:28:21 +0000 (09:28 +0000)]
[SystemZ] Match operands to fields by name rather than by order

The SystemZ port currently relies on the order of the instruction operands
matching the order of the instruction field lists.  This isn't desirable
for disassembly, where the two are matched only by name.  E.g. the R1 and R2
fields of an RR instruction should have corresponding R1 and R2 operands.

The main complication is that addresses are compound operands,
and as far as I know there is no mechanism to allow individual
suboperands to be selected by name in "let Inst{...} = ..." assignments.
Luckily it doesn't really matter though.  The SystemZ instruction
encoding groups all address fields together in a predictable order,
so it's just as valid to see the entire compound address operand as
a single field.  That's the approach taken in this patch.

Matching by name in turn means that the operands to COPY SIGN and
CONVERT TO FIXED instructions can be given in natural order.
(It was easier to do this at the same time as the rename,
since otherwise the intermediate step was too confusing.)

No functional change intended.

llvm-svn: 181769

11 years agoFirst revision of the dynamic ASTMatcher library.
Manuel Klimek [Tue, 14 May 2013 09:13:00 +0000 (09:13 +0000)]
First revision of the dynamic ASTMatcher library.

This library supports all the features of the compile-time based ASTMatcher
library, but allows the user to specify and construct the matchers at runtime.
It contains the following modules:
 - A variant type, to be used by the matcher factory.
 - A registry, where the matchers are indexed by name and have a factory method
   with a generic signature.
 - A simple matcher expression parser, that can be used to convert a matcher
   expression string into actual matchers that can be used with the AST at
   runtime.

Many features where omitted from this first revision to simplify this code
review. The main ideas are still represented in this change and it already has
support working use cases.
Things that are missing:
 - Support for polymorphic matchers. These requires supporting code in the
   registry, the marshallers and the variant type.
 - Support for numbers, char and bool arguments to the matchers. This requires
   supporting code in the parser and the variant type.
 - A command line program putting everything together and providing an already
   functional tool.

Patch by Samuel Benzaquen.

llvm-svn: 181768

11 years agoImplement string literal breaking on unbreakable token sequences.
Manuel Klimek [Tue, 14 May 2013 09:04:24 +0000 (09:04 +0000)]
Implement string literal breaking on unbreakable token sequences.

This fixes indentation where there are for example multiple closing
parentheses after a string literal, and where those parentheses
run over the end of the line.

During testing this revealed a bug in the implementation of
breakProtrudingToken: we don't want to change the state if we didn't
actually do anything.

llvm-svn: 181767

11 years agoUpdate clang-format emacs integration.
Daniel Jasper [Tue, 14 May 2013 08:48:24 +0000 (08:48 +0000)]
Update clang-format emacs integration.

- Remove free variables
- Add function clang-format-buffer, e.g. for before-save-hooks
- Wrap restoring windows in an unwind-protect

Patch by Stephen Gildea!

llvm-svn: 181766

11 years agoAArch64: add test for updated __clear_cache definition
Tim Northover [Tue, 14 May 2013 08:37:13 +0000 (08:37 +0000)]
AArch64: add test for updated __clear_cache definition

llvm-svn: 181765

11 years agoDon't format sizeof/alignof as function types.
Daniel Jasper [Tue, 14 May 2013 08:34:47 +0000 (08:34 +0000)]
Don't format sizeof/alignof as function types.

Before: A<sizeof (*x)> a;
After:  A<sizeof(*x)> a;
llvm-svn: 181764

11 years ago[tsan] fix gcc build with -Wall
Kostya Serebryany [Tue, 14 May 2013 08:26:55 +0000 (08:26 +0000)]
[tsan] fix gcc build with -Wall

llvm-svn: 181763

11 years agoAArch64: correct definition of __clear_cache
Tim Northover [Tue, 14 May 2013 08:26:14 +0000 (08:26 +0000)]
AArch64: correct definition of __clear_cache

According to libgcc document __clear_cache takes two char*
pointers. I suspect GCC's actual behaviour is more subtle than that,
but char* should clearly be preferred to void*.

llvm-svn: 181762

11 years agoReplace EXPECT_EQ with EXPECT_FALSE to avoid gcc warning
Patrik Hagglund [Tue, 14 May 2013 07:53:53 +0000 (07:53 +0000)]
Replace EXPECT_EQ with EXPECT_FALSE to avoid gcc warning
[-Wconversion-null], introduced in r181326.

llvm-svn: 181761

11 years agoRemoved trailing whitespace.
Michael Gottesman [Tue, 14 May 2013 06:40:10 +0000 (06:40 +0000)]
Removed trailing whitespace.

llvm-svn: 181760

11 years agoFix typo.
Reed Kotler [Tue, 14 May 2013 06:00:01 +0000 (06:00 +0000)]
Fix typo.

llvm-svn: 181759

11 years agoSuppress bogus "use of undefined constexpr function" error if the function body
Richard Smith [Tue, 14 May 2013 05:18:44 +0000 (05:18 +0000)]
Suppress bogus "use of undefined constexpr function" error if the function body
was erroneous and got discarded.

llvm-svn: 181758

11 years agoA few more small tweaks to arm core file handling.
Jason Molenda [Tue, 14 May 2013 04:50:47 +0000 (04:50 +0000)]
A few more small tweaks to arm core file handling.
Most importantly, have DoReadGPR/DoReadFPU/DoReadEXC return -1
to indicate failure if they're called.  Else these could override
the Error setting for the relevant thread state -- if the core file
didn't include a floating point thread state, for instance, these
functions would clear the Error setting for that register set and
lldb would display random bytes as those registers' contents.
<rdar://problem/13665075>

llvm-svn: 181757

11 years agoSmall change to the previous checkin, read in the fpu register context
Jason Molenda [Tue, 14 May 2013 03:52:22 +0000 (03:52 +0000)]
Small change to the previous checkin, read in the fpu register context
in one large block - and be sure toget the fpscr value as well when
processing a core file.

llvm-svn: 181756

11 years agoFixes to read the floating point and exception registers sets out
Jason Molenda [Tue, 14 May 2013 03:25:58 +0000 (03:25 +0000)]
Fixes to read the floating point and exception registers sets out
of arm Mach-O core files.
<rdar://problem/13665075>

llvm-svn: 181755

11 years agoRemoved an unnamed namespace and forgot to make two of the functions inside
Reed Kotler [Tue, 14 May 2013 02:13:45 +0000 (02:13 +0000)]
Removed an unnamed namespace and forgot to make two of the functions inside
"static".

llvm-svn: 181754

11 years agoThis is the first of three patches which creates stubs used for
Reed Kotler [Tue, 14 May 2013 02:00:24 +0000 (02:00 +0000)]
This is the first of three patches which creates stubs used for
Mips16/32 floating point interoperability.

When Mips16 code calls external functions that would normally have some
of its parameters or return values passed in floating point registers,
it needs (Mips32) helper functions to do this because while in Mips16 mode
there is no ability to access the floating point registers.

In Pic mode, this is done with a set of predefined functions in libc.
This case is already handled in llvm for Mips16.

In static relocation mode, for efficiency reasons, the compiler generates
stubs that the linker will use if it turns out that the external function
is a Mips32 function. (If it's Mips16, then it does not need the helper
stubs).

These stubs are identically named and the linker knows about these tricks
and will not create multiple copies and will delete them if they are not
needed.

llvm-svn: 181753

11 years ago[lld][LayoutPass] Fix a bug that caused buildbot to fail on some platforms.
Rui Ueyama [Tue, 14 May 2013 01:51:56 +0000 (01:51 +0000)]
[lld][LayoutPass] Fix a bug that caused buildbot to fail on some platforms.

llvm-svn: 181752

11 years agoStackColoring: don't clear an instruction's mem operand if the underlying
Akira Hatanaka [Tue, 14 May 2013 01:42:44 +0000 (01:42 +0000)]
StackColoring: don't clear an instruction's mem operand if the underlying
object is a PseudoSourceValue and PseudoSourceValue::isConstant returns true (i.e.,
points to memory that has a constant value).

llvm-svn: 181751

11 years agoUse atomic instructions on linux thumb v7.
Rafael Espindola [Tue, 14 May 2013 00:44:24 +0000 (00:44 +0000)]
Use atomic instructions on linux thumb v7.

This matches gcc's behaviour. The patch also explicitly parses the version so
that this keeps working when we add support for v8.

llvm-svn: 181750

11 years ago[lld][LayoutPass] Split buildFollowOnTable for readability.
Rui Ueyama [Tue, 14 May 2013 00:41:52 +0000 (00:41 +0000)]
[lld][LayoutPass] Split buildFollowOnTable for readability.

Summary:
Split buildFollowOnTable to small functions to improve
code readability and remove code duplication. No change
in functionality.

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

llvm-svn: 181749

11 years agoAssert that DIEEntries are constructed with non-null DIEs
David Blaikie [Tue, 14 May 2013 00:35:19 +0000 (00:35 +0000)]
Assert that DIEEntries are constructed with non-null DIEs

This just brings a crash a little further forward from DWARF emission to
DIE construction to make errors easier to diagnose.

llvm-svn: 181748

11 years agoPR15956: Debug Info: Include the appropriate file location in types created due to...
David Blaikie [Tue, 14 May 2013 00:34:20 +0000 (00:34 +0000)]
PR15956: Debug Info: Include the appropriate file location in types created due to using declarations

We might benefit from API refactoring here (why pass in a value that's
derived from another parameter?) but this is the immediate issue.

llvm-svn: 181747

11 years agoLoopVectorize: Handle loops with multiple forward inductions
Arnold Schwaighofer [Tue, 14 May 2013 00:21:18 +0000 (00:21 +0000)]
LoopVectorize: Handle loops with multiple forward inductions

We used to give up if we saw two integer inductions. After this patch, we base
further induction variables on the chosen one like we do in the reverse
induction and pointer induction case.

Fixes PR15720.

radar://13851975

llvm-svn: 181746

11 years ago[objc-arc-opts] Added debug statements when we set and unset whether a pointer is...
Michael Gottesman [Tue, 14 May 2013 00:08:09 +0000 (00:08 +0000)]
[objc-arc-opts] Added debug statements when we set and unset whether a pointer is known positive.

llvm-svn: 181745

11 years ago[analyzer] Refactor: address Jordan’s code review of r181738.
Anna Zaks [Mon, 13 May 2013 23:49:51 +0000 (23:49 +0000)]
[analyzer] Refactor: address Jordan’s code review of r181738.

(Modifying the checker to record that the values are no longer nil will be done separately.)

llvm-svn: 181744

11 years ago[objc-arc-opts] In the presense of an alloca unconditionally remove RR pairs if and...
Michael Gottesman [Mon, 13 May 2013 23:49:42 +0000 (23:49 +0000)]
[objc-arc-opts] In the presense of an alloca unconditionally remove RR pairs if and only if we are both KnownSafeBU/KnownSafeTD rather than just either or.

In the presense of a block being initialized, the frontend will emit the
objc_retain on the original pointer and the release on the pointer loaded from
the alloca. The optimizer will through the provenance analysis realize that the
two are related (albiet different), but since we only require KnownSafe in one
direction, will match the inner retain on the original pointer with the guard
release on the original pointer. This is fixed by ensuring that in the presense
of allocas we only unconditionally remove pointers if both our retain and our
release are KnownSafe (i.e. we are KnownSafe in both directions) since we must
deal with the possibility that the frontend will emit what (to the optimizer)
appears to be unbalanced retain/releases.

An example of the miscompile is:

  %A = alloca
  retain(%x)
  retain(%x) <--- Inner Retain
  store %x, %A
  %y = load %A
  ... DO STUFF ...
  release(%y)
  call void @use(%x)
  release(%x) <--- Guarding Release

getting optimized to:

  %A = alloca
  retain(%x)
  store %x, %A
  %y = load %A
  ... DO STUFF ...
  release(%y)
  call void @use(%x)

rdar://13750319

llvm-svn: 181743

11 years agoAdding new test cases for inferior crashing.
Andrew Kaylor [Mon, 13 May 2013 23:47:25 +0000 (23:47 +0000)]
Adding new test cases for inferior crashing.

llvm-svn: 181742

11 years agoAdd expression tests for a function in an anonymous namespace.
Matt Kopec [Mon, 13 May 2013 22:00:32 +0000 (22:00 +0000)]
Add expression tests for a function in an anonymous namespace.

llvm-svn: 181741

11 years agoFixing the MSan/compiler-rt build
David Blaikie [Mon, 13 May 2013 21:53:44 +0000 (21:53 +0000)]
Fixing the MSan/compiler-rt build

Patch by Evgieniy Stepanov, review by İsmail Dönmez.

llvm-svn: 181740

11 years agoFix Mac OS X build issue introduced by incorrect using statements
Daniel Malea [Mon, 13 May 2013 21:52:06 +0000 (21:52 +0000)]
Fix Mac OS X build issue introduced by incorrect using statements

llvm-svn: 181739

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

llvm-svn: 181738

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

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

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

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

llvm-svn: 181736

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

llvm-svn: 181735

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

Suppresses an unused-variable warning in -Asserts builds.

llvm-svn: 181733

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

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

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

llvm-svn: 181732

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

llvm-svn: 181731

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

llvm-svn: 181730

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

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

    addiu $rs,imm

The macro is translated as:

    addiu $rs,$rs,imm

Contributer: Vladimir Medic
llvm-svn: 181729

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

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

This fixes pr15429.

llvm-svn: 181728

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

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

llvm-svn: 181727

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

llvm-svn: 181726

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

llvm-svn: 181725

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

llvm-svn: 181724

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

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

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

The test case is reduced from the oggenc application.

llvm-svn: 181723

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

Patch by Mike Sartain.

llvm-svn: 181722

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

llvm-svn: 181721

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

<rdar://problem/13871874>

llvm-svn: 181720

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

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

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

llvm-svn: 181719

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

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

llvm-svn: 181718

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

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

llvm-svn: 181717

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

llvm-svn: 181715

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

llvm-svn: 181714

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

llvm-svn: 181713

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

llvm-svn: 181712

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

llvm-svn: 181711

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

llvm-svn: 181710

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

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

llvm-svn: 181709

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

llvm-svn: 181708

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

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

llvm-svn: 181707

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

llvm-svn: 181706

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

llvm-svn: 181705

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

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

Thanks to Patrik Hägglund for noticing it.

llvm-svn: 181704

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

llvm-svn: 181703

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

llvm-svn: 181702

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

llvm-svn: 181701

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

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

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

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

llvm-svn: 181700

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

llvm-svn: 181699