platform/upstream/llvm.git
11 years agoAdd atomic_sub and atomic_dec builtin functions
Aaron Watry [Fri, 6 Sep 2013 20:20:21 +0000 (20:20 +0000)]
Add atomic_sub and atomic_dec builtin functions

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

11 years agoR600: Add support for LDS atomic subtract
Aaron Watry [Fri, 6 Sep 2013 20:17:42 +0000 (20:17 +0000)]
R600: Add support for LDS atomic subtract

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 190200

11 years agoAdd Intrin.h to the cmake files.
Eric Christopher [Fri, 6 Sep 2013 20:11:28 +0000 (20:11 +0000)]
Add Intrin.h to the cmake files.

llvm-svn: 190199

11 years ago[PECOFF] Fix section alignment bug in ReaderCOFF.
Rui Ueyama [Fri, 6 Sep 2013 20:08:57 +0000 (20:08 +0000)]
[PECOFF] Fix section alignment bug in ReaderCOFF.

Patch by Ron Ofir.

llvm-svn: 190198

11 years agoclang-modernize: Tweak docs after rename
Edwin Vane [Fri, 6 Sep 2013 19:27:19 +0000 (19:27 +0000)]
clang-modernize: Tweak docs after rename

* Removing sphinx warnings about docs not in a toctree.
* Adding more links to cpp11-migrate redirect docs.

llvm-svn: 190195

11 years agoclang-modernize: Update docs with -include/-exclude
Edwin Vane [Fri, 6 Sep 2013 19:26:25 +0000 (19:26 +0000)]
clang-modernize: Update docs with -include/-exclude

-include/-exclude and friends have been marked as hidden options until this
point. This is no longer necessary. Update the docs to describe their effect.

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

llvm-svn: 190194

11 years agoDebug Info: Update testing case.
Manman Ren [Fri, 6 Sep 2013 18:46:30 +0000 (18:46 +0000)]
Debug Info: Update testing case.

DIBuilder now uses an identifier to reference DIType in containing type field of
a DICompositeType (in r190190).

llvm-svn: 190191

11 years agoDebug Info: Use identifier to reference DIType in containing type field of
Manman Ren [Fri, 6 Sep 2013 18:46:00 +0000 (18:46 +0000)]
Debug Info: Use identifier to reference DIType in containing type field of
a DICompositeType.

Verifier is updated accordingly.

llvm-svn: 190190

11 years agoDebug Info: Move a helper function getTypeIdentifier from DIBuilder to be part
Manman Ren [Fri, 6 Sep 2013 18:27:00 +0000 (18:27 +0000)]
Debug Info: Move a helper function getTypeIdentifier from DIBuilder to be part
of DIType.

Implement DIType::generateRef to return a type reference. This function will be
used in setContaintingType and in DIBuilder to generete the type reference.

No functionality change.

llvm-svn: 190188

11 years agoDebug Info Testing: Updated to use null instead of "i32 0" for containing-type
Manman Ren [Fri, 6 Sep 2013 18:13:59 +0000 (18:13 +0000)]
Debug Info Testing: Updated to use null instead of "i32 0" for containing-type
field of DICompositeType.

This will help the follow-on patch of using DITypeRef for containing-type field.

llvm-svn: 190187

11 years agodebuginfo-tests: Add support for an lldb wrapper script
Adrian Prantl [Fri, 6 Sep 2013 18:12:01 +0000 (18:12 +0000)]
debuginfo-tests: Add support for an lldb wrapper script
to be used on darwin in lieu of gdb.

llvm-svn: 190186

11 years agoAdd an lldb wrapper script that implements gdb-compatible commands on top
Adrian Prantl [Fri, 6 Sep 2013 18:10:44 +0000 (18:10 +0000)]
Add an lldb wrapper script that implements gdb-compatible commands on top
of lldb. This will be the new default method for executing the tests in
this repository on Darwin.
There is also a related patch for llvm/utils/test_debuginfo.pl coming.

I also relaxed some of the checks to work with both gdb's and lldb's
output.

llvm-svn: 190185

11 years agofix typos
Adrian Prantl [Fri, 6 Sep 2013 18:10:42 +0000 (18:10 +0000)]
fix typos

llvm-svn: 190184

11 years agoOpenMP: Data-sharing attributes analysis and clause 'shared' (fixed test threadprivat...
Alexey Bataev [Fri, 6 Sep 2013 18:03:48 +0000 (18:03 +0000)]
OpenMP: Data-sharing attributes analysis and clause 'shared' (fixed test threadprivate_messages.cpp)

llvm-svn: 190183

11 years agomi-sched: cleanup register pressure update, remove a FIXME.
Andrew Trick [Fri, 6 Sep 2013 17:32:47 +0000 (17:32 +0000)]
mi-sched: cleanup register pressure update, remove a FIXME.

llvm-svn: 190181

11 years agomi-sched: improve regpressure tracing.
Andrew Trick [Fri, 6 Sep 2013 17:32:44 +0000 (17:32 +0000)]
mi-sched: improve regpressure tracing.

llvm-svn: 190180

11 years agomi-sched: print tree size in -view-misched-dags
Andrew Trick [Fri, 6 Sep 2013 17:32:42 +0000 (17:32 +0000)]
mi-sched: print tree size in -view-misched-dags

llvm-svn: 190179

11 years agomi-sched: register pressure update tracing.
Andrew Trick [Fri, 6 Sep 2013 17:32:39 +0000 (17:32 +0000)]
mi-sched: register pressure update tracing.

llvm-svn: 190178

11 years agomi-sched: Reorder Cyclicpath (latency) and CriticalMax (pressure) heuristics.
Andrew Trick [Fri, 6 Sep 2013 17:32:36 +0000 (17:32 +0000)]
mi-sched: Reorder Cyclicpath (latency) and CriticalMax (pressure) heuristics.

The latency based scheduling could induce spills in some cases.

llvm-svn: 190177

11 years agoAdded MachineSchedPolicy.
Andrew Trick [Fri, 6 Sep 2013 17:32:34 +0000 (17:32 +0000)]
Added MachineSchedPolicy.

Allow subtargets to customize the generic scheduling strategy.
This is convenient for targets that don't need to add new heuristics
by specializing the strategy.

llvm-svn: 190176

11 years agoDon't remove trailing escaped newline from line comments.
Alexander Kornienko [Fri, 6 Sep 2013 17:24:54 +0000 (17:24 +0000)]
Don't remove trailing escaped newline from line comments.

llvm-svn: 190175

11 years agomsbuild integration: provide separate files for VS2010 and VS2012
Hans Wennborg [Fri, 6 Sep 2013 17:05:46 +0000 (17:05 +0000)]
msbuild integration: provide separate files for VS2010 and VS2012

The previous msbuild integration only worked if VS2010 was installed. This patch
renames the current integration to LLVM-vs2010 and adds LLVM-vs2012.

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

llvm-svn: 190173

11 years agor189295 inadvertently set the codesigning identity for the debugserver Debug configur...
Jim Ingham [Fri, 6 Sep 2013 16:54:45 +0000 (16:54 +0000)]
r189295 inadvertently set the codesigning identity for the debugserver Debug configuration
to "", which causes debugging to fail for that configuration.  Setting it back to lldb_codesign.

llvm-svn: 190172

11 years agoRemove unused method Job::AddCommand.
Hans Wennborg [Fri, 6 Sep 2013 16:48:57 +0000 (16:48 +0000)]
Remove unused method Job::AddCommand.

I was going to update the comment referring to PipedJob, which was removed
some time ago, but then it turned out that this method is not actually used
at all.

llvm-svn: 190171

11 years agoavoid unnecessary direct access to LiveInterval::ranges
Matthias Braun [Fri, 6 Sep 2013 16:44:32 +0000 (16:44 +0000)]
avoid unnecessary direct access to LiveInterval::ranges

llvm-svn: 190170

11 years agoremove unused argument from LiveRanges::join()
Matthias Braun [Fri, 6 Sep 2013 16:44:29 +0000 (16:44 +0000)]
remove unused argument from LiveRanges::join()

llvm-svn: 190169

11 years agoremove pointless assert
Matthias Braun [Fri, 6 Sep 2013 16:44:27 +0000 (16:44 +0000)]
remove pointless assert

The if above it ensures the property anyway.

llvm-svn: 190168

11 years agofix comment
Matthias Braun [Fri, 6 Sep 2013 16:44:25 +0000 (16:44 +0000)]
fix comment

There's no 'B3' in the example.

llvm-svn: 190167

11 years agofix typo in comment
Matthias Braun [Fri, 6 Sep 2013 16:19:22 +0000 (16:19 +0000)]
fix typo in comment

llvm-svn: 190165

11 years ago[analyzer] SATestBuild: strip trailing newlines from command file.
Jordan Rose [Fri, 6 Sep 2013 16:12:41 +0000 (16:12 +0000)]
[analyzer] SATestBuild: strip trailing newlines from command file.

When running a make-based command, SATestBuild tries to append a -jN flag
with an appropriate N to run the build in parallel. However, it failed
to take into account that each line read includes a trailing newline
(unless it is the last line of a file without a trailing newline), which
resulted in the "-jN" appearing on a line on its own.

llvm-svn: 190164

11 years agoFollow up on commit r190159. Also test the KFreeBSD i686 platform defines + minor...
Sylvestre Ledru [Fri, 6 Sep 2013 15:36:36 +0000 (15:36 +0000)]
Follow up on commit r190159. Also test the KFreeBSD i686 platform defines + minor cosmetics

llvm-svn: 190162

11 years ago[sanitizer] Avoid including any system headers in the system-header-free part of...
Evgeniy Stepanov [Fri, 6 Sep 2013 15:34:17 +0000 (15:34 +0000)]
[sanitizer] Avoid including any system headers in the system-header-free part of the runtime library.

llvm-svn: 190161

11 years ago[sanitizer] Fix Android build.
Evgeniy Stepanov [Fri, 6 Sep 2013 14:58:49 +0000 (14:58 +0000)]
[sanitizer] Fix Android build.

Android actually has "__unused" macro defined in <cdefs.h>.

llvm-svn: 190160

11 years agoAdd a test for the KFreeBSD define (#define __FreeBSD_kernel__ 1). This was introduce...
Sylvestre Ledru [Fri, 6 Sep 2013 14:53:07 +0000 (14:53 +0000)]
Add a test for the KFreeBSD define (#define __FreeBSD_kernel__ 1). This was introduced in commit r190048

llvm-svn: 190159

11 years agoclang-modernize: Remove -headers option
Edwin Vane [Fri, 6 Sep 2013 14:23:56 +0000 (14:23 +0000)]
clang-modernize: Remove -headers option

clang-modernize can now transform headers properly and the experimental
-headers option is no longer necessary.

Remember, at least -include is necessary for indicating which headers
are allowed to be changed.

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

llvm-svn: 190158

11 years ago[sanitizer] A bunch of linux system call handlers.
Evgeniy Stepanov [Fri, 6 Sep 2013 14:20:01 +0000 (14:20 +0000)]
[sanitizer] A bunch of linux system call handlers.

llvm-svn: 190157

11 years ago[mips][msa] Indentation
Daniel Sanders [Fri, 6 Sep 2013 13:25:06 +0000 (13:25 +0000)]
[mips][msa] Indentation

llvm-svn: 190156

11 years ago[mips][msa] Requires<[HasMSA]> is redundant, it is also supplied via inheritance
Daniel Sanders [Fri, 6 Sep 2013 13:15:05 +0000 (13:15 +0000)]
[mips][msa] Requires<[HasMSA]> is redundant, it is also supplied via inheritance

Tested with 'llvm-tblgen -print-records' which outputs identical records before
and after this patch.

llvm-svn: 190155

11 years agoThis patch adds support for microMIPS Multiply and Add/Sub instructions. Test cases...
Vladimir Medic [Fri, 6 Sep 2013 13:08:00 +0000 (13:08 +0000)]
This patch adds support for microMIPS Multiply and Add/Sub instructions. Test cases are included in patch.

llvm-svn: 190154

11 years ago[mips][msa] Made the operand register sets optional for the VEC formats
Daniel Sanders [Fri, 6 Sep 2013 13:01:47 +0000 (13:01 +0000)]
[mips][msa] Made the operand register sets optional for the VEC formats

Their default is to be the same as the result register set.

No functional change

llvm-svn: 190153

11 years agoThis patch adds support for microMIPS Move to/from HI/LO instructions. Test cases...
Vladimir Medic [Fri, 6 Sep 2013 12:53:21 +0000 (12:53 +0000)]
This patch adds support for microMIPS Move to/from HI/LO instructions. Test cases are included in patch.

llvm-svn: 190152

11 years ago[mips][msa] Made the operand register sets optional for the ELM_INSVE formats
Daniel Sanders [Fri, 6 Sep 2013 12:50:52 +0000 (12:50 +0000)]
[mips][msa] Made the operand register sets optional for the ELM_INSVE formats

Their default is to be the same as the result register set.

No functional change

llvm-svn: 190151

11 years ago[mips][msa] Made the operand register sets optional for the 3RF_4RF format
Daniel Sanders [Fri, 6 Sep 2013 12:44:13 +0000 (12:44 +0000)]
[mips][msa] Made the operand register sets optional for the 3RF_4RF format

Their default is to be the same as the result register set.

No functional change

llvm-svn: 190150

11 years agoCorrect logic error found by inspection.
Ed Maste [Fri, 6 Sep 2013 12:43:14 +0000 (12:43 +0000)]
Correct logic error found by inspection.

From Jim's post on the lldb-dev mailing list:

  This code is there as a backstop for when the unwinder drops a frame at
  the beginning of new function/trampoline or whatever.

  In the (older_ctx_is_equivalent == false) case we will see if we are at
  a trampoline function that somebody knows how to get out of, and
  otherwise we will stop.

llvm-svn: 190149

11 years agoThis patch adds support for microMIPS Move Conditional instructions. Test cases are...
Vladimir Medic [Fri, 6 Sep 2013 12:41:17 +0000 (12:41 +0000)]
This patch adds support for microMIPS Move Conditional instructions. Test cases are included in patch.

llvm-svn: 190148

11 years agoSelectionDAG: create correct BooleanContent constants
Tim Northover [Fri, 6 Sep 2013 12:38:12 +0000 (12:38 +0000)]
SelectionDAG: create correct BooleanContent constants

Occasionally DAGCombiner can spot that a SETCC operation is completely
redundant and reduce it to "all true" or "all false". If this happens to a
vector, the value produced has to take account of what a normal comparison
would have produced, which may be an all-1s bitmask.

The fix in SelectionDAG.cpp is tested, however, as far as I can see the code in
TargetLowering.cpp is possibly unreachable and almost certainly irrelevant when
triggered so there are no tests. However, I believe it's still clearly the
right change and may save someone else some hassle if it suddenly becomes
reachable. So I'm doing it anyway.

llvm-svn: 190147

11 years ago[mips][msa] Made the operand register sets optional for the 3RF formats
Daniel Sanders [Fri, 6 Sep 2013 12:32:57 +0000 (12:32 +0000)]
[mips][msa] Made the operand register sets optional for the 3RF formats

Their default is to be the same as the result register set.

No functional change

llvm-svn: 190146

11 years ago[mips][msa] Made the operand register sets optional for the 3R_4R format
Daniel Sanders [Fri, 6 Sep 2013 12:30:43 +0000 (12:30 +0000)]
[mips][msa] Made the operand register sets optional for the 3R_4R format

Their default is to be the same as the result register set.

No functional change

llvm-svn: 190145

11 years agoThis patch adds support for microMIPS disassembler and disassembler make check tests.
Vladimir Medic [Fri, 6 Sep 2013 12:30:36 +0000 (12:30 +0000)]
This patch adds support for microMIPS disassembler and disassembler make check tests.

llvm-svn: 190144

11 years ago[mips][msa] Made the operand register sets optional for the 2RF format
Daniel Sanders [Fri, 6 Sep 2013 12:28:13 +0000 (12:28 +0000)]
[mips][msa] Made the operand register sets optional for the 2RF format

Their default is to be the same as the result register set.

No functional change

llvm-svn: 190143

11 years ago[mips][msa] Made the operand register sets optional for the I8 format
Daniel Sanders [Fri, 6 Sep 2013 12:25:47 +0000 (12:25 +0000)]
[mips][msa] Made the operand register sets optional for the I8 format

Their default is to be the same as the result register set.

No functional change

llvm-svn: 190142

11 years ago[mips][msa] Made the operand register sets optional for the I5 and SI5 formats
Daniel Sanders [Fri, 6 Sep 2013 12:23:19 +0000 (12:23 +0000)]
[mips][msa] Made the operand register sets optional for the I5 and SI5 formats

Their default is to be the same as the result register set.

No functional change

llvm-svn: 190141

11 years ago[mips][msa] Made the operand register sets optional for the BIT_[BHWD] formats
Daniel Sanders [Fri, 6 Sep 2013 12:10:24 +0000 (12:10 +0000)]
[mips][msa] Made the operand register sets optional for the BIT_[BHWD] formats

Their default is to be the same as the result register set.

No functional change

llvm-svn: 190140

11 years ago[ASan] make the check for NULL more portable.
Alexander Potapenko [Fri, 6 Sep 2013 12:04:37 +0000 (12:04 +0000)]
[ASan] make the check for NULL more portable.

llvm-svn: 190139

11 years ago[SystemZ] Tweak integer comparison code
Richard Sandiford [Fri, 6 Sep 2013 11:51:39 +0000 (11:51 +0000)]
[SystemZ] Tweak integer comparison code

The architecture has many comparison instructions, including some that
extend one of the operands.  The signed comparison instructions use sign
extensions and the unsigned comparison instructions use zero extensions.
In cases where we had a free choice between signed or unsigned comparisons,
we were trying to decide at lowering time which would best fit the available
instructions, taking things like extension type into account.  The code
to do that was getting increasingly hairy and was also making some bad
decisions.  E.g. when comparing the result of two LLCs, it is better to use
CR rather than CLR, since CR can be fused with a branch while CLR can't.

This patch removes the lowering code and instead adds an operand to
integer comparisons to say whether signed comparison is required,
whether unsigned comparison is required, or whether either is OK.
We can then leave the choice of instruction up to the normal isel code.

llvm-svn: 190138

11 years agoFix compiler warning introduced in r190022
Alexey Samsonov [Fri, 6 Sep 2013 11:08:12 +0000 (11:08 +0000)]
Fix compiler warning introduced in r190022

llvm-svn: 190137

11 years agoMigrate ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS to new spelling - ATTRIBUTE_NO_SANITIZE_...
Alexey Samsonov [Fri, 6 Sep 2013 11:07:33 +0000 (11:07 +0000)]
Migrate ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS to new spelling - ATTRIBUTE_NO_SANITIZE_ADDRESS

llvm-svn: 190136

11 years ago[tsan] make calloc crash instead of returning 0 on overflow (controlled by the alloca...
Kostya Serebryany [Fri, 6 Sep 2013 11:04:14 +0000 (11:04 +0000)]
[tsan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)

llvm-svn: 190135

11 years ago[mips][msa] Sorted MSA_BIT_[BHWD]_DESC_BASE into ascending order of element size
Daniel Sanders [Fri, 6 Sep 2013 11:01:38 +0000 (11:01 +0000)]
[mips][msa] Sorted MSA_BIT_[BHWD]_DESC_BASE into ascending order of element size

No functional change

llvm-svn: 190134

11 years ago[mips][msa] Made the operand register sets optional for the 3R format
Daniel Sanders [Fri, 6 Sep 2013 10:59:24 +0000 (10:59 +0000)]
[mips][msa] Made the operand register sets optional for the 3R format

Their default is to be the same as the result register set.

No functional change

llvm-svn: 190133

11 years ago[msan] make calloc crash instead of returning 0 on overflow (controlled by the alloca...
Kostya Serebryany [Fri, 6 Sep 2013 10:58:55 +0000 (10:58 +0000)]
[msan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)

llvm-svn: 190132

11 years ago[mips][msa] Made the InstrItinClass argument optional since it is always NoItinerary...
Daniel Sanders [Fri, 6 Sep 2013 10:55:15 +0000 (10:55 +0000)]
[mips][msa] Made the InstrItinClass argument optional since it is always NoItinerary at the moment.

No functional change

llvm-svn: 190131

11 years ago[SystemZ] Use XC for a memset of 0
Richard Sandiford [Fri, 6 Sep 2013 10:25:07 +0000 (10:25 +0000)]
[SystemZ] Use XC for a memset of 0

llvm-svn: 190130

11 years agoOpenCL allows the (pre/post)-(increment/decrement) operator on integer vector types,
David Tweed [Fri, 6 Sep 2013 09:58:08 +0000 (09:58 +0000)]
OpenCL allows the (pre/post)-(increment/decrement) operator on integer vector types,
so allow that case and add appropriate tests.

Patch by Ruiling Song!

llvm-svn: 190129

11 years ago[asan] make calloc crash instead of returning 0 on overflow (controlled by the alloca...
Kostya Serebryany [Fri, 6 Sep 2013 09:51:50 +0000 (09:51 +0000)]
[asan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)

llvm-svn: 190128

11 years ago[sanitizer] make the allocator crash instead of returning 0 on huge size (controlled...
Kostya Serebryany [Fri, 6 Sep 2013 09:25:11 +0000 (09:25 +0000)]
[sanitizer] make the allocator crash instead of returning 0 on huge size (controlled by the allocator_may_return_null flag)

llvm-svn: 190127

11 years agoclang-format: Fix regression introduced by r189353.
Daniel Jasper [Fri, 6 Sep 2013 08:54:24 +0000 (08:54 +0000)]
clang-format: Fix regression introduced by r189353.

Before:
  FirstToken->WhitespaceRange.getBegin()
      .getLocWithOffset(First->LastNewlineOffset);

After:
  FirstToken->WhitespaceRange.getBegin().getLocWithOffset(
      First->LastNewlineOffset);

Re-add logic to prevent breaking after an empty set of parentheses.
Basically it seems that calling a function without parameters is more
like navigating along the same object than it is a separate step of a
builder-type call.

We might need to extends this in future to allow "short" parameters that
e.g. are an index accessing a specific element.

llvm-svn: 190126

11 years agoAvoid double edges when constructing CFGs
Pavel Labath [Fri, 6 Sep 2013 08:12:48 +0000 (08:12 +0000)]
Avoid double edges when constructing CFGs

Summary:
If a noreturn destructor is executed while returning a value from a function,
the resulting CFG has had two edges to the exit block. This crashed the analyzer,
because it expects that blocks with no terminators have only one outgoing edge.
I added code to avoid creating the second edge in this case.

PS: The crashes did not manifest themselves always, as usually the
NoReturnFunctionChecker would stop program evaluation before the analyzer hit
the assertion, but in the case of lifetime extended temporaries, the checker
failed to do that (which is a separate bug in itself).

Reviewers: jordan_rose

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

llvm-svn: 190125

11 years agoclang-format: Fix regression introduced by r189337.
Daniel Jasper [Fri, 6 Sep 2013 08:08:14 +0000 (08:08 +0000)]
clang-format: Fix regression introduced by r189337.

Before:
  if (aaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaa(
          aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) == 5) ...

After:
  if (aaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaa(
          aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      == 5) ...

Also precompute startsBinaryExpression() to improve performance.

llvm-svn: 190124

11 years agoclang-format: Fix comment formatting bugs in nested blocks.
Daniel Jasper [Fri, 6 Sep 2013 07:54:20 +0000 (07:54 +0000)]
clang-format: Fix comment formatting bugs in nested blocks.

This fixes two issues:
1) The indent of a line comment was not adapted to the subsequent
   statement as it would be outside of a nested block.
2) A missing DryRun flag caused actualy breaks to be inserted in
   overly long comments while trying to come up with the best line
   breaking decisions.

llvm-svn: 190123

11 years agoPR17046, PR17092: Debug Info assert-on-valid due to member loss when context creation...
David Blaikie [Fri, 6 Sep 2013 06:45:04 +0000 (06:45 +0000)]
PR17046, PR17092: Debug Info assert-on-valid due to member loss when context creation recreates the item the context is created for

By removing the possibility of strange partial definitions with no
members that older GCC's produced for the otherwise unreferenced outer
types of referenced inner types, we can simplify debug info generation
and correct this bug. Newer (4.8.1 and ToT) GCC's don't produce this
quirky debug info, and instead produce the full definition for the outer
type (except in the case where that type is dynamic and its vtable is
not emitted in this TU).

During the creation of the context for a type, we may revisit that type
(due to the need to visit template parameters, among other things) and
used to end up visiting it first there. Then when we would reach the
original code attempting to define that type, we would lose debug info
by overwriting its members.

By avoiding the possibility of latent "defined with no members" types,
we can be sure than whenever we already have a type in a cache (either a
definition or declaration), we can just return that. In the case of a
full definition, our work is done. In the case of a partial definition,
we must already be in the process of completing it. And in the case of a
declaration, the completed/vtable/etc callbacks can handle converting it
to a definition.

llvm-svn: 190122

11 years ago[PECOFF] Add /machine command line option.
Rui Ueyama [Fri, 6 Sep 2013 04:17:07 +0000 (04:17 +0000)]
[PECOFF] Add /machine command line option.

llvm-svn: 190121

11 years ago[PECOFF] Align section contents as specified by the object file's section header.
Rui Ueyama [Fri, 6 Sep 2013 04:06:58 +0000 (04:06 +0000)]
[PECOFF] Align section contents as specified by the object file's section header.

llvm-svn: 190120

11 years agoRemove extraneous parentheses.
Rui Ueyama [Fri, 6 Sep 2013 03:16:28 +0000 (03:16 +0000)]
Remove extraneous parentheses.

llvm-svn: 190119

11 years agoAdd self-comparison warnings for fields.
Eli Friedman [Fri, 6 Sep 2013 03:13:09 +0000 (03:13 +0000)]
Add self-comparison warnings for fields.

This expands very slightly what -Wtautological-compare considers to be
tautological to include implicit accesses to C++ fields and ObjC ivars.
I don't want to turn this into a full expression-identity check, but
these additions seem pretty well-contained, and maintain the theme
of checking for "x == x".

<rdar://problem/14431127>

llvm-svn: 190118

11 years agoReturn early to simplify.
Rui Ueyama [Fri, 6 Sep 2013 01:48:19 +0000 (01:48 +0000)]
Return early to simplify.

llvm-svn: 190117

11 years agoConsumed Analysis: The 'consumable' attribute now takes a identifier specifying the...
David Blaikie [Fri, 6 Sep 2013 01:28:43 +0000 (01:28 +0000)]
Consumed Analysis: The 'consumable' attribute now takes a identifier specifying the default assumed state for objects of this class

This information is used for return states and pass-by-value parameter
states.

Patch by Chris Wailes.

Review by DeLesley Hutchins and Aaron Ballman.

llvm-svn: 190116

11 years agoWhen creating an implicit conversion sequence for a reference of type T from an
Richard Smith [Fri, 6 Sep 2013 01:22:42 +0000 (01:22 +0000)]
When creating an implicit conversion sequence for a reference of type T from an
initializer list containing a single element of type T, be sure to mark the
sequence as a list conversion sequence so that it is known to be worse than an
implicit conversion sequence that initializes a std::initializer_list object.

llvm-svn: 190115

11 years agoReduce stack usage of TreeTransform.
Eli Friedman [Fri, 6 Sep 2013 01:13:30 +0000 (01:13 +0000)]
Reduce stack usage of TreeTransform.

Without this patch, TreeTransform::TransformExpr uses a ridiculous amount of
stack space (around 5000 bytes).  Preventing inlining brings the stack usage
down to something sane.

On a testcase I have, on my computer, this allows changing -ftemplate-depth
from 210 to around 750 before we crash.  I'm not sure I should commit the
testcase, though: I don't want to cause test failures on platforms with less
stack space available.

<rdar://problem/14098189>.

llvm-svn: 190114

11 years agoUse type helper functions.
Matt Arsenault [Fri, 6 Sep 2013 00:37:24 +0000 (00:37 +0000)]
Use type helper functions.

llvm-svn: 190113

11 years agoTeach CodeGenPrepare about address spaces
Matt Arsenault [Fri, 6 Sep 2013 00:18:43 +0000 (00:18 +0000)]
Teach CodeGenPrepare about address spaces

llvm-svn: 190112

11 years agoC++11 attributes after 'constructor-name (' unambiguously signal that we have a
Richard Smith [Fri, 6 Sep 2013 00:12:20 +0000 (00:12 +0000)]
C++11 attributes after 'constructor-name (' unambiguously signal that we have a
constructor.

llvm-svn: 190111

11 years agoR600: Coding style
Tom Stellard [Thu, 5 Sep 2013 23:55:13 +0000 (23:55 +0000)]
R600: Coding style

llvm-svn: 190110

11 years agoImprove error for "override" + non-virtual func.
Eli Friedman [Thu, 5 Sep 2013 23:51:03 +0000 (23:51 +0000)]
Improve error for "override" + non-virtual func.

Consider something like the following:

struct X {
  virtual void foo(float x);
};
struct Y : X {
  void foo(double x) override;
};

The error is almost certainly that Y::foo() has the wrong signature,
rather than incorrect usage of the override keyword.  This patch
adds an appropriate diagnostic for that case.

Fixes <rdar://problem/14785106>.

llvm-svn: 190109

11 years agoAdd a bit more info to modules fatal error.
Eli Friedman [Thu, 5 Sep 2013 23:50:58 +0000 (23:50 +0000)]
Add a bit more info to modules fatal error.

Just a minor tweak to make it easier to track down the cause of fatal errors
with modules.

llvm-svn: 190108

11 years agoPlace pkg-config file in $prefix/share/pkgconfig.
Tom Stellard [Thu, 5 Sep 2013 23:27:58 +0000 (23:27 +0000)]
Place pkg-config file in $prefix/share/pkgconfig.

libclc is ABI-agnostic, and $prefix/lib/pkgconfig causes issues
on multilib setups. Using $prefix/share/pkgconfig allows us to reuse
a single libclc build across all system ABIs.

Patch by: Michał Górny

llvm-svn: 190107

11 years agoObjectiveC migrator: tighten the rules for when
Fariborz Jahanian [Thu, 5 Sep 2013 23:04:33 +0000 (23:04 +0000)]
ObjectiveC migrator: tighten the rules for when
inferring NS_RETURNS_RETAINED, etc., return annotations.
Do not infer if these annotations are implicit
from the naming convention. Also add inference for
NS_CONSUMES_SELF annotation.

llvm-svn: 190106

11 years ago[X86] Perform VSELECT DAG combines also before DAG type legalization.
Juergen Ributzka [Thu, 5 Sep 2013 23:02:56 +0000 (23:02 +0000)]
[X86] Perform VSELECT DAG combines also before DAG type legalization.

If the DAG already has only legal types, then the second round of DAG combines
is skipped. In this case VSELECT+SETCC patterns that match a more efficient
instruction (e.g. min/max) are never recognized.

This fix allows VSELECT+SETCC combines if the types are already legal before DAG
type legalization.

Reviewer: Nadav
llvm-svn: 190105

11 years agoRe-enable TestRegisters and TestTargetWatchAddress on Linux
Daniel Malea [Thu, 5 Sep 2013 21:51:01 +0000 (21:51 +0000)]
Re-enable TestRegisters and TestTargetWatchAddress on Linux
- TestRegisters passes locally (llvm.org/pr16301 no longer reproduces) -- verifying this on buildbots
- TestTargetWatchAddress also passes locally, and referenced llvm.org/pr14323 which is now closed

llvm-svn: 190104

11 years agoRestore -- "end of args" marker for shell
Ed Maste [Thu, 5 Sep 2013 21:38:45 +0000 (21:38 +0000)]
Restore -- "end of args" marker for shell

I accidentally dropped this in r189879 in the change from /bin/bash to
/bin/sh.

llvm-svn: 190103

11 years agomanual: Fix RST reference to MS extension support
Reid Kleckner [Thu, 5 Sep 2013 21:29:35 +0000 (21:29 +0000)]
manual: Fix RST reference to MS extension support

llvm-svn: 190101

11 years agoFix minor bugs in TestExprs and TestAliases to fix buildbot breakage
Daniel Malea [Thu, 5 Sep 2013 21:24:14 +0000 (21:24 +0000)]
Fix minor bugs in TestExprs and TestAliases to fix buildbot breakage
- 'run' alias no longer includes the '--' for positional arguments... does not seem like a real bug.
- 2.234f is not a great number for the float tests (due to precision/printing issues) so use 0.5f instead

llvm-svn: 190100

11 years agoFixed a crash in the integrated assembler for Mach-O when a symbol difference
Kevin Enderby [Thu, 5 Sep 2013 20:25:06 +0000 (20:25 +0000)]
Fixed a crash in the integrated assembler for Mach-O when a symbol difference
expression uses an assembler temporary symbol from an assignment.  In this case
the symbol does not have a fragment so the use of getFragment() would be NULL
and caused a crash. In the case of an assembler temporary symbol we want to use
the AliasedSymbol (if any) which will create a local relocation entry, but if
it is not an assembler temporary symbol then let it use that symbol with an
external relocation entry.

rdar://9356266

llvm-svn: 190096

11 years agoRemove unused identifiers.
Rui Ueyama [Thu, 5 Sep 2013 20:21:24 +0000 (20:21 +0000)]
Remove unused identifiers.

llvm-svn: 190095

11 years agoFix regression from r190016.
Eli Friedman [Thu, 5 Sep 2013 20:13:32 +0000 (20:13 +0000)]
Fix regression from r190016.

I don't have a reduced testcase yet.

llvm-svn: 190094

11 years agoConsistently use dbgs() in debug printing
Matt Arsenault [Thu, 5 Sep 2013 19:48:28 +0000 (19:48 +0000)]
Consistently use dbgs() in debug printing

llvm-svn: 190093

11 years agoTrying to un-break the bots.
Manman Ren [Thu, 5 Sep 2013 19:44:52 +0000 (19:44 +0000)]
Trying to un-break the bots.

llvm-svn: 190092

11 years agoR600: Fix i64 to i32 trunc on SI
Matt Arsenault [Thu, 5 Sep 2013 19:41:10 +0000 (19:41 +0000)]
R600: Fix i64 to i32 trunc on SI

llvm-svn: 190091

11 years agoRemove unused argument.
Rafael Espindola [Thu, 5 Sep 2013 19:15:21 +0000 (19:15 +0000)]
Remove unused argument.

llvm-svn: 190090

11 years agoImprove handling of .file, .include and .incbin directives to
Yunzhong Gao [Thu, 5 Sep 2013 19:14:26 +0000 (19:14 +0000)]
Improve handling of .file, .include and .incbin directives to
allow escaped octal character sequences.

The patch was discussed in Phabricator. See:
http://llvm-reviews.chandlerc.com/D1289

llvm-svn: 190089