platform/upstream/llvm.git
9 years agoAdd begin() and end() to atom_collection that returns non-const iterators.
Rui Ueyama [Wed, 8 Apr 2015 21:59:08 +0000 (21:59 +0000)]
Add begin() and end() to atom_collection that returns non-const iterators.

llvm-svn: 234445

9 years agoReplace atom_iterator with a template alias.
Rui Ueyama [Wed, 8 Apr 2015 21:59:06 +0000 (21:59 +0000)]
Replace atom_iterator with a template alias.

llvm-svn: 234444

9 years agoMerge atom_collection_vector with atom_collection.
Rui Ueyama [Wed, 8 Apr 2015 21:59:04 +0000 (21:59 +0000)]
Merge atom_collection_vector with atom_collection.

atom_collection_vector is the only derived class of atom_collection.
This patch merges the two.

llvm-svn: 234443

9 years agoRemove atom_collection_empty class.
Rui Ueyama [Wed, 8 Apr 2015 21:59:00 +0000 (21:59 +0000)]
Remove atom_collection_empty class.

llvm-svn: 234442

9 years agoFix resolution of certain recursive types.
Stephane Sezer [Wed, 8 Apr 2015 21:52:45 +0000 (21:52 +0000)]
Fix resolution of certain recursive types.

Summary:
If a struct type S has a member T that has a member that is a function that
returns a typedef of S* the respective field would be duplicated, which caused
an assert down the line in RecordLayoutBuilder. This patch adds a check that
removes the possibility of trying to resolve the same type twice within the
same callstack.

This commit also adds unit tests for these failures.

Fixes https://llvm.org/bugs/show_bug.cgi?id=20486.

Patch by Cristian Hancila.

Test Plan: Run unit tests.

Reviewers: clayborg spyffe

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8561

llvm-svn: 234441

9 years ago[Objective-C Sema] Use canonical type of properties when comparing
Fariborz Jahanian [Wed, 8 Apr 2015 21:34:04 +0000 (21:34 +0000)]
[Objective-C Sema] Use canonical type of properties when comparing
redeclaration of property in class extension and to avoid
bogus error. rdar://20469452

llvm-svn: 234440

9 years agoPass -mtriple to llc to appease buildbot.
Akira Hatanaka [Wed, 8 Apr 2015 21:30:48 +0000 (21:30 +0000)]
Pass -mtriple to llc to appease buildbot.

This fixes the test case I committed in r234430.

llvm-svn: 234439

9 years agoFormmatting correction
Andrew Kaylor [Wed, 8 Apr 2015 21:22:46 +0000 (21:22 +0000)]
Formmatting correction

llvm-svn: 234438

9 years agoFix segfault when doing `thread info` on a thread without stop info.
Chaoren Lin [Wed, 8 Apr 2015 21:19:12 +0000 (21:19 +0000)]
Fix segfault when doing `thread info` on a thread without stop info.

Summary:
E.g., if thread 1 hits a breakpoint, then a `thread info` on thread 2 will cause
a segfault, since thread 2 will have no stop info (intended behavior?).

Reviewers: kubabrecka, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8905

llvm-svn: 234437

9 years agovec.data() and vec.data() + vec.size() are both safe even if the vector is empty.
Rui Ueyama [Wed, 8 Apr 2015 21:13:23 +0000 (21:13 +0000)]
vec.data() and vec.data() + vec.size() are both safe even if the vector is empty.

llvm-svn: 234436

9 years agoYAML: Remove blank class using alias template.
Rui Ueyama [Wed, 8 Apr 2015 21:05:45 +0000 (21:05 +0000)]
YAML: Remove blank class using alias template.

llvm-svn: 234435

9 years agoNative: Remove AtomArray and use atom_collection_vector instead.
Rui Ueyama [Wed, 8 Apr 2015 21:00:33 +0000 (21:00 +0000)]
Native: Remove AtomArray and use atom_collection_vector instead.

llvm-svn: 234434

9 years ago[WinEH] Minor bug fixes.
Andrew Kaylor [Wed, 8 Apr 2015 20:57:22 +0000 (20:57 +0000)]
[WinEH] Minor bug fixes.

Fixed insert point for allocas created for demoted values.
Clear the nested landing pad list after it has been processed.

llvm-svn: 234433

9 years agoNative: Use tempalte to remove duplicate code. NFC.
Rui Ueyama [Wed, 8 Apr 2015 20:40:46 +0000 (20:40 +0000)]
Native: Use tempalte to remove duplicate code. NFC.

llvm-svn: 234432

9 years agoNative: Simplify expressions. NFC.
Rui Ueyama [Wed, 8 Apr 2015 20:40:45 +0000 (20:40 +0000)]
Native: Simplify expressions. NFC.

llvm-svn: 234431

9 years ago[DAGCombine] Fix a bug in MergeConsecutiveStores.
Akira Hatanaka [Wed, 8 Apr 2015 20:34:53 +0000 (20:34 +0000)]
[DAGCombine] Fix a bug in MergeConsecutiveStores.

The bug manifests when there are two loads and two stores chained as follows in
a DAG,

(ld v3f32) -> (st f32) -> (ld v3f32) -> (st f32)

and the stores' values are extracted from the preceding vector loads.

MergeConsecutiveStores would replace the first store in the chain with the
merged vector store, which would create a cycle between the merged store node
and the last load node that appears in the chain.

This commits fixes the bug by replacing the last store in the chain instead.

rdar://problem/20275084

Differential Revision: http://reviews.llvm.org/D8849

llvm-svn: 234430

9 years agoFix -Wformat-pedantic warnings
David Blaikie [Wed, 8 Apr 2015 20:23:52 +0000 (20:23 +0000)]
Fix -Wformat-pedantic warnings

llvm-svn: 234429

9 years agoGo bindings: make various DIBuilder arguments optional.
Peter Collingbourne [Wed, 8 Apr 2015 20:18:57 +0000 (20:18 +0000)]
Go bindings: make various DIBuilder arguments optional.

r234262 changed some code in DIBuilderBindings.cpp to use the unwrap function
to unwrap debug metadata. The problem with this is that unwrap asserts that
its argument is non-null, which is not what we want in a number of places
in DIBuilder where the argument is optional. This change makes certain
arguments optional by adding null checks in places where it is required,
fixing the llgo build.

llvm-svn: 234428

9 years agoDon't repeat names in comments.
Rafael Espindola [Wed, 8 Apr 2015 20:16:23 +0000 (20:16 +0000)]
Don't repeat names in comments.

llvm-svn: 234427

9 years agoRemove unused variable.
Rafael Espindola [Wed, 8 Apr 2015 20:04:20 +0000 (20:04 +0000)]
Remove unused variable.

llvm-svn: 234426

9 years agoEliminate O(n^2) worst-case behavior in SSA construction
Cameron Zwarich [Wed, 8 Apr 2015 18:26:20 +0000 (18:26 +0000)]
Eliminate O(n^2) worst-case behavior in SSA construction

The code uses a priority queue and a worklist, which share the same
visited set, but the visited set is only updated when inserting into
the priority queue. Instead, switch to using separate visited sets
for the priority queue and worklist.

llvm-svn: 234425

9 years ago[LoopAccesses] Allow analysis to complete in the presence of uniform stores
Adam Nemet [Wed, 8 Apr 2015 17:48:40 +0000 (17:48 +0000)]
[LoopAccesses] Allow analysis to complete in the presence of uniform stores

(Re-apply r234361 with a fix and a testcase for PR23157)

Both run-time pointer checking and the dependence analysis are capable
of dealing with uniform addresses. I.e. it's really just an orthogonal
property of the loop that the analysis computes.

Run-time pointer checking will only try to reason about SCEVAddRec
pointers or else gives up. If the uniform pointer turns out the be a
SCEVAddRec in an outer loop, the run-time checks generated will be
correct (start and end bounds would be equal).

In case of the dependence analysis, we work again with SCEVs. When
compared against a loop-dependent address of the same underlying object,
the difference of the two SCEVs won't be constant. This will result in
returning an Unknown dependence for the pair.

When compared against another uniform access, the difference would be
constant and we should return the right type of dependence
(forward/backward/etc).

The changes also adds support to query this property of the loop and
modify the vectorizer to use this.

Patch by Ashutosh Nema!

llvm-svn: 234424

9 years ago[Sanitizer RT] Get rid of internal_isatty
Timur Iskhodzhanov [Wed, 8 Apr 2015 17:42:57 +0000 (17:42 +0000)]
[Sanitizer RT] Get rid of internal_isatty

llvm-svn: 234423

9 years agoRemove redundant virtual for member functions marked 'override'.
David Blaikie [Wed, 8 Apr 2015 17:22:09 +0000 (17:22 +0000)]
Remove redundant virtual for member functions marked 'override'.

llvm-svn: 234422

9 years ago[ARM] make vminnm/vmaxnm work with ?le, ?ge and no-nans-fp-math
Scott Douglass [Wed, 8 Apr 2015 17:18:28 +0000 (17:18 +0000)]
[ARM] make vminnm/vmaxnm work with ?le, ?ge and no-nans-fp-math

Because -menable-no-nans causes fcmp conditions to be rewritten
without 'o' or 'u' the recognition code in needs to cope. Also
extended it to handle 'le' and 'ge.

Differential Revision: http://reviews.llvm.org/D8725

llvm-svn: 234421

9 years agoRemove redundant virtual on member functions marked 'override'.
David Blaikie [Wed, 8 Apr 2015 17:08:27 +0000 (17:08 +0000)]
Remove redundant virtual on member functions marked 'override'.

llvm-svn: 234419

9 years agoMove some POSIX-specific functions from sanitizer_libc.h to a new sanitizer_posix.h
Timur Iskhodzhanov [Wed, 8 Apr 2015 17:08:24 +0000 (17:08 +0000)]
Move some POSIX-specific functions from sanitizer_libc.h to a new sanitizer_posix.h

llvm-svn: 234418

9 years agoRemove redundant virtual on member functions marked 'override'.
David Blaikie [Wed, 8 Apr 2015 17:01:55 +0000 (17:01 +0000)]
Remove redundant virtual on member functions marked 'override'.

llvm-svn: 234417

9 years agoRemove redundant virtual from member functions marked 'override'.
David Blaikie [Wed, 8 Apr 2015 17:00:56 +0000 (17:00 +0000)]
Remove redundant virtual from member functions marked 'override'.

llvm-svn: 234416

9 years agoRemove unused typedefs.
Rui Ueyama [Wed, 8 Apr 2015 16:59:03 +0000 (16:59 +0000)]
Remove unused typedefs.

llvm-svn: 234415

9 years agoRevert "Allow undefined symbols in shared library by default."
Rui Ueyama [Wed, 8 Apr 2015 16:55:03 +0000 (16:55 +0000)]
Revert "Allow undefined symbols in shared library by default."

This reverts commit r234378 because it broke buildbots.

llvm-svn: 234414

9 years agofixed to test features, not CPU models
Sanjay Patel [Wed, 8 Apr 2015 16:51:42 +0000 (16:51 +0000)]
fixed to test features, not CPU models

llvm-svn: 234413

9 years agoDon't repeat names in comments.
Rafael Espindola [Wed, 8 Apr 2015 16:33:46 +0000 (16:33 +0000)]
Don't repeat names in comments.

llvm-svn: 234412

9 years ago[Sanitizers] Make OpenFile more portable
Timur Iskhodzhanov [Wed, 8 Apr 2015 16:03:22 +0000 (16:03 +0000)]
[Sanitizers] Make OpenFile more portable

llvm-svn: 234410

9 years ago[mips] Update MIPS relocations list
Simon Atanasyan [Wed, 8 Apr 2015 14:55:31 +0000 (14:55 +0000)]
[mips] Update MIPS relocations list

No functional changes.

llvm-svn: 234408

9 years agoForce the inclusion of the LLVMSupport lib. Otherwise, the build (might?) fails with...
Sylvestre Ledru [Wed, 8 Apr 2015 14:09:36 +0000 (14:09 +0000)]
Force the inclusion of the LLVMSupport lib. Otherwise, the build (might?) fails with an undefined reference to 'llvm::llvm_is_multithreaded()'

llvm-svn: 234407

9 years ago[mips] [IAS] Do not generate redundant move when expanding lw/sw with symbol.
Toma Tabacu [Wed, 8 Apr 2015 13:52:41 +0000 (13:52 +0000)]
[mips] [IAS] Do not generate redundant move when expanding lw/sw with symbol.

Summary:
Even though there is no 2nd register operand in the "lw/sw $8, symbol" case, we still try to find one,
and we end up with $0, which makes us generate an unnecessary "addu $8, $8, $0" (a.k.a. "move $8, $8").

We can avoid this by checking if the 2nd register operand is different from $0, before generating the addu.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8055

llvm-svn: 234406

9 years agoDon't repeat names in comments. NFC.
Rafael Espindola [Wed, 8 Apr 2015 13:52:09 +0000 (13:52 +0000)]
Don't repeat names in comments. NFC.

llvm-svn: 234405

9 years ago[jitlistener] Remove unused code
Benjamin Kramer [Wed, 8 Apr 2015 13:17:48 +0000 (13:17 +0000)]
[jitlistener] Remove unused code

llvm-svn: 234404

9 years ago[clang-tidy] Fix for http://llvm.org/PR23130
Alexander Kornienko [Wed, 8 Apr 2015 12:54:57 +0000 (12:54 +0000)]
[clang-tidy] Fix for http://llvm.org/PR23130

NamespaceCommentCheck: Don't remove the token placed immediately after the
namespace closing brace.

llvm-svn: 234403

9 years ago[OPENMP] Allow redeclaration of variables as threadprivate.
Alexey Bataev [Wed, 8 Apr 2015 12:45:41 +0000 (12:45 +0000)]
[OPENMP] Allow redeclaration of variables as threadprivate.

No need to emit an error message if the variable is redeclared as threadprivate.

llvm-svn: 234402

9 years ago[mips] [IAS] Add support for the BNEZL and BEQZL pseudo-instructions.
Toma Tabacu [Wed, 8 Apr 2015 12:15:05 +0000 (12:15 +0000)]
[mips] [IAS] Add support for the BNEZL and BEQZL pseudo-instructions.

Summary:
They are of the form "bnezl/beqzl $rs, offset" and expand to "bnel/beql $rs, $zero, offset".

These instructions are used in Linux inline assembly.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8540

llvm-svn: 234401

9 years agoWrite the section header in the end.
Rafael Espindola [Wed, 8 Apr 2015 11:41:24 +0000 (11:41 +0000)]
Write the section header in the end.

One could make the argument for writing it immediately after the ELF header,
but writing it in the middle of the sections like we were doing just makes
it harder for no reason.

llvm-svn: 234400

9 years ago[ARM][Debug Info] Restore emitting of .cfi_def_cfa_offset for functions without stack...
Sergey Dmitrouk [Wed, 8 Apr 2015 10:10:12 +0000 (10:10 +0000)]
[ARM][Debug Info] Restore emitting of .cfi_def_cfa_offset for functions without stack frame

Summary: Looks like new code from [[ http://reviews.llvm.org/rL222057 | rL222057 ]] doesn't account for early `return` in `ARMFrameLowering::emitPrologue`, which leads to loosing `.cfi_def_cfa_offset` directive for functions without stack frame.

Reviewers: echristo, rengolin, asl, t.p.northover

Reviewed By: t.p.northover

Subscribers: llvm-commits, rengolin, aemerson

Differential Revision: http://reviews.llvm.org/D8606

llvm-svn: 234399

9 years ago[mips] [IAS] Remove AssemblerPredicate's from RelocPIC and RelocStatic.
Toma Tabacu [Wed, 8 Apr 2015 10:06:45 +0000 (10:06 +0000)]
[mips] [IAS] Remove AssemblerPredicate's from RelocPIC and RelocStatic.

Summary:
These AssemblerPredicate's are unnecessary and actually make some instructions unusable when assembling pre-MIPS32 ISAs.
For example, this was causing the IAS to reject the 'j' instruction for MIPS I-V.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8300

llvm-svn: 234398

9 years ago[ELF] Remove redundant GOTFile classes
Simon Atanasyan [Wed, 8 Apr 2015 10:06:28 +0000 (10:06 +0000)]
[ELF] Remove redundant GOTFile classes

llvm-svn: 234397

9 years ago[ELF] Do not save a reference to GOTFile instance in xxxWriter classes
Simon Atanasyan [Wed, 8 Apr 2015 09:19:45 +0000 (09:19 +0000)]
[ELF] Do not save a reference to GOTFile instance in xxxWriter classes

It's a follow-up to r234347. We do not need to keep a reference to
`GOTFile` instance in a xxxWriter class after ownership is transferred
to the caller of the `createImplicitFiles` method.

llvm-svn: 234396

9 years agoAdd documentation about remote debugging to the website
Pavel Labath [Wed, 8 Apr 2015 07:54:31 +0000 (07:54 +0000)]
Add documentation about remote debugging to the website

Reviewers: tberghammer, clayborg

Subscribers: tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D8871

llvm-svn: 234395

9 years agotsan: handle async signals while blocked in pthread_cond_wait
Dmitry Vyukov [Wed, 8 Apr 2015 07:48:52 +0000 (07:48 +0000)]
tsan: handle async signals while blocked in pthread_cond_wait

Fixes https://code.google.com/p/thread-sanitizer/issues/detail?id=91

llvm-svn: 234394

9 years ago[MachineLICM] Cleanup, remove unused parameters. NFC.
Daniel Jasper [Wed, 8 Apr 2015 07:10:30 +0000 (07:10 +0000)]
[MachineLICM] Cleanup, remove unused parameters. NFC.

llvm-svn: 234392

9 years ago[lib/Fuzzer] show how to find Heartbleed with LibFuzzer
Kostya Serebryany [Wed, 8 Apr 2015 06:16:11 +0000 (06:16 +0000)]
[lib/Fuzzer] show how to find Heartbleed with LibFuzzer

llvm-svn: 234391

9 years agoRevert r234389. It really was needed but really should have been cstring instead...
Craig Topper [Wed, 8 Apr 2015 06:03:17 +0000 (06:03 +0000)]
Revert r234389. It really was needed but really should have been cstring instead of string.h

llvm-svn: 234390

9 years agoRemove unnecessary include. NFC
Craig Topper [Wed, 8 Apr 2015 05:56:30 +0000 (05:56 +0000)]
Remove unnecessary include. NFC

llvm-svn: 234389

9 years ago[InstCombine] Refactor out OptimizeOverflowCheck. NFCI.
Sanjoy Das [Wed, 8 Apr 2015 04:27:22 +0000 (04:27 +0000)]
[InstCombine] Refactor out OptimizeOverflowCheck.  NFCI.

Summary:
This patch adds an enum `OverflowCheckFlavor` and a function
`OptimizeOverflowCheck`.  This will allow InstCombine to optimize
overflow checks without directly introducing an intermediate call to the
`llvm.$op.with.overflow` instrinsics.

This specific change is a refactoring and does not intend to change
behavior.

Reviewers: majnemer, atrick

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8888

llvm-svn: 234388

9 years agoRevert "[LoopAccesses] Allow analysis to complete in the presence of uniform stores"
Adam Nemet [Wed, 8 Apr 2015 04:16:55 +0000 (04:16 +0000)]
Revert "[LoopAccesses] Allow analysis to complete in the presence of uniform stores"

This reverts commit r234361.

It caused PR23157.

llvm-svn: 234387

9 years ago[bpf] support BPF backend as shared library
Alexei Starovoitov [Wed, 8 Apr 2015 03:46:51 +0000 (03:46 +0000)]
[bpf] support BPF backend as shared library

dependencies were not set correctly for shared library build.
static was ok

Patch by Brenden Blanco.

llvm-svn: 234386

9 years agoOops, didn't mean to commit my debug fprintfs
Matthias Braun [Wed, 8 Apr 2015 02:10:01 +0000 (02:10 +0000)]
Oops, didn't mean to commit my debug fprintfs

llvm-svn: 234385

9 years agoR600/SI: Add some missing overrides
Tom Stellard [Wed, 8 Apr 2015 02:07:05 +0000 (02:07 +0000)]
R600/SI: Add some missing overrides

llvm-svn: 234384

9 years ago[llgo] add buildbot-slave config
Andrew Wilkins [Wed, 8 Apr 2015 01:41:46 +0000 (01:41 +0000)]
[llgo] add buildbot-slave config

Summary:
This patch adds the configuration used to deploy
the llgo-builder buildbot slave. The builder is
deployed to Google Compute Engine using Juju.

Reviewers: pcc

Reviewed By: pcc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8854

llvm-svn: 234383

9 years agoLiveInterval: Fix computeFromMainRange() producing adjacent segments with same valno
Matthias Braun [Wed, 8 Apr 2015 01:41:10 +0000 (01:41 +0000)]
LiveInterval: Fix computeFromMainRange() producing adjacent segments with same valno

If two livesegments from different subranges happened to have the same
definition they could possibly end up as two adjacent segments in the
main liverange with the same value number which is not allowed. Detect
such cases and fix them in the 2nd pass of computeFromMainRange() if
necessary.

No testcase as there is only an out-of-tree target where I can sensibly
come up with one.

llvm-svn: 234382

9 years agoR600/SI: Initial support for assembler and inline assembly
Tom Stellard [Wed, 8 Apr 2015 01:09:26 +0000 (01:09 +0000)]
R600/SI: Initial support for assembler and inline assembly

This is currently considered experimental, but most of the more
commonly used instructions should work.

So far only SI has been extensively tested, CI and VI probably work too,
but may be buggy.  The current set of tests cases do not give complete
coverage, but I think it is sufficient for an experimental assembler.

See the documentation in R600Usage for more information.

llvm-svn: 234381

9 years agoR600/SI: Add missing SOPK instructions
Tom Stellard [Wed, 8 Apr 2015 01:09:22 +0000 (01:09 +0000)]
R600/SI: Add missing SOPK instructions

llvm-svn: 234380

9 years agoR600/SI: Don't print offset0/offset1 DS operands when they are 0
Tom Stellard [Wed, 8 Apr 2015 01:09:19 +0000 (01:09 +0000)]
R600/SI: Don't print offset0/offset1 DS operands when they are 0

llvm-svn: 234379

9 years agoAllow undefined symbols in shared library by default.
Davide Italiano [Wed, 8 Apr 2015 01:00:19 +0000 (01:00 +0000)]
Allow undefined symbols in shared library by default.

It's not our business to resolve those undefined symbols.
We just trust the linker will load the library and its dependencies
correctly, which is actually what happens, modulo bugs in the dynamic
linker itself.

PR: 23035
Differential Revision: http://reviews.llvm.org/D8886

llvm-svn: 234378

9 years agoELFObjectWriter.cpp: Prune obsolete \param since r234342. [-Wdocumentation]
NAKAMURA Takumi [Wed, 8 Apr 2015 00:38:50 +0000 (00:38 +0000)]
ELFObjectWriter.cpp: Prune obsolete \param since r234342. [-Wdocumentation]

llvm-svn: 234377

9 years agoAppease build bots that cannot find a viable conversion through CanQualType.
Aaron Ballman [Wed, 8 Apr 2015 00:13:33 +0000 (00:13 +0000)]
Appease build bots that cannot find a viable conversion through CanQualType.

llvm-svn: 234376

9 years agoGenerate a diagnostic when a catch handler cannot execute due to class hierarchy...
Aaron Ballman [Wed, 8 Apr 2015 00:05:29 +0000 (00:05 +0000)]
Generate a diagnostic when a catch handler cannot execute due to class hierarchy inversion with regards to other catch handlers for the same block.

llvm-svn: 234375

9 years agoUse the most recent previous decl to check if inline is added after a definition
Reid Kleckner [Wed, 8 Apr 2015 00:04:47 +0000 (00:04 +0000)]
Use the most recent previous decl to check if inline is added after a definition

This affects this test case:
  void foo();
  template <typename T> class C {
    friend inline void foo();
  };
  inline void foo() {}
  C<int> c;

Here, we instantiate the foo friend decl and add it to foo's redecl
chain. However, our previous decl pointer happens to reference the first
declaration of foo, which is not marked inline. When we check to see if
foo was already defined, we implicitly search all previous decls. We
should do the same for the inline check, instead of just checking this
particular previous decl.

Reviewers: rsmith

Differential Revision: http://reviews.llvm.org/D8872

llvm-svn: 234374

9 years agoFix compilation failure caused by r234366.
Chaoren Lin [Tue, 7 Apr 2015 22:50:35 +0000 (22:50 +0000)]
Fix compilation failure caused by r234366.

llvm-svn: 234373

9 years agoAArch64: disallow "fmov sD, #-0.0" during assembly.
Tim Northover [Tue, 7 Apr 2015 22:49:47 +0000 (22:49 +0000)]
AArch64: disallow "fmov sD, #-0.0" during assembly.

We weren't checking the sign of the floating point immediate before translating
it to "fmov sD, wzr". Similarly for D-regs.

Technically "movi vD.2s, #0x80, lsl #24" would work most of the time, but it's
not a blessed alias (and I don't think it should be since people expect writing
sD to zero out the high lanes, and there's no dD equivalent). So an error it is.

rdar://20455398

llvm-svn: 234372

9 years agoELF: Minor simplification.
Rui Ueyama [Tue, 7 Apr 2015 22:46:01 +0000 (22:46 +0000)]
ELF: Minor simplification.

MergeSectionKey is a tiny struct. We don't need a constructor for that.
The good old way to initialize a struct works fine.

llvm-svn: 234371

9 years agoDelete commented code. Don't repeat name in comment.
Rafael Espindola [Tue, 7 Apr 2015 22:35:40 +0000 (22:35 +0000)]
Delete commented code. Don't repeat name in comment.

llvm-svn: 234370

9 years agoMachO: Remove unused vectors from MachHeaderAliasFile. NFC.
Rui Ueyama [Tue, 7 Apr 2015 22:35:29 +0000 (22:35 +0000)]
MachO: Remove unused vectors from MachHeaderAliasFile. NFC.

llvm-svn: 234369

9 years agoRemove unused vectors from FileArchive.
Rui Ueyama [Tue, 7 Apr 2015 22:32:19 +0000 (22:32 +0000)]
Remove unused vectors from FileArchive.

Archive files don't have any symbols (their members do).
The vectors deleted here were always empty.

llvm-svn: 234368

9 years agoELF: Simplify ELFFile by deriving from SimpleFile instead of File.
Rui Ueyama [Tue, 7 Apr 2015 22:27:43 +0000 (22:27 +0000)]
ELF: Simplify ELFFile by deriving from SimpleFile instead of File.

SimpleFile defines defined(). undefined(), sharedLibrary() and absolute().
We should use the class instead of deriving from the base class and
re-defining the member functions in ELFFile.

llvm-svn: 234367

9 years agoMake sure the OperatingSystem plug-ins will work on linux as well. This goes with...
Greg Clayton [Tue, 7 Apr 2015 22:23:53 +0000 (22:23 +0000)]
Make sure the OperatingSystem plug-ins will work on linux as well. This goes with my previous fix with revision 234364.

llvm-svn: 234366

9 years agoDefine SimpleFile::addAtom for concrete atom types.
Rui Ueyama [Tue, 7 Apr 2015 22:21:18 +0000 (22:21 +0000)]
Define SimpleFile::addAtom for concrete atom types.

Previously, addAtom always used dynamic dispatching mechanism to
bin atoms. This patch eliminates dynamic dispatching in most cases.

llvm-svn: 234365

9 years agoFix stepping a virtual thread when the python operating system was enabled.
Greg Clayton [Tue, 7 Apr 2015 22:17:41 +0000 (22:17 +0000)]
Fix stepping a virtual thread when the python operating system was enabled.

The OperatingSystem plug-ins allow code to detect threads in memory and then say "memory thread 0x11111" is backed by the actual thread 1.

You can then single step these virtual threads. A problem arose when thread specific breakpoints were used during thread plans where we would say "set a breakpoint on thread 0x11111" and we would hit the breakpoint on the real thread 1 and the thread IDs wouldn't match and we would get rid of the "stopped at breakpoint" stop info due to this mismatch. Code was added to ensure these events get forwarded and thus allow single stepping a memory thread to work correctly.

Added a test case for this as well.

<rdar://problem/19211770>

llvm-svn: 234364

9 years ago[Sema] Correctly recurse when looking for [*] in function definitions
David Majnemer [Tue, 7 Apr 2015 22:08:51 +0000 (22:08 +0000)]
[Sema] Correctly recurse when looking for [*] in function definitions

A [*] is only allowed in a declaration for a function, not in its
definition.  We didn't correctly recurse while looking for it, causing
us to crash in CodeGen instead of rejecting it.

This fixes PR23151.

llvm-svn: 234363

9 years agoDon't subtract the header size just to add it back.
Rafael Espindola [Tue, 7 Apr 2015 21:51:41 +0000 (21:51 +0000)]
Don't subtract the header size just to add it back.

llvm-svn: 234362

9 years ago[LoopAccesses] Allow analysis to complete in the presence of uniform stores
Adam Nemet [Tue, 7 Apr 2015 21:46:16 +0000 (21:46 +0000)]
[LoopAccesses] Allow analysis to complete in the presence of uniform stores

Both run-time pointer checking and the dependence analysis are capable
of dealing with uniform addresses. I.e. it's really just an orthogonal
property of the loop that the analysis computes.

Run-time pointer checking will only try to reason about SCEVAddRec
pointers or else gives up. If the uniform pointer turns out the be a
SCEVAddRec in an outer loop, the run-time checks generated will be
correct (start and end bounds would be equal).

In case of the dependence analysis, we work again with SCEVs. When
compared against a loop-dependent address of the same underlying object,
the difference of the two SCEVs won't be constant. This will result in
returning an Unknown dependence for the pair.

When compared against another uniform access, the difference would be
constant and we should return the right type of dependence
(forward/backward/etc).

The changes also adds support to query this property of the loop and
modify the vectorizer to use this.

Patch by Ashutosh Nema!

llvm-svn: 234361

9 years ago[WinEH] Add invoke of llvm.donothing to outlined catch and cleanup handlers to identi...
Andrew Kaylor [Tue, 7 Apr 2015 21:30:23 +0000 (21:30 +0000)]
[WinEH] Add invoke of llvm.donothing to outlined catch and cleanup handlers to identify their personality.

Differential Review: http://reviews.llvm.org/D8835

llvm-svn: 234360

9 years agoUse support::endian. NFC.
Rafael Espindola [Tue, 7 Apr 2015 21:22:05 +0000 (21:22 +0000)]
Use support::endian. NFC.

llvm-svn: 234359

9 years ago[ELF] Set `addAbsoluteAtom` and `addUndefinedAtom` functions return type to void
Simon Atanasyan [Tue, 7 Apr 2015 21:12:28 +0000 (21:12 +0000)]
[ELF] Set `addAbsoluteAtom` and `addUndefinedAtom` functions return type to void

We do not use values returned by these functions anywhere.
So let's return nothing.

llvm-svn: 234358

9 years ago[ELF] Remove unused xxxWriter class fields
Simon Atanasyan [Tue, 7 Apr 2015 21:12:18 +0000 (21:12 +0000)]
[ELF] Remove unused xxxWriter class fields

llvm-svn: 234357

9 years ago[ELF] Remove redundant override methods which just call base class functions
Simon Atanasyan [Tue, 7 Apr 2015 21:12:02 +0000 (21:12 +0000)]
[ELF] Remove redundant override methods which just call base class functions

llvm-svn: 234356

9 years agoRevert "Mark instantiated function decls as inline specified if any pattern is"
Reid Kleckner [Tue, 7 Apr 2015 20:46:51 +0000 (20:46 +0000)]
Revert "Mark instantiated function decls as inline specified if any pattern is"

It breaks down on this test case:
  void foo();
  template <typename T> class C {
    friend void foo();
  };
  inline void foo() {}
  C<int> c;

We shouldn't be marking the instantiation of the friend decl of foo as
inline-specified. It may be possible to fix this by determining if the
full definition is part of the current template, but it seems better to
rever tot green until we come up with a full solution.

This reverts commit r233817, as well as follow-ups r233820 and r233821.

llvm-svn: 234355

9 years agoMerge MutableFile with SimpleFile.
Rui Ueyama [Tue, 7 Apr 2015 20:43:38 +0000 (20:43 +0000)]
Merge MutableFile with SimpleFile.

SimpleFile is the only derived class of MutableFile.
This patch reduces the height of class hierarchy by removing
MutableFile class.

llvm-svn: 234354

9 years agoAdd boolean to PrintStackTraceOnErrorSignal to disable crash reporting.
Pete Cooper [Tue, 7 Apr 2015 20:43:23 +0000 (20:43 +0000)]
Add boolean to PrintStackTraceOnErrorSignal to disable crash reporting.

The current crash reporting on Mac OS is only disabled via an environment variable.
This adds a boolean (default false) which can also disable crash reporting.

The only client right now is the unittests which don't ever want crash reporting, but do want to detect killed programs.

Reduces the time to run the APFloat unittests on my machine from

[----------] 47 tests from APFloatTest (51250 ms total)

to

[----------] 47 tests from APFloatTest (765 ms total)

Reviewed by Reid Kleckner and Justin Bogner

llvm-svn: 234353

9 years agoRemove dead code. NFC.
Rafael Espindola [Tue, 7 Apr 2015 20:38:45 +0000 (20:38 +0000)]
Remove dead code. NFC.

llvm-svn: 234352

9 years agoAdded a testcase that checks that struct arguments
Sean Callanan [Tue, 7 Apr 2015 20:33:10 +0000 (20:33 +0000)]
Added a testcase that checks that struct arguments
are passed to Objective-C methods correctly.

llvm-svn: 234351

9 years ago[ARM] Mark a bunch of .td Operands with type _MEMORY.
Ahmed Bougacha [Tue, 7 Apr 2015 20:31:16 +0000 (20:31 +0000)]
[ARM] Mark a bunch of .td Operands with type _MEMORY.

This shouldn't affect anything in-tree, as the OperandType users are
mostly smart disassemblers and such; more information is helpful there.
However, on the flip side, that + the fact that this is just hinting at
the meaning of operands makes this not really test-worthy or testable.

Differential Revision: http://reviews.llvm.org/D8620

llvm-svn: 234350

9 years ago[bpf] fix build
Alexei Starovoitov [Tue, 7 Apr 2015 20:25:34 +0000 (20:25 +0000)]
[bpf] fix build

fix the build and remove unused variable warnings in Release mode.

Patch by Brenden Blanco.

llvm-svn: 234349

9 years agoMade the struct types test case a little stricter,
Sean Callanan [Tue, 7 Apr 2015 20:19:37 +0000 (20:19 +0000)]
Made the struct types test case a little stricter,
by verifying that we can pass a struct-typed variable
to a function that takes structs.

llvm-svn: 234348

9 years ago[ELF] Simplify adding default atoms
Simon Atanasyan [Tue, 7 Apr 2015 20:11:38 +0000 (20:11 +0000)]
[ELF] Simplify adding default atoms

Now 'writer' creates an instance of `RuntimeFile` in the constructor, then
populates the file in the virtual function `addDefaultAtoms`, then pass
owning of this file to the caller of virtual function `createImplicitFiles`.

First, we do not need to keep an instance of `RuntimeFile` so long. It is
enough to create the file, right after that populate it and pass the owning.

Second, relationship between `createImplicitFiles` and `addDefaultAtoms`
is complicated. The `createImplicitFiles` might call `addDefaultAtoms`,
overridden version of `addDefaultAtoms` might call base class `addDefaultAtoms`,
and overridden version of `createImplicitFiles` might call base class
`createImplicitFiles` as well as `addDefaultAtoms`.

The patch solves both problems above. It creates and populates runtime files
right in the createImplicitFiles(), removes `addDefaultAtoms` at all and
does not keep references to runtime files in class fields.

llvm-svn: 234347

9 years ago[WinEH] Fix xdata generation when no catch object is present
Reid Kleckner [Tue, 7 Apr 2015 19:46:38 +0000 (19:46 +0000)]
[WinEH] Fix xdata generation when no catch object is present

The lack of a catch object is indicated by a frame escape index of -1.

Fixes PR23137.

llvm-svn: 234346

9 years agoRemove intermediate variables.
Rafael Espindola [Tue, 7 Apr 2015 19:17:47 +0000 (19:17 +0000)]
Remove intermediate variables.

The name of these variables was completely out of date with the information
stored in them.

llvm-svn: 234345

9 years agomove helper function closer to use; NFC
Sanjay Patel [Tue, 7 Apr 2015 19:13:06 +0000 (19:13 +0000)]
move helper function closer to use; NFC

llvm-svn: 234344

9 years agoEnable W4 warnings by default for MSVC builds
Andrew Kaylor [Tue, 7 Apr 2015 19:01:01 +0000 (19:01 +0000)]
Enable W4 warnings by default for MSVC builds

llvm-svn: 234343

9 years agoRemove unused argument.
Rafael Espindola [Tue, 7 Apr 2015 19:00:17 +0000 (19:00 +0000)]
Remove unused argument.

llvm-svn: 234342