platform/upstream/llvm.git
11 years agoImplement N3760, support for the [[deprecated]] attribute.
Chandler Carruth [Fri, 27 Sep 2013 20:20:17 +0000 (20:20 +0000)]
Implement N3760, support for the [[deprecated]] attribute.

This motion appears to have consensus in the C++ committee and is
expected to be voted into the C++14 draft tomorrow during the formal
vote.

No extension warning in C++11 as attributes not specified in the
standard using the standard syntax in C++11 have implementation defined
meaning, and we define the meaning proposed for C++14.

There is one bug exposed as we do not warn on a deprecated template
specialization. I've left a FIXME in the test case and will dig into
that next.

Also, I will add a few more exhaustive test cases of the other features
specified for this attribute in a follow-up commit.

llvm-svn: 191550

11 years agoMark variable template implementation as complete. Nearly all of the credit
Richard Smith [Fri, 27 Sep 2013 20:19:41 +0000 (20:19 +0000)]
Mark variable template implementation as complete. Nearly all of the credit
here goes to Larisse Voufo.

llvm-svn: 191549

11 years agoVariable templates: handle instantiation of static data member templates
Richard Smith [Fri, 27 Sep 2013 20:14:12 +0000 (20:14 +0000)]
Variable templates: handle instantiation of static data member templates
appropriately, especially when they appear within class templates.

llvm-svn: 191548

11 years agoComment out links for papers that aren't up yet.
Richard Smith [Fri, 27 Sep 2013 19:55:03 +0000 (19:55 +0000)]
Comment out links for papers that aren't up yet.

llvm-svn: 191547

11 years ago[mips] Rewrite MipsTargetLowering::getAddr functions as template functions.
Akira Hatanaka [Fri, 27 Sep 2013 19:51:35 +0000 (19:51 +0000)]
[mips] Rewrite MipsTargetLowering::getAddr functions as template functions.

No intended functionality change.

llvm-svn: 191546

11 years agoDon't give suggest things like function names on the left side of "=".
Kaelyn Uhrain [Fri, 27 Sep 2013 19:40:16 +0000 (19:40 +0000)]
Don't give suggest things like function names on the left side of "=".

llvm-svn: 191545

11 years agoAvoid the hard-coded limit on the number of typo corrections attempted.
Kaelyn Uhrain [Fri, 27 Sep 2013 19:40:12 +0000 (19:40 +0000)]
Avoid the hard-coded limit on the number of typo corrections attempted.

Move some tests from typo-correction.cpp to typo-correction-pt2.cpp
because they were running afoul of the hard-coded limit of 20 typos
corrected. Some of the tests after it were still working due to the
limit not applying to cached corrections and in cases where a non-NULL
MemberContext is passed in to Sema::CorrectTypo.  Most of the moved tests
still passed after being moved, but the test involving "data_struct" had
only been passing because the test had exceeded that limit so a fix for
it is also included (most of the changes to ParseStmt.cpp are shared with
and originated from another typo correction impovement that was split
into a separate commit).

llvm-svn: 191544

11 years agoCache the location of failed typo corrections so that typo correction
Kaelyn Uhrain [Fri, 27 Sep 2013 19:40:08 +0000 (19:40 +0000)]
Cache the location of failed typo corrections so that typo correction
isn't repeatedly attempted for the same identifier at the same location.

llvm-svn: 191543

11 years agoFix typo: Dellocation.
Benjamin Kramer [Fri, 27 Sep 2013 19:35:09 +0000 (19:35 +0000)]
Fix typo: Dellocation.

llvm-svn: 191542

11 years agoFix formatting goof.
Richard Smith [Fri, 27 Sep 2013 19:12:22 +0000 (19:12 +0000)]
Fix formatting goof.

llvm-svn: 191541

11 years agoUpdate status:
Richard Smith [Fri, 27 Sep 2013 19:11:33 +0000 (19:11 +0000)]
Update status:
 * generic lambdas are now partially supported
 * add papers from formal motions in committee

llvm-svn: 191540

11 years agoAdding intrinsics to the llvm backend for TBM instruction set.
Yunzhong Gao [Fri, 27 Sep 2013 18:38:42 +0000 (18:38 +0000)]
Adding intrinsics to the llvm backend for TBM instruction set.
Phabricator code review is located here: http://llvm-reviews.chandlerc.com/D1750

llvm-svn: 191539

11 years agoTBAA: handle scalar TBAA format and struct-path aware TBAA format.
Manman Ren [Fri, 27 Sep 2013 18:34:27 +0000 (18:34 +0000)]
TBAA: handle scalar TBAA format and struct-path aware TBAA format.

Remove the command line argument "struct-path-tbaa" since we should not depend
on command line argument to decide which format the IR file is using. Instead,
we check the first operand of the tbaa tag node, if it is a MDNode, we treat
it as struct-path aware TBAA format, otherwise, we treat it as scalar TBAA
format.

When clang starts to use struct-path aware TBAA format no matter whether
struct-path-tbaa is no, and we can auto-upgrade existing bc files, the support
for scalar TBAA format can be dropped.

Existing testing cases are updated to use the struct-path aware TBAA format.

llvm-svn: 191538

11 years agoclang-cl: pass /FI options to fallback
Hans Wennborg [Fri, 27 Sep 2013 17:54:18 +0000 (17:54 +0000)]
clang-cl: pass /FI options to fallback

We started parsing /FI in r191442, and now we can pass it on to the
fallback too.

llvm-svn: 191537

11 years agoAdding pre/post conditions for some Replacement handling functions
Edwin Vane [Fri, 27 Sep 2013 17:52:45 +0000 (17:52 +0000)]
Adding pre/post conditions for some Replacement handling functions

The vector version of shiftedCodePosition() requires Replacements to be
in sorted order.

Turned existing comment about sorting for deduplicate() into an exact
post condition.

llvm-svn: 191536

11 years agoSourceManager: Open code isInMainFile.
Benjamin Kramer [Fri, 27 Sep 2013 17:12:50 +0000 (17:12 +0000)]
SourceManager: Open code isInMainFile.

- We really shouldn't compute line numbers for every file that is asked if it's
  the main file, it destroys the lazy computation.
- Invalid locations are no longer accounted to the main file, no other
  functionality change.

llvm-svn: 191535

11 years agoQuick-fix the test for no-asserts build
Timur Iskhodzhanov [Fri, 27 Sep 2013 17:07:56 +0000 (17:07 +0000)]
Quick-fix the test for no-asserts build

llvm-svn: 191534

11 years agoRemove method that always returns true.
Rafael Espindola [Fri, 27 Sep 2013 16:58:26 +0000 (16:58 +0000)]
Remove method that always returns true.

llvm-svn: 191533

11 years ago[analyzer] Allow pre/post-statement checkers for UnaryOperator.
Jordan Rose [Fri, 27 Sep 2013 16:47:52 +0000 (16:47 +0000)]
[analyzer] Allow pre/post-statement checkers for UnaryOperator.

Found by Arthur Yoo.

llvm-svn: 191532

11 years agoFix the test files by removing the unnecessary -emit-llvm flag (should address Matt...
Faisal Vali [Fri, 27 Sep 2013 16:45:48 +0000 (16:45 +0000)]
Fix the test files by removing the unnecessary -emit-llvm flag (should address Matt Beaumont-Gay's concern regarding failure on a read-only filesystem)

llvm-svn: 191531

11 years agoAdded a comment and another test for the UT_ForIndentation option
Alexander Kornienko [Fri, 27 Sep 2013 16:40:11 +0000 (16:40 +0000)]
Added a comment and another test for the UT_ForIndentation option

llvm-svn: 191530

11 years agoUpdated examples of UseTab option
Alexander Kornienko [Fri, 27 Sep 2013 16:19:25 +0000 (16:19 +0000)]
Updated examples of UseTab option

llvm-svn: 191529

11 years agoUpdated clang-format style options doc.
Alexander Kornienko [Fri, 27 Sep 2013 16:16:55 +0000 (16:16 +0000)]
Updated clang-format style options doc.

llvm-svn: 191528

11 years agoImplemented tab usage only for indentation (http://llvm.org/PR17363)
Alexander Kornienko [Fri, 27 Sep 2013 16:14:22 +0000 (16:14 +0000)]
Implemented tab usage only for indentation (llvm.org/PR17363)

Summary:
Changed UseTab to be a enum with three options: Never, Always,
ForIndentation (true/false are still supported when reading .clang-format).
IndentLevel should currently be propagated correctly for all tokens, except for
block comments. Please take a look at the general idea before I start dealing
with block comments.

Reviewers: klimek, djasper

Reviewed By: klimek

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

llvm-svn: 191527

11 years agoTransforms: Use getFirstNonPHI to set the insertion point for PHIs
Justin Bogner [Fri, 27 Sep 2013 15:30:25 +0000 (15:30 +0000)]
Transforms: Use getFirstNonPHI to set the insertion point for PHIs

We were previously using getFirstInsertionPt to insert PHI
instructions when vectorizing, but getFirstInsertionPt also skips past
landingpads, causing this to generate invalid IR.

We can avoid this issue by using getFirstNonPHI instead.

llvm-svn: 191526

11 years ago[SystemZ] Rein back the use of block operations
Richard Sandiford [Fri, 27 Sep 2013 15:29:20 +0000 (15:29 +0000)]
[SystemZ] Rein back the use of block operations

The backend tries to use block operations like MVC, NC, OC and XC for
simple scalar operations.  For correctness reasons, it rejects any case
in which the regions might partially overlap.  However, for performance
reasons, it should also reject cases where the regions might be equal,
since the instruction might then not use the fast path.

This fixes a performance regression seen in bzip2.  We may want to limit
the optimisation even more in future, or even remove it entirely, but I'll
try with this for now.

llvm-svn: 191525

11 years ago[SystemZ] Improve handling of PC-relative addresses
Richard Sandiford [Fri, 27 Sep 2013 15:14:04 +0000 (15:14 +0000)]
[SystemZ] Improve handling of PC-relative addresses

The backend previously folded offsets into PC-relative addresses
whereever possible.  That's the right thing to do when the address
can be used directly in a PC-relative memory reference (using things
like LRL).  But if we have a register-based memory reference and need
to load the PC-relative address separately, it's better to use an anchor
point that could be shared with other accesses to the same area of the
variable.

Fixes a FIXME.

llvm-svn: 191524

11 years agoAbstract out the emission of vtables, add basic support for vtable emission when...
Timur Iskhodzhanov [Fri, 27 Sep 2013 14:48:01 +0000 (14:48 +0000)]
Abstract out the emission of vtables, add basic support for vtable emission when using -cxx-abi microsoft

Reviewed at http://llvm-reviews.chandlerc.com/D1532

llvm-svn: 191523

11 years ago[LSan] Don't report leaks with single-frame stack traces
Alexey Samsonov [Fri, 27 Sep 2013 13:54:20 +0000 (13:54 +0000)]
[LSan] Don't report leaks with single-frame stack traces

llvm-svn: 191522

11 years ago[mips][msa] Implemented insert.d intrinsic.
Daniel Sanders [Fri, 27 Sep 2013 13:36:54 +0000 (13:36 +0000)]
[mips][msa] Implemented insert.d intrinsic.

This intrinsic is lowered into an equivalent INSERT_VECTOR_ELT which is
further lowered into a sequence of insert.w's on MIPS32.

llvm-svn: 191521

11 years agoARM: Teach assembler to enforce constraints for ARM LDRD destination register operands.
Tilmann Scheller [Fri, 27 Sep 2013 13:28:17 +0000 (13:28 +0000)]
ARM: Teach assembler to enforce constraints for ARM LDRD destination register operands.

As specified in A8.8.72/A8.8.73/A8.8.74 in the ARM ARM, all variants of the ARM LDRD instruction have the following two constraints:

LDRD<c> <Rt>, <Rt2>, ...

(a) Rt must be even-numbered and not r14
(b) Rt2 must be R(t+1)

If those two constraints are not met the result of executing the instruction will be unpredictable.

Constraint (b) was already enforced, this commit adds support for constraint (a).

Fixes rdar://14479793.

llvm-svn: 191520

11 years ago[mips][msa] Implemented fill.d intrinsic.
Daniel Sanders [Fri, 27 Sep 2013 13:20:41 +0000 (13:20 +0000)]
[mips][msa] Implemented fill.d intrinsic.

This intrinsic is lowered into an equivalent BUILD_VECTOR which is further
lowered into a sequence of insert.w's on MIPS32.

llvm-svn: 191519

11 years ago[mips][msa] Implemented copy_[us].d intrinsic.
Daniel Sanders [Fri, 27 Sep 2013 13:04:21 +0000 (13:04 +0000)]
[mips][msa] Implemented copy_[us].d intrinsic.

This intrinsic is lowered into equivalent copy_s.w instructions during
legalization.

llvm-svn: 191518

11 years ago[mips][msa] Rename arguments to MSA_INSERT_DESC_BASE to better match their expected...
Daniel Sanders [Fri, 27 Sep 2013 12:45:08 +0000 (12:45 +0000)]
[mips][msa] Rename arguments to MSA_INSERT_DESC_BASE to better match their expected values.

No functional change.

llvm-svn: 191517

11 years ago[sanitizer] Intercept backtrace, backtrace_symbols.
Evgeniy Stepanov [Fri, 27 Sep 2013 12:40:23 +0000 (12:40 +0000)]
[sanitizer] Intercept backtrace, backtrace_symbols.

llvm-svn: 191516

11 years ago[mips][msa] Implemented insert_vector_elt for v4f32 and v2f64.
Daniel Sanders [Fri, 27 Sep 2013 12:31:32 +0000 (12:31 +0000)]
[mips][msa] Implemented insert_vector_elt for v4f32 and v2f64.

For v4f32 and v2f64, INSERT_VECTOR_ELT is matched by a pseudo-insn which is
later expanded to appropriate insve.[wd] insns.

llvm-svn: 191515

11 years ago[mips][msa] Implemented extract_vector_elt for v4f32 or v2f64
Daniel Sanders [Fri, 27 Sep 2013 12:17:32 +0000 (12:17 +0000)]
[mips][msa] Implemented extract_vector_elt for v4f32 or v2f64

For v4f32 and v2f64, EXTRACT_VECTOR_ELT is matched by a pseudo-insn which may
be expanded to subregister copies and/or instructions as appropriate.

llvm-svn: 191514

11 years agoRemove superfluous comment accidentally checked-in.
Andrea Di Biagio [Fri, 27 Sep 2013 12:13:58 +0000 (12:13 +0000)]
Remove superfluous comment accidentally checked-in.

llvm-svn: 191513

11 years ago[mips][msa] Added support for MSA registers to copyPhysReg
Daniel Sanders [Fri, 27 Sep 2013 12:03:51 +0000 (12:03 +0000)]
[mips][msa] Added support for MSA registers to copyPhysReg

llvm-svn: 191512

11 years ago[mips][msa] Added support for matching splati from normal IR (i.e. not intrinsics)
Daniel Sanders [Fri, 27 Sep 2013 11:48:57 +0000 (11:48 +0000)]
[mips][msa] Added support for matching splati from normal IR (i.e. not intrinsics)

Updated some of the vshf since they (correctly) emit splati's now

llvm-svn: 191511

11 years ago[asan] introduce run-time flag uar_stack_size_log to control the size of FakeStack...
Kostya Serebryany [Fri, 27 Sep 2013 11:37:23 +0000 (11:37 +0000)]
[asan] introduce run-time flag uar_stack_size_log to control the size of FakeStack; don't crash when the fake stack is exhausted, move some code to .cc file

llvm-svn: 191510

11 years agoRe-apply the change from r191393 with fix for pr17380.
Andrea Di Biagio [Fri, 27 Sep 2013 11:37:05 +0000 (11:37 +0000)]
Re-apply the change from r191393 with fix for pr17380.

This change fixes the problem reported in pr17380 and re-add the dagcombine
transformation ensuring that the value types are always legal if the
transformation is triggered after Legalization took place.

Added the test case from pr17380.

llvm-svn: 191509

11 years ago[msan] Unpoison argument shadow for C++ module destructors.
Evgeniy Stepanov [Fri, 27 Sep 2013 11:32:21 +0000 (11:32 +0000)]
[msan] Unpoison argument shadow for C++ module destructors.

Fixes PR17377.

llvm-svn: 191508

11 years ago[mips][msa] Added MSA.txt to describe instruction selection quirks.
Daniel Sanders [Fri, 27 Sep 2013 10:42:22 +0000 (10:42 +0000)]
[mips][msa] Added MSA.txt to describe instruction selection quirks.

This file contains notes about the instruction selection for MSA. For example,
it notes that ilvl.d is cannot be selected because ilvev.d covers the same
cases and is selected instead of ilvl.d.

llvm-svn: 191507

11 years agoFirst attempt to import OpenMP runtime
Jim Cownie [Fri, 27 Sep 2013 10:38:44 +0000 (10:38 +0000)]
First attempt to import OpenMP runtime

llvm-svn: 191506

11 years agoFix comment.
Tilmann Scheller [Fri, 27 Sep 2013 10:38:11 +0000 (10:38 +0000)]
Fix comment.

llvm-svn: 191505

11 years agoARM: Teach assembler to enforce constraint for Thumb2 LDRD (literal/immediate) destin...
Tilmann Scheller [Fri, 27 Sep 2013 10:30:18 +0000 (10:30 +0000)]
ARM: Teach assembler to enforce constraint for Thumb2 LDRD (literal/immediate) destination register operands.

LDRD<c> <Rt>, <Rt2>, <label>
LDRD<c> <Rt>, <Rt2>, [<Rn>{, #+/-<imm>}]
LDRD<c> <Rt>, <Rt2>, [<Rn>], #+/-<imm>
LDRD<c> <Rt>, <Rt2>, [<Rn>, #+/-<imm>]!

As specified in A8.8.72/A8.8.73 in the ARM ARM, the T1 encoding has a constraint which enforces that Rt != Rt2.

If this constraint is not met the result of executing the instruction will be unpredictable.

Fixes rdar://14479780.

llvm-svn: 191504

11 years ago[mips][msa] Tidy up
Daniel Sanders [Fri, 27 Sep 2013 10:25:41 +0000 (10:25 +0000)]
[mips][msa] Tidy up

lowerMSABinaryIntr, lowerMSABinaryImmIntr, lowerMSABranchIntr,
and lowerMSAUnaryIntr were trivially small functions. Inlined them into
their callers.

lowerMSASplat now takes its callers SDLoc instead of making a new one.

No functional change.

llvm-svn: 191503

11 years agoCreate directory for OpenMP runtime
Jim Cownie [Fri, 27 Sep 2013 10:09:23 +0000 (10:09 +0000)]
Create directory for OpenMP runtime

llvm-svn: 191500

11 years ago[mips][msa] MSA requires FR=1 mode (64-bit FPU register file). Report fatal error...
Daniel Sanders [Fri, 27 Sep 2013 10:08:31 +0000 (10:08 +0000)]
[mips][msa] MSA requires FR=1 mode (64-bit FPU register file). Report fatal error when using it in FR=0 mode.

llvm-svn: 191498

11 years agoCorrectly indent with tabs when whitespace starts from the column not divisible by...
Alexander Kornienko [Fri, 27 Sep 2013 09:45:40 +0000 (09:45 +0000)]
Correctly indent with tabs when whitespace starts from the column not divisible by TabWidth.

Summary:
The width of the first inserted tab character depends on the initial
column, so we need to handle the first tab in a special manner.

Reviewers: klimek, djasper

Reviewed By: klimek

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

llvm-svn: 191497

11 years ago[mips][msa] Expand all truncstores and loadexts for MSA as well as DSP
Daniel Sanders [Fri, 27 Sep 2013 09:44:59 +0000 (09:44 +0000)]
[mips][msa] Expand all truncstores and loadexts for MSA as well as DSP

llvm-svn: 191496

11 years ago[mips][msa] Added missing check in performSRACombine
Daniel Sanders [Fri, 27 Sep 2013 09:25:29 +0000 (09:25 +0000)]
[mips][msa] Added missing check in performSRACombine

Reviewers: jacksprat, dsanders

Reviewed By: dsanders

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

llvm-svn: 191495

11 years agoclang-format: Improve formatting of functions with multiple trailing tokens.
Daniel Jasper [Fri, 27 Sep 2013 08:29:16 +0000 (08:29 +0000)]
clang-format: Improve formatting of functions with multiple trailing tokens.

Before:
  void SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaa,
                    aaaaaaaaaaaaaaaaaaaaaaaaaa) override
  final;

After:
  void SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaa,
                    aaaaaaaaaaaaaaaaaaaaaaaaaa) override final;

llvm-svn: 191494

11 years agoAST: Handle multidimensional arrays inside of __uuidof()
David Majnemer [Fri, 27 Sep 2013 07:57:34 +0000 (07:57 +0000)]
AST: Handle multidimensional arrays inside of __uuidof()

We previously handled one-dimensional arrays but didn't consider the
general case.  The fix is simple: keep going through subsequent
dimensions until we get to the base element.

llvm-svn: 191493

11 years agoclang-format: Fix formatting bug with comment in weird place.
Daniel Jasper [Fri, 27 Sep 2013 07:49:08 +0000 (07:49 +0000)]
clang-format: Fix formatting bug with comment in weird place.

Before:
  template <typename T>
  // T should be one of {A, B}.
      void f() {}

After:
  template <typename T>
  // T should be one of {A, B}.
  void f() {}

llvm-svn: 191492

11 years agoFirst check in. Modified a comment.
Puyan Lotfi [Fri, 27 Sep 2013 07:36:10 +0000 (07:36 +0000)]
First check in. Modified a comment.

llvm-svn: 191491

11 years agoPut HasAVX512 predicate on some patterns to properly disable them when AVX512 isn...
Craig Topper [Fri, 27 Sep 2013 07:20:47 +0000 (07:20 +0000)]
Put HasAVX512 predicate on some patterns to properly disable them when AVX512 isn't enabled. Currently it works simply because the SSE and AVX version of the same patterns are checked first in the DAG isel table.

llvm-svn: 191490

11 years agoSwitch HasAVX to UseAVX in one spot to ensure that AVX512 form of VINSERTPS is used...
Craig Topper [Fri, 27 Sep 2013 07:16:24 +0000 (07:16 +0000)]
Switch HasAVX to UseAVX in one spot to ensure that AVX512 form of VINSERTPS is used in AVX512 mode.

llvm-svn: 191489

11 years agoRemoval some duplicate patterns.
Craig Topper [Fri, 27 Sep 2013 07:11:17 +0000 (07:11 +0000)]
Removal some duplicate patterns.

llvm-svn: 191488

11 years agoAST: Handle qualified array types in typeid() expressions
David Majnemer [Fri, 27 Sep 2013 07:04:31 +0000 (07:04 +0000)]
AST: Handle qualified array types in typeid() expressions

The intent of getTypeOperand() was to yield an unqualified type.
However QualType::getUnqualifiedType() does not strip away qualifiers on
arrays.

N.B.  This worked fine when typeid() was applied to an expression
because we would inject as implicit cast to the unqualified array type
in the AST.

llvm-svn: 191487

11 years agoAdd -fno-unsigned-char and ignore it. We already support -fno-signed-char, add
Nick Lewycky [Fri, 27 Sep 2013 05:06:31 +0000 (05:06 +0000)]
Add -fno-unsigned-char and ignore it. We already support -fno-signed-char, add
both flags to the driver test.

llvm-svn: 191486

11 years agoNumericLiteralParser::ParseNumberStartingWithZero(): Try to appease MSC16's miscompil...
NAKAMURA Takumi [Fri, 27 Sep 2013 04:42:28 +0000 (04:42 +0000)]
NumericLiteralParser::ParseNumberStartingWithZero(): Try to appease MSC16's miscompilation.

Investigating yet. It seems msc16 miscompiles s[1] to be folded.

llvm-svn: 191485

11 years agoSema: Respect -fdelayed-template-parsing when parsing constexpr functions
David Majnemer [Fri, 27 Sep 2013 04:14:12 +0000 (04:14 +0000)]
Sema: Respect -fdelayed-template-parsing when parsing constexpr functions

Functions declared as constexpr must have their parsing delayed in
-fdelayed-template-parsing mode so as not to upset later template
instantiation.

N.B. My reading of the standard makes it seem like delayed template
parsing is at odds with constexpr.  We may want to make refinements in
other places in clang to make constexpr play nicer with this feature.

This fixes PR17334.

llvm-svn: 191484

11 years agoRemove some stray underscores from copyright block. Fix first line length to match...
Craig Topper [Fri, 27 Sep 2013 03:57:18 +0000 (03:57 +0000)]
Remove some stray underscores from copyright block. Fix first line length to match length of the one after the copyright block.

llvm-svn: 191483

11 years agotsan: support allocator_may_return_null flag
Dmitry Vyukov [Fri, 27 Sep 2013 02:31:23 +0000 (02:31 +0000)]
tsan: support allocator_may_return_null flag
Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=29

llvm-svn: 191482

11 years agoFixing Intel format of the vshufpd instruction.
Yunzhong Gao [Fri, 27 Sep 2013 01:44:23 +0000 (01:44 +0000)]
Fixing Intel format of the vshufpd instruction.
Phabricator code review is located at: http://llvm-reviews.chandlerc.com/D1759

llvm-svn: 191481

11 years agoRevert "llvm-objdump: Dump COFF import table if -private-headers option is given."
Rui Ueyama [Fri, 27 Sep 2013 01:29:36 +0000 (01:29 +0000)]
Revert "llvm-objdump: Dump COFF import table if -private-headers option is given."

This reverts commit r191472 because it's failing on BE machine.

llvm-svn: 191480

11 years agoRevert "[PECOFF] Add a test for the import table."
Rui Ueyama [Fri, 27 Sep 2013 01:26:53 +0000 (01:26 +0000)]
Revert "[PECOFF] Add a test for the import table."

This reverts r191469 because the original patch this one depends on (r191472)
was reverted.

llvm-svn: 191479

11 years agoFactor the code that was eliminating redundant breakpoint locations and moving
Jim Ingham [Fri, 27 Sep 2013 01:16:58 +0000 (01:16 +0000)]
Factor the code that was eliminating redundant breakpoint locations and moving
line breakpoints past the prologue of functions so it can be shared between the
file & line breakpoint resolver, and the source pattern breakpoint resolver,
and then share it.

llvm-svn: 191478

11 years agoDWARF says line number 0 is a valid line number - used to indicate a source line...
Jim Ingham [Fri, 27 Sep 2013 01:15:46 +0000 (01:15 +0000)]
DWARF says line number 0 is a valid line number - used to indicate a source line that should
not have breakpoints set on it inserted into code that does have a valid line number.  So allow
that line number, and the ThreadPlanStepRange should just continue stepping over 0 line ranges
as if they had the same line number as whatever we were previously stepping through.

llvm-svn: 191477

11 years agoRemove unnecessary checks for thread_plan_sp (we check for this at the top of the...
Jim Ingham [Fri, 27 Sep 2013 01:13:01 +0000 (01:13 +0000)]
Remove unnecessary checks for thread_plan_sp (we check for this at the top of the function.)

llvm-svn: 191476

11 years ago[PECOFF] Add a test for the import table.
Rui Ueyama [Fri, 27 Sep 2013 00:56:37 +0000 (00:56 +0000)]
[PECOFF] Add a test for the import table.

llvm-svn: 191475

11 years agoFix another -Wnon-pod-varargs error in r191472.
Rui Ueyama [Fri, 27 Sep 2013 00:53:07 +0000 (00:53 +0000)]
Fix another -Wnon-pod-varargs error in r191472.

llvm-svn: 191474

11 years agoFix -Wnon-pod-varargs error in r191472.
Rui Ueyama [Fri, 27 Sep 2013 00:20:53 +0000 (00:20 +0000)]
Fix -Wnon-pod-varargs error in r191472.

llvm-svn: 191473

11 years agollvm-objdump: Dump COFF import table if -private-headers option is given.
Rui Ueyama [Fri, 27 Sep 2013 00:07:01 +0000 (00:07 +0000)]
llvm-objdump: Dump COFF import table if -private-headers option is given.

This is a patch to add capability to llvm-objdump to dump COFF Import Table
entries, so that we can write tests for LLD checking Import Table contents.

llvm-objdump did not print anything but just file name if the format is COFF
and -private-headers option is given. This is a patch adds capability for
dumping DLL Import Table, which is specific to the COFF format.

In this patch I defined a new iterator to iterate over import table entries.
Also added a few functions to COFFObjectFile.cpp to access fields of the entry.

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

llvm-svn: 191472

11 years agoMCParser/Debug info: Accept line number 0 as a legitimate value, since
Adrian Prantl [Thu, 26 Sep 2013 23:37:11 +0000 (23:37 +0000)]
MCParser/Debug info: Accept line number 0 as a legitimate value, since
CFE produces it to indicate artificial locations.
c.f.: DWARF standard, Table 6.2:
line -- An unsigned integer indicating a source line number. Lines are numbered beginning at 1. The compiler may emit the value 0 in cases where an instruction cannot be attributed to any source line.

llvm-svn: 191471

11 years agoMark 32/64-bit tests as expected fail after root causing and referencing bugzilla.
Matt Kopec [Thu, 26 Sep 2013 23:30:59 +0000 (23:30 +0000)]
Mark 32/64-bit tests as expected fail after root causing and referencing bugzilla.
Fix TestFrames.py error to check against a None pc value.

llvm-svn: 191470

11 years ago[PECOFF] Enable input file logging if /debug is given.
Rui Ueyama [Thu, 26 Sep 2013 22:46:04 +0000 (22:46 +0000)]
[PECOFF] Enable input file logging if /debug is given.

llvm-svn: 191469

11 years agoObjectiveC migrator: Donlt annotate NS_RETURNS_INNER_POINTER
Fariborz Jahanian [Thu, 26 Sep 2013 22:43:41 +0000 (22:43 +0000)]
ObjectiveC migrator: Donlt annotate NS_RETURNS_INNER_POINTER
on class methods, as it makes no sense. // rdar://15069200

llvm-svn: 191468

11 years ago[ELF] Add COPY relocations.
Michael J. Spencer [Thu, 26 Sep 2013 22:09:16 +0000 (22:09 +0000)]
[ELF] Add COPY relocations.

llvm-svn: 191467

11 years ago[Core] Add type and size to SharedLibraryAtom.
Michael J. Spencer [Thu, 26 Sep 2013 22:08:43 +0000 (22:08 +0000)]
[Core] Add type and size to SharedLibraryAtom.

llvm-svn: 191466

11 years agoObjectiveC migrator: function pointer is not an
Fariborz Jahanian [Thu, 26 Sep 2013 21:43:47 +0000 (21:43 +0000)]
ObjectiveC migrator: function pointer is not an
inner pointer for annotation to
objc_returns_inner_pointer purposes.
// rdar://15044991

llvm-svn: 191465

11 years agoDebug info: Fix a crash when trying to construct a type with redundant
Adrian Prantl [Thu, 26 Sep 2013 21:35:50 +0000 (21:35 +0000)]
Debug info: Fix a crash when trying to construct a type with redundant
ownership qualifiers.
Fixes rdar://problem/14990656.

llvm-svn: 191463

11 years agoRemove an unused variable - thanks to Nick Lewycky for pointing this out!
Faisal Vali [Thu, 26 Sep 2013 21:32:23 +0000 (21:32 +0000)]
Remove an unused variable - thanks to Nick Lewycky for pointing this out!

llvm-svn: 191462

11 years ago[mips][msa] Direct Object Emission for 3RF instructions.
Jack Carter [Thu, 26 Sep 2013 21:31:43 +0000 (21:31 +0000)]
[mips][msa] Direct Object Emission for 3RF instructions.

Patch by Matheus Almeida

llvm-svn: 191461

11 years ago[mips][msa] Updates encoding of 3RF instructions to match the latest revision of...
Jack Carter [Thu, 26 Sep 2013 21:18:57 +0000 (21:18 +0000)]
[mips][msa] Updates encoding of 3RF instructions to match the latest revision of the MSA spec (1.06).

This does not affect any of the existing output.

Patch by Matheus Almeida

llvm-svn: 191460

11 years agoFix error recovery when a return type correction includes a new name specifier.
Kaelyn Uhrain [Thu, 26 Sep 2013 21:13:05 +0000 (21:13 +0000)]
Fix error recovery when a return type correction includes a new name specifier.

llvm-svn: 191459

11 years agoFix up fallout from r187156.
Bob Wilson [Thu, 26 Sep 2013 21:00:51 +0000 (21:00 +0000)]
Fix up fallout from r187156.

The previous change caused the driver to translate -Wa,-L to the
-msave-temp-labels option for cc1as, but cc1as did not accept that option.
This patch follows the same approach used for similar options (-relax-all,
-noexecstack) in the previous patch.

llvm-svn: 191458

11 years agoFix the thread jump test case for 32-bit inferiors. A jump was going back to a functi...
Matt Kopec [Thu, 26 Sep 2013 20:54:17 +0000 (20:54 +0000)]
Fix the thread jump test case for 32-bit inferiors. A jump was going back to a function call using a source line number. However, the parameters being passed to the function were setup before the instruction we jumped to. In other words, the source line was associated with assembly after the function parameters had been setup for the function to be called.

llvm-svn: 191457

11 years agomissed one Close () call in 191446 overload fix for Posix only code.
Carlo Kok [Thu, 26 Sep 2013 20:22:28 +0000 (20:22 +0000)]
missed one Close () call in 191446 overload fix for Posix only code.

llvm-svn: 191455

11 years agoFix the command name in the syntax text for _regexp-list
Ben Langmuir [Thu, 26 Sep 2013 20:00:01 +0000 (20:00 +0000)]
Fix the command name in the syntax text for _regexp-list

llvm-svn: 191454

11 years agoImplement a rudimentary form of generic lambdas.
Faisal Vali [Thu, 26 Sep 2013 19:54:12 +0000 (19:54 +0000)]
Implement a rudimentary form of generic lambdas.

Specifically, the following features are not included in this commit:
  - any sort of capturing within generic lambdas
  - generic lambdas within template functions and nested
    within other generic lambdas
  - conversion operator for captureless lambdas
  - ensuring all visitors are generic lambda aware
  (Although I have gotten some useful feedback on my patches of the above and will be incorporating that as I submit those patches for commit)

As an example of what compiles through this commit:

template <class F1, class F2>
struct overload : F1, F2 {
    using F1::operator();
    using F2::operator();
    overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
  };

  auto Recursive = [](auto Self, auto h, auto ... rest) {
    return 1 + Self(Self, rest...);
  };
  auto Base = [](auto Self, auto h) {
      return 1;
  };
  overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
  int num_params =  O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

This patch has been reviewed by Doug and Richard.  Minor changes (non-functionality affecting) have been made since both of them formally looked at it, but the changes involve removal of supernumerary return type deduction changes (since they are now redundant, with richard having committed a recent patch to address return type deduction for C++11 lambdas using C++14 semantics).

Some implementation notes:

  - Add a new Declarator context => LambdaExprParameterContext to
    clang::Declarator to allow the use of 'auto' in declaring generic
    lambda parameters

  - Add various helpers to CXXRecordDecl to facilitate identifying
    and querying a closure class

  - LambdaScopeInfo (which maintains the current lambda's Sema state)
    was augmented to house the current depth of the template being
    parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
    so that SemaType.cpp::ConvertDeclSpecToType may use it to immediately
    generate a template-parameter-type when 'auto' is parsed in a generic
    lambda parameter context.  (i.e we do NOT use AutoType deduced to
    a template parameter type - Richard seemed ok with this approach).
    We encode that this template type was generated from an auto by simply
    adding $auto to the name which can be used for better diagnostics if needed.

  - SemaLambda.h was added to hold some common lambda utility
    functions (this file is likely to grow ...)

  - Teach Sema::ActOnStartOfFunctionDef to check whether it
    is being called to instantiate a generic lambda's call
    operator, and if so, push an appropriately prepared
    LambdaScopeInfo object on the stack.

  - various tests were added - but much more will be needed.

There is obviously more work to be done, and both Richard (weakly) and Doug (strongly)
have requested that LambdaExpr be removed form the CXXRecordDecl LambdaDefinitionaData
in a future patch which is forthcoming.

A greatful thanks to all reviewers including Eli Friedman, James Dennett,
and especially the two gracious wizards (Richard Smith and Doug Gregor)
who spent hours providing feedback (in person in Chicago and on the mailing lists).
And yet I am certain that I have allowed unidentified bugs to creep in; bugs, that I will do my best to slay, once identified!

Thanks!

llvm-svn: 191453

11 years agoFix a couple of typos in the help text for disassemble
Ben Langmuir [Thu, 26 Sep 2013 19:53:03 +0000 (19:53 +0000)]
Fix a couple of typos in the help text for disassemble

llvm-svn: 191452

11 years agoclang-modernize: Fixing a few left over cpp11-migrate references
Edwin Vane [Thu, 26 Sep 2013 19:26:58 +0000 (19:26 +0000)]
clang-modernize: Fixing a few left over cpp11-migrate references

Build files for unit tests hadn't been updated yet.

llvm-svn: 191451

11 years agoFix a bug in the typo correction replacement location.
Kaelyn Uhrain [Thu, 26 Sep 2013 19:10:34 +0000 (19:10 +0000)]
Fix a bug in the typo correction replacement location.

I noticed the wrong text was being replaced with the correction while
working on expanding the "namespace-aware" typo correction to include
classes.

llvm-svn: 191450

11 years agoTeach typo correction to look inside of classes like it does namespaces.
Kaelyn Uhrain [Thu, 26 Sep 2013 19:10:29 +0000 (19:10 +0000)]
Teach typo correction to look inside of classes like it does namespaces.

Unlike with namespaces, searching inside of classes requires also
checking the access to correction candidates (i.e. don't suggest a
correction to a private class member for a correction occurring outside
that class and its methods or friends).

Included is a small (one line) fix for a bug, that was uncovered while
cleaning up the unit tests, where the decls from a TypoCorrection candidate
were preserved in new TypoCorrection candidates that are derived (copied)
from the old TypoCorrection--notably when creating a new candidate by
changing the NestedNameSpecifier associated with the base idenitifer.

llvm-svn: 191449

11 years agoclang-modernize: Reset LoopConvert's TU tracking info per TU
Edwin Vane [Thu, 26 Sep 2013 19:10:04 +0000 (19:10 +0000)]
clang-modernize: Reset LoopConvert's TU tracking info per TU

The LoopConvert transform makes use of data structures it builds up over
the course of transforming a TU. Until now, these data structures
weren't being cleared out before the next TU was being processed.

Fixes PR17253.

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

llvm-svn: 191448

11 years agoOn Windows MapViewOfFile requires the offset to be aligned on the system dwAllocation...
Carlo Kok [Thu, 26 Sep 2013 18:52:08 +0000 (18:52 +0000)]
On Windows MapViewOfFile requires the offset to be aligned on the system dwAllocationGranularity

llvm-svn: 191447

11 years agoOn windows a socket and file descriptor aren't the same kind of handle, pass the...
Carlo Kok [Thu, 26 Sep 2013 18:49:53 +0000 (18:49 +0000)]
On windows a socket and file descriptor aren't the same kind of handle, pass the type to Close so it uses the right api to close it.

llvm-svn: 191446