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

11 years agoRemove commented out routines.
Jim Ingham [Thu, 5 Sep 2013 19:01:20 +0000 (19:01 +0000)]
Remove commented out routines.

llvm-svn: 190085

11 years agoInclude file cleanup.
Jim Ingham [Thu, 5 Sep 2013 18:57:48 +0000 (18:57 +0000)]
Include file cleanup.

llvm-svn: 190084

11 years agoInclude file cleanup. SymbolContext doesn’t need ClangASTType.h, Block.h did, and...
Jim Ingham [Thu, 5 Sep 2013 18:55:21 +0000 (18:55 +0000)]
Include file cleanup.  SymbolContext doesn’t need ClangASTType.h, Block.h did, and was getting it under the table from SymbolContext.h.

llvm-svn: 190083

11 years agoDebug Info: Update testing case.
Manman Ren [Thu, 5 Sep 2013 18:51:02 +0000 (18:51 +0000)]
Debug Info: Update testing case.

DIBuilder now uses an identifier to reference DIType in base type field of
ptr_to_member (in r190081).

llvm-svn: 190082

11 years agoDebug Info: Use identifier to reference DIType in base type field of
Manman Ren [Thu, 5 Sep 2013 18:48:31 +0000 (18:48 +0000)]
Debug Info: Use identifier to reference DIType in base type field of
ptr_to_member.

We introduce a new class DITypeRef that represents a reference to a DIType.
It wraps around a Value*, which can be either an identifier in MDString
or an actual MDNode. The class has a helper function "resolve" that
finds the actual MDNode for a given DITypeRef.

We specialize getFieldAs to return a field that is a reference to a
DIType. To correctly access the base type field of ptr_to_member,
getClassType now calls getFieldAs<DITypeRef> to return a DITypeRef.

Also add a typedef for DITypeIdentifierMap and a helper
generateDITypeIdentifierMap in DebugInfo.h. In DwarfDebug.cpp, we keep
a DITypeIdentifierMap and call generateDITypeIdentifierMap to actually
populate the map.

Verifier is updated accordingly.

llvm-svn: 190081

11 years agoR600: Add support for local memory atomic add
Tom Stellard [Thu, 5 Sep 2013 18:38:09 +0000 (18:38 +0000)]
R600: Add support for local memory atomic add

llvm-svn: 190080

11 years agoR600: Expand SELECT nodes rather than custom lowering them
Tom Stellard [Thu, 5 Sep 2013 18:38:03 +0000 (18:38 +0000)]
R600: Expand SELECT nodes rather than custom lowering them

llvm-svn: 190079

11 years agoR600: Fix incorrect LDS size calculation
Tom Stellard [Thu, 5 Sep 2013 18:37:57 +0000 (18:37 +0000)]
R600: Fix incorrect LDS size calculation

GlobalAdderss nodes that appeared in more than one basic block were
being counted twice.

llvm-svn: 190078

11 years agoR600/SI: Don't emit S_WQM_B64 instruction for compute shaders
Tom Stellard [Thu, 5 Sep 2013 18:37:52 +0000 (18:37 +0000)]
R600/SI: Don't emit S_WQM_B64 instruction for compute shaders

llvm-svn: 190077

11 years agoR600: Fix segfault in R600TextureIntrinsicReplacer
Tom Stellard [Thu, 5 Sep 2013 18:37:45 +0000 (18:37 +0000)]
R600: Fix segfault in R600TextureIntrinsicReplacer

This pass was segfaulting when it ran into a non-intrinsic function
call.  Function calls are not supported, so now instead of segfaulting,
we will get an assertion failure with a nice error message.

I'm not sure how to test this using lit.

llvm-svn: 190076

11 years agoUnbreak build with libc++, whose std::list<T> requires T to be complete.
Douglas Gregor [Thu, 5 Sep 2013 18:28:53 +0000 (18:28 +0000)]
Unbreak build with libc++, whose std::list<T> requires T to be complete.

llvm-svn: 190075

11 years agoMove accelerator table defines and constants to Dwarf.h since
Eric Christopher [Thu, 5 Sep 2013 18:20:16 +0000 (18:20 +0000)]
Move accelerator table defines and constants to Dwarf.h since
we're proposing it for DWARF5.

No functional change intended.

llvm-svn: 190074

11 years agoMark lambda closure classes as being implicitly-generated.
James Dennett [Thu, 5 Sep 2013 17:46:21 +0000 (17:46 +0000)]
Mark lambda closure classes as being implicitly-generated.

Summary: Closure classes for C++ lambdas are always compiler-generated.  This one-line change calls setImplicit(true) on them at creation time, such that a default RecursiveASTVisitor (or any for which shouldVisitImplicitCode returns false) will skip them.

Reviewers: rsmith, dblaikie

Reviewed By: dblaikie

CC: klimek, revane, cfe-commits, jordan_rose
Differential Revision: http://llvm-reviews.chandlerc.com/D1593

llvm-svn: 190073

11 years agoObjectiveC modern translator: fix up generated fast enumeration
Fariborz Jahanian [Thu, 5 Sep 2013 17:17:32 +0000 (17:17 +0000)]
ObjectiveC modern translator: fix up generated fast enumeration
code to work for bit 32bit and 64bit APIs.
// rdar://14913632

llvm-svn: 190072

11 years agoclang-cl: Use .obj as extension for unnamed object files (PR17095)
Hans Wennborg [Thu, 5 Sep 2013 17:05:56 +0000 (17:05 +0000)]
clang-cl: Use .obj as extension for unnamed object files (PR17095)

We already use .obj as extension when the user provides a stem file
name (via /Fo), but were failing in the most basic case when the file
name is based on the input file.

llvm-svn: 190071

11 years agoUse getwd(0) on FreeBSD as on OS X.
Ed Maste [Thu, 5 Sep 2013 17:05:37 +0000 (17:05 +0000)]
Use getwd(0) on FreeBSD as on OS X.

llvm-svn: 190070

11 years agoOptionValueProperties::DeepCopy (): return empty value to avoid compilation error...
Virgile Bello [Thu, 5 Sep 2013 16:57:48 +0000 (16:57 +0000)]
OptionValueProperties::DeepCopy (): return empty value to avoid compilation error on MSVC (even if assert).

llvm-svn: 190069

11 years agoAdded MSVC config file and makefile support.
Virgile Bello [Thu, 5 Sep 2013 16:56:12 +0000 (16:56 +0000)]
Added MSVC config file and makefile support.

llvm-svn: 190068

11 years agoRename enums to match convention and remove superfluous "dwarf" in names.
Eric Christopher [Thu, 5 Sep 2013 16:55:35 +0000 (16:55 +0000)]
Rename enums to match convention and remove superfluous "dwarf" in names.

llvm-svn: 190067

11 years agoAvoid ambiguity between pid_t and lldb::pid_t.
Virgile Bello [Thu, 5 Sep 2013 16:53:14 +0000 (16:53 +0000)]
Avoid ambiguity between pid_t and lldb::pid_t.

llvm-svn: 190066

11 years agoMinGW: avoid many warnings due to FAR/NEAR defines.
Virgile Bello [Thu, 5 Sep 2013 16:51:17 +0000 (16:51 +0000)]
MinGW: avoid many warnings due to FAR/NEAR defines.

llvm-svn: 190065

11 years agoReformat.
Eric Christopher [Thu, 5 Sep 2013 16:46:43 +0000 (16:46 +0000)]
Reformat.

llvm-svn: 190064

11 years agoAdd OptionParser.h
Virgile Bello [Thu, 5 Sep 2013 16:42:23 +0000 (16:42 +0000)]
Add OptionParser.h

llvm-svn: 190063

11 years agoUse <atomic> instead of "llvm/Support/Atomic.h". Removed unused RefCounter class.
Virgile Bello [Thu, 5 Sep 2013 16:38:02 +0000 (16:38 +0000)]
Use <atomic> instead of "llvm/Support/Atomic.h". Removed unused RefCounter class.

llvm-svn: 190062

11 years agoAdd ATTRIBUTE_UNUSED to silence unused-function warning in release
Daniel Jasper [Thu, 5 Sep 2013 16:05:56 +0000 (16:05 +0000)]
Add ATTRIBUTE_UNUSED to silence unused-function warning in release
builds.

llvm-svn: 190061

11 years ago[ARMv8] Add some missing tests for DSB/DMB.
Joey Gouly [Thu, 5 Sep 2013 16:05:45 +0000 (16:05 +0000)]
[ARMv8] Add some missing tests for DSB/DMB.

llvm-svn: 190060

11 years agoRemove unneeded semi-colons
Aaron Watry [Thu, 5 Sep 2013 16:04:07 +0000 (16:04 +0000)]
Remove unneeded semi-colons

Reviewed-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 190059

11 years agoAdd atomic_inc and atomic_add builtins
Aaron Watry [Thu, 5 Sep 2013 16:04:01 +0000 (16:04 +0000)]
Add atomic_inc and atomic_add builtins

Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 190058

11 years agosysctl.h does not exist under GNU/HURD (like windows)
Sylvestre Ledru [Thu, 5 Sep 2013 15:39:09 +0000 (15:39 +0000)]
sysctl.h does not exist under GNU/HURD (like windows)

llvm-svn: 190057

11 years agoGNU HURD can be considered (for now?) like a GNU/Linux
Sylvestre Ledru [Thu, 5 Sep 2013 15:37:36 +0000 (15:37 +0000)]
GNU HURD can be considered (for now?) like a GNU/Linux

llvm-svn: 190056

11 years ago[ARMv8] Implement the new DMB/DSB operands.
Joey Gouly [Thu, 5 Sep 2013 15:35:24 +0000 (15:35 +0000)]
[ARMv8] Implement the new DMB/DSB operands.

This removes the custom ISD Node: MEMBARRIER and replaces it
with an intrinsic.

llvm-svn: 190055

11 years agoFixes PR 17106 (explicitly typed enums are formatted differently).
Manuel Klimek [Thu, 5 Sep 2013 15:34:55 +0000 (15:34 +0000)]
Fixes PR 17106 (explicitly typed enums are formatted differently).

Before:
 enum X : int { A, B, C };

After:
 enum X : int {
   A,
   B,
   C
 };

llvm-svn: 190054

11 years agoAdd AArch32 DCPS{1,2,3} and HLT instructions.
Richard Barton [Thu, 5 Sep 2013 14:14:19 +0000 (14:14 +0000)]
Add AArch32 DCPS{1,2,3} and HLT instructions.

These were pretty straightforward instructions, with some assembly support
required for HLT.

The ARM assembler is keen to split the instruction mnemonic into a
(non-existent) 'H' instruction with the LT condition code. An exception for
HLT is needed.

HLT follows the same rules as BKPT when in IT blocks, so the special BKPT
hadling code has been adapted to handle HLT also.

Regression tests added including diagnostic tests for out of range immediates
and illegal condition codes, as well as negative tests for pre-ARMv8.

llvm-svn: 190053

11 years agoHandle zero-width and double-width characters in string literals and comments.
Alexander Kornienko [Thu, 5 Sep 2013 14:08:34 +0000 (14:08 +0000)]
Handle zero-width and double-width characters in string literals and comments.

Summary:
Count column width instead of the number of code points. This also
includes correct handling of tabs inside string literals and comments (with an
exception of multiline string literals/comments, where tabs are present before
the first escaped newline).

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1601

llvm-svn: 190052

11 years agoFix the profile of the function (fix commit 190048)
Sylvestre Ledru [Thu, 5 Sep 2013 13:58:07 +0000 (13:58 +0000)]
Fix the profile of the function (fix commit 190048)

llvm-svn: 190051

11 years agoFix writing of reformatted files.
Manuel Klimek [Thu, 5 Sep 2013 13:55:39 +0000 (13:55 +0000)]
Fix writing of reformatted files.

If transformations lead to changes that do not need reformatting, the
current strategy will not write those files. With this patch, we just
update the overall state with the changes due to reformatting, and then
write out everything.

llvm-svn: 190050

11 years agoRemoved empty directories left after r189960.
Alexander Kornienko [Thu, 5 Sep 2013 13:47:10 +0000 (13:47 +0000)]
Removed empty directories left after r189960.

llvm-svn: 190049

11 years agoFix bug #17104 - Target info for GNU/kFreeBSD were missing.
Sylvestre Ledru [Thu, 5 Sep 2013 13:47:07 +0000 (13:47 +0000)]
Fix bug #17104 - Target info for GNU/kFreeBSD were missing.
As a result, Clang doesn't define the pre-processor macros that are expected
on this platform.

Thanks to Robert Millan for the patch

llvm-svn: 190048

11 years agoReverting 190043 for now.
Tilmann Scheller [Thu, 5 Sep 2013 11:59:43 +0000 (11:59 +0000)]
Reverting 190043 for now.

Solution is not sufficient to prevent 'mov pc, lr' being emitted for jump table code.
Test case doesn't trigger the added functionality.

llvm-svn: 190047

11 years agoclang-format: Quickfix for braced init lists detected as lambdas.
Daniel Jasper [Thu, 5 Sep 2013 11:49:39 +0000 (11:49 +0000)]
clang-format: Quickfix for braced init lists detected as lambdas.

Before:
  constexpr char hello [] { "hello" };

After:
  constexpr char hello[]{ "hello" };

llvm-svn: 190046

11 years ago[tsan] add colors to tsan output
Kostya Serebryany [Thu, 5 Sep 2013 11:23:27 +0000 (11:23 +0000)]
[tsan] add colors to tsan output

llvm-svn: 190045