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

9 years agoFix bug where an additional O packet is sent after inferior exits.
Chaoren Lin [Tue, 7 Apr 2015 18:45:03 +0000 (18:45 +0000)]
Fix bug where an additional O packet is sent after inferior exits.

Summary:
ConnectionFileDescriptor::Read was returning eConnectionStatusError instead of 0
on m_shutting_down, which caused the caller to think that some number of bytes
were read.

Reviewers: jingham, vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 234341

9 years agoDebugInfo: Remove constructors for DIRef<>
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 18:41:54 +0000 (18:41 +0000)]
DebugInfo: Remove constructors for DIRef<>

Remove all constructors for `DIRef<>` *except* the ones forwarding from
`TypedDebugNodeRef`.

llvm-svn: 234340

9 years agoRevert "Fix a compiler error under MSVC"
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 18:41:26 +0000 (18:41 +0000)]
Revert "Fix a compiler error under MSVC"

This reverts the bandaid commit in r234308 now that I have a proper fix
in LLVM as of r234326.

llvm-svn: 234339

9 years agofix typo; NFC
Sanjay Patel [Tue, 7 Apr 2015 18:39:20 +0000 (18:39 +0000)]
fix typo; NFC

llvm-svn: 234338

9 years agoadd some const to FastMathFlags getters; NFC
Sanjay Patel [Tue, 7 Apr 2015 18:38:35 +0000 (18:38 +0000)]
add some const to FastMathFlags getters; NFC

llvm-svn: 234337

9 years ago[lit] Allow disabling an entire gtest suite, as is done in tsan
Reid Kleckner [Tue, 7 Apr 2015 18:14:10 +0000 (18:14 +0000)]
[lit] Allow disabling an entire gtest suite, as is done in tsan

llvm-svn: 234336

9 years agoRevert "Try a third time to fix MSVC build after r234290"
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 18:07:41 +0000 (18:07 +0000)]
Revert "Try a third time to fix MSVC build after r234290"

This reverts commit r234295 (and r234294 and r234292 before it).  I
removed the implicit conversion to `MDTuple*` r234326, so there's no
longer an ambiguity in `operator[]()`.

I think MSVC should accept the original code now...

llvm-svn: 234335

9 years agoAArch64: Don't lower ISD::SELECT to ISD::SELECT_CC
Matthias Braun [Tue, 7 Apr 2015 17:33:05 +0000 (17:33 +0000)]
AArch64: Don't lower ISD::SELECT to ISD::SELECT_CC

Instead of lowering SELECT to SELECT_CC which is further lowered later
immediately call the SELECT_CC lowering code. This is preferable
because:
- Avoids an unnecessary roundtrip through the legalization queues with
  an intermediate node.
- More importantly: Lowered operations get visited last leading to SELECT_CC
  getting visited with legalized operands and unlegalized ones for preexisting
  SELECT_CC nodes. This does not hurt the current code (hence no testcase) but
  is required for another patch I am working on.

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

llvm-svn: 234334

9 years agoRevert "Workaround bot failure with explicit conversion to MDTuple*"
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 17:30:52 +0000 (17:30 +0000)]
Revert "Workaround bot failure with explicit conversion to MDTuple*"

This reverts commit r234329, which insufficiently appeased older
`clang`s (apparently that wasn't the only call site).  r234331 was a
more complete fix.

llvm-svn: 234333

9 years agoDelete port forwarding if ConnectRemote fails.
Oleksiy Vyalov [Tue, 7 Apr 2015 17:23:15 +0000 (17:23 +0000)]
Delete port forwarding if ConnectRemote fails.

http://reviews.llvm.org/D8826

llvm-svn: 234332

9 years agoWorkaround continued bot failures with MDTupleTypedArrayWrapper
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 17:07:01 +0000 (17:07 +0000)]
Workaround continued bot failures with MDTupleTypedArrayWrapper

Change the explicit constructor to be more specific.  I think this will
get us past the continued bot failures [1] with older clangs.

[1]: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/8203

llvm-svn: 234331

9 years agoFixed a problem where the second @import statement
Sean Callanan [Tue, 7 Apr 2015 17:02:02 +0000 (17:02 +0000)]
Fixed a problem where the second @import statement
in a session would be silently ignored by the compiler
because the compiler looked at its SourceLocation and
decided it had already handled it.

Also updated the relevant test case.

<rdar://problem/20315447>

llvm-svn: 234330

9 years agoWorkaround bot failure with explicit conversion to MDTuple*
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 17:00:12 +0000 (17:00 +0000)]
Workaround bot failure with explicit conversion to MDTuple*

A bot is failing [1] after r234326, apparently because this code doesn't
do what I think it should:

    template <class U>
    explicit MDTupleTypedArrayWrapper(
        const U &Tuple,
        typename std::enable_if<
            std::is_constructible<const MDTuple *, U>::value>::type * = nullptr)
        : N(Tuple) {}

Just be explicit for now.

[1]: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/8201/

llvm-svn: 234329

9 years ago[Objective-C Sema] Patch to not issue unavailbility/deprecated
Fariborz Jahanian [Tue, 7 Apr 2015 16:56:27 +0000 (16:56 +0000)]
[Objective-C Sema] Patch to not issue unavailbility/deprecated
warning when multiple method declarations are found in global pool
with differing types and some are available.
rdar://20408445

llvm-svn: 234328

9 years agoDebugInfo: LLVM API change in r234326 for array-like tuple wrappers
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 16:50:49 +0000 (16:50 +0000)]
DebugInfo: LLVM API change in r234326 for array-like tuple wrappers

Update a few calls to `DIBuilder` now that `MDTuple` array-wrappers
don't have implicit conversions to `MDTuple*`.  I may circle back and
update `DIBuilder` to take arrays here, to make it easier for the
callers.

llvm-svn: 234327

9 years agoIR: Remove MDTupleTypedArrayWrapper::operator MDTuple*()
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 16:50:39 +0000 (16:50 +0000)]
IR: Remove MDTupleTypedArrayWrapper::operator MDTuple*()

Remove `MDTupleTypedArrayWrapper::operator MDTuple*()`, since it causes
ambiguity (at least in some [1] compilers [2]) when using indexes to
`MDTupleTypedArrayWrapper::operator[](unsigned)` that are convertible to
(but not the same as) `unsigned`.

[1]: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2308
[2]: http://lab.llvm.org:8011/builders/clang-cmake-mips/builds/4442

llvm-svn: 234326

9 years agoCleanup register pressure calculation in MachineLICM.
Daniel Jasper [Tue, 7 Apr 2015 16:42:35 +0000 (16:42 +0000)]
Cleanup register pressure calculation in MachineLICM.

There were four almost identical implementations of calculating/updating
the register pressure for a certain MachineInstr. Cleanup to have a
single implementation (well, controlled with two bool flags until this
is cleaned up more).

No functional changes intended.

Tested by verify that there are no binary changes in the entire llvm
test-suite. A new test was added separately in r234309 as it revealed a
pre-existing error in the register pressure calculation.

llvm-svn: 234325

9 years agoImplement atanh builtin
Tom Stellard [Tue, 7 Apr 2015 16:20:22 +0000 (16:20 +0000)]
Implement atanh builtin

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 234324

9 years agoImplement acosh builtin
Tom Stellard [Tue, 7 Apr 2015 16:20:20 +0000 (16:20 +0000)]
Implement acosh builtin

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 234323

9 years agoFix host config for Android and remove android specific part form Linux.
Tamas Berghammer [Tue, 7 Apr 2015 16:08:32 +0000 (16:08 +0000)]
Fix host config for Android and remove android specific part form Linux.

llvm-svn: 234322

9 years agoRemove check for windows when compiling scripts directory
Pavel Labath [Tue, 7 Apr 2015 15:30:23 +0000 (15:30 +0000)]
Remove check for windows when compiling scripts directory

this is a followup to r234319, change requested in http://reviews.llvm.org/D8855.

llvm-svn: 234321

9 years agoclang-format: Fix regression formatting QT's "signals:" from r234318.
Daniel Jasper [Tue, 7 Apr 2015 15:04:40 +0000 (15:04 +0000)]
clang-format: Fix regression formatting QT's "signals:" from r234318.

llvm-svn: 234320

9 years agoDon't compile scripts directory if LLDB_DISABLE_PYTHON is set
Pavel Labath [Tue, 7 Apr 2015 14:55:11 +0000 (14:55 +0000)]
Don't compile scripts directory if LLDB_DISABLE_PYTHON is set

Summary:
What looks like a typo has caused the scripts/Python directory to be compiled on non-Windows
platforms even with LLDB_DISABLE_PYTHON, which failed if Python.h was unavaiable. This changes
the condition to avoid compilation if LLDB_DISABLE_PYTHON is set.

Test Plan: Remove Python.h, verify compilation is successful.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 234319

9 years agoclang-format: Don't allow labels when expecting declarations.
Daniel Jasper [Tue, 7 Apr 2015 14:36:33 +0000 (14:36 +0000)]
clang-format: Don't allow labels when expecting declarations.

This fixes formatting unnamed bitfields (llvm.org/PR21999).

Before:
  struct MyStruct {
    uchar data;
  uchar:
    8;
  uchar:
    8;
    uchar other;
  };

After:
  struct MyStruct {
    uchar data;
    uchar : 8;
    uchar : 8;
    uchar other;
  };

llvm-svn: 234318

9 years agoAdd some documentation about cross-compilation to www.
Pavel Labath [Tue, 7 Apr 2015 14:36:23 +0000 (14:36 +0000)]
Add some documentation about cross-compilation to 

Reviewers: zturner, vharron, tberghammer, omjavaid

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 234317

9 years ago[mips] [IAS] Allow .set assignments for already defined symbols.
Toma Tabacu [Tue, 7 Apr 2015 13:59:39 +0000 (13:59 +0000)]
[mips] [IAS] Allow .set assignments for already defined symbols.

Summary:
This is not possible when using the IAS for MIPS, but it is possible when using the IAS for other architectures and when using GAS for MIPS.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 234316

9 years agoRefactor a lot of duplicated code for stub output.
Rafael Espindola [Tue, 7 Apr 2015 13:42:44 +0000 (13:42 +0000)]
Refactor a lot of duplicated code for stub output.

This also moves it earlier so that it they are produced before we print
an end symbol for the data section.

llvm-svn: 234315

9 years agoSilencing several "enumeral and non-enumeral type in conditional expression" warnings...
Aaron Ballman [Tue, 7 Apr 2015 13:28:37 +0000 (13:28 +0000)]
Silencing several "enumeral and non-enumeral type in conditional expression" warnings; NFC.

llvm-svn: 234314

9 years agoClear the stub map in getSortedStubs.
Rafael Espindola [Tue, 7 Apr 2015 12:59:28 +0000 (12:59 +0000)]
Clear the stub map in getSortedStubs.

This makes sure they are only output once (and frees a bit of memory).

llvm-svn: 234313

9 years ago[TableGen] Prevent invalid code generation when emitting AssemblerPredicate conditions.
Toma Tabacu [Tue, 7 Apr 2015 12:10:11 +0000 (12:10 +0000)]
[TableGen] Prevent invalid code generation when emitting AssemblerPredicate conditions.

Summary:
The loop which emits AssemblerPredicate conditions also links them together by emitting a '&&'.
If the 1st predicate is not an AssemblerPredicate, while the 2nd one is, nothing gets emitted for the 1st one, but we still emit the '&&' because of the 2nd predicate.
This generated code looks like "( && Cond2)" and is invalid.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: dsanders, llvm-commits

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

llvm-svn: 234312

9 years ago[ARM] Use getMappingAtomName in Release only
Denis Protivensky [Tue, 7 Apr 2015 11:51:39 +0000 (11:51 +0000)]
[ARM] Use getMappingAtomName in Release only

llvm-svn: 234311

9 years ago[MachineLICM] Remove obsolete comment about not considering reg pressure.
Daniel Jasper [Tue, 7 Apr 2015 11:43:32 +0000 (11:43 +0000)]
[MachineLICM] Remove obsolete comment about not considering reg pressure.

llvm-svn: 234310

9 years agoAdd test showing that MachineLICM is calculating register pressure wrong
Daniel Jasper [Tue, 7 Apr 2015 11:41:40 +0000 (11:41 +0000)]
Add test showing that MachineLICM is calculating register pressure wrong

More details: http://llvm.org/PR23143

llvm-svn: 234309

9 years agoFix a compiler error under MSVC
Timur Iskhodzhanov [Tue, 7 Apr 2015 11:26:00 +0000 (11:26 +0000)]
Fix a compiler error under MSVC

Error message was:
CGDebugInfo.cpp(1047) : error C2666: 'llvm::MDTypeRefArray::operator []' : 2 overloads have similar conversions
  DebugInfoMetadata.h(106): could be 'llvm::MDTypeRef llvm::MDTypeRefArray::operator [](unsigned int) const'
  while trying to match the argument list '(llvm::DITypeArray, int)'

llvm-svn: 234308

9 years agoIgnore mapping symbols on aarch64
Tamas Berghammer [Tue, 7 Apr 2015 10:43:50 +0000 (10:43 +0000)]
Ignore mapping symbols on aarch64

ELF symbol tables on aarch64 may contains some mapping symbols. They
provide information about the underlying data but interfere with symbol
look-up of lldb. They are already ignored on arm32. With this CL they
will be ignored on aarch64 also.

Differential revision: http://reviews.llvm.org/D8776

llvm-svn: 234307

9 years agoRevert "[SEH] Implement filter capturing in CodeGen"
Daniel Jasper [Tue, 7 Apr 2015 10:07:47 +0000 (10:07 +0000)]
Revert "[SEH] Implement filter capturing in CodeGen"

Test fails:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/3182/

llvm-svn: 234306

9 years agoimplement gdb-set output-radix
Ilia K [Tue, 7 Apr 2015 09:47:23 +0000 (09:47 +0000)]
implement gdb-set output-radix

Summary: Patch from chuckr@microsoft.com

Reviewers: abidh, ChuckR

Reviewed By: abidh

Subscribers: paulmaybee, ki.stfu, greggm, scarroll, lldb-commits

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

llvm-svn: 234305

9 years agoclang-format: Improve nested block formatting.
Daniel Jasper [Tue, 7 Apr 2015 08:20:35 +0000 (08:20 +0000)]
clang-format: Improve nested block formatting.

Before:
  functionA(functionB({
    int i;
    int j;
  }),
            aaaa, bbbb, cccc);

After:
  functionA(functionB({
              int i;
              int j;
            }),
            aaaa, bbbb, cccc);

llvm-svn: 234304

9 years ago[ARM] Rename applyThmReloc => applyThumb32Reloc
Denis Protivensky [Tue, 7 Apr 2015 07:14:13 +0000 (07:14 +0000)]
[ARM] Rename applyThmReloc => applyThumb32Reloc

llvm-svn: 234302

9 years ago[ARM] Add mapping symbols to PLT entries
Denis Protivensky [Tue, 7 Apr 2015 07:04:42 +0000 (07:04 +0000)]
[ARM] Add mapping symbols to PLT entries

Make PLT entry atoms represent mapping symbols in the Release mode,
while in the Debug mode they are still function-like symbols
with regular names.
It's legal that mapping symbols denote unnamed parts of code,
and PLT entries are not required to have function-like names.

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

llvm-svn: 234301

9 years agoclang-format: Indent relative to the ./-> and not the function name.
Daniel Jasper [Tue, 7 Apr 2015 06:41:24 +0000 (06:41 +0000)]
clang-format: Indent relative to the ./-> and not the function name.

Before:
  aaaaaaaaaaa     //
      .aaaa(      //
           bbbb)  // This is different ..
      .aaaa(      //
          cccc);  // .. from this.

After:
  aaaaaaaaaaa     //
      .aaaa(      //
          bbbb)   // This is identical ..
      .aaaa(      //
          cccc);  // .. to this.

llvm-svn: 234300

9 years ago[RuntimeDyld] Always allocate at least 1 byte for object sections in the JIT to
Lang Hames [Tue, 7 Apr 2015 06:27:56 +0000 (06:27 +0000)]
[RuntimeDyld] Always allocate at least 1 byte for object sections in the JIT to
ensure that section addresses are distinct.

mapSectionAddress will fail if two sections are allocated the same address,
which can happen if any section has zero size (since malloc(0) is implementation
defined). Unfortunately I've been unable to repro this with a simple test case.

Fixes <rdar://problem/20314015>.

llvm-svn: 234299

9 years ago[Orc] Save all the x86-64 GPRs before re-entering the JIT.
Lang Hames [Tue, 7 Apr 2015 06:12:21 +0000 (06:12 +0000)]
[Orc] Save all the x86-64 GPRs before re-entering the JIT.

The re-entry code should work for all calling conventions.

llvm-svn: 234298

9 years ago[Sema] Don't crash when __attribute__((nonnull)) is applied to blocks
David Majnemer [Tue, 7 Apr 2015 06:01:53 +0000 (06:01 +0000)]
[Sema] Don't crash when __attribute__((nonnull)) is applied to blocks

A simple case of asserting isFunctionOrMethod when we should have
asserted isFunctionOrMethodOrBlock.

This fixes PR23117.

llvm-svn: 234297

9 years agoIn many places, there was an #ifdef/#else block that selected one of two implmentatio...
Marshall Clow [Tue, 7 Apr 2015 05:21:38 +0000 (05:21 +0000)]
In many places, there was an #ifdef/#else block that selected one of two implmentations of rebind_alloc based on whether or not we had template aliases. Create a helper struct to encapsulate that bit of logic, and replace all the ifdefs with uses of that struct. No functionality change intented.

llvm-svn: 234296

9 years agoTry a third time to fix MSVC build after r234290
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 05:03:47 +0000 (05:03 +0000)]
Try a third time to fix MSVC build after r234290

I have no idea what MSVC means with its error text here :(.

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2310

llvm-svn: 234295

9 years agoTry again to fix MSVC build after r234290
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:49:13 +0000 (04:49 +0000)]
Try again to fix MSVC build after r234290

Still failing:

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2309

llvm-svn: 234294

9 years ago[ELF] Remove redundant const_cast
Simon Atanasyan [Tue, 7 Apr 2015 04:38:30 +0000 (04:38 +0000)]
[ELF] Remove redundant const_cast

No functional changes.

llvm-svn: 234293

9 years agoTry to fix MSVC build after r234290
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:33:42 +0000 (04:33 +0000)]
Try to fix MSVC build after r234290

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2308

llvm-svn: 234292

9 years agoDebugInfo: Update for LLVM change in r234290
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:14:45 +0000 (04:14 +0000)]
DebugInfo: Update for LLVM change in r234290

The API for `DIArray` changed; use the new one.

llvm-svn: 234291

9 years agoDebugInfo: Remove DITypedArray<>, replace with typedefs
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:14:33 +0000 (04:14 +0000)]
DebugInfo: Remove DITypedArray<>, replace with typedefs

Replace all uses of `DITypedArray<>` with `MDTupleTypedArrayWrapper<>`
and `MDTypeRefArray`.  The APIs are completely different, but the
provided functionality is the same: treat an `MDTuple` as if it's an
array of a particular element type.

To simplify this patch a bit, I've temporarily typedef'ed
`DebugNodeArray` to `DIArray` and `MDTypeRefArray` to `DITypeArray`.
I've also temporarily conditionalized the accessors to check for null --
eventually these should be changed to asserts and the callers should
check for null themselves.

There's a tiny accompanying patch to clang.

llvm-svn: 234290

9 years agoDebugInfo: Remove DICompositeType mutation API
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:12:02 +0000 (04:12 +0000)]
DebugInfo: Remove DICompositeType mutation API

Change `DIBuilder` to mutate `MDCompositeTypeBase` directly, and remove
the wrapping API in `DICompositeType`.

llvm-svn: 234289

9 years agoDebugInfo: Use DebugNodeRef in MDImportedEntity::getEntity()
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:07:31 +0000 (04:07 +0000)]
DebugInfo: Use DebugNodeRef in MDImportedEntity::getEntity()

A quick cleanup to sue `DebugNodeRef` instead of `Metadata*` for
`MDImportedEntity::getEntity()`.

llvm-svn: 234288

9 years agoDebugInfo: Move DIFlag accessors from DIVariable to MDLocalVariable
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:55:30 +0000 (03:55 +0000)]
DebugInfo: Move DIFlag accessors from DIVariable to MDLocalVariable

llvm-svn: 234287

9 years agoDebugInfo: Move DIExpression bit-piece API to MDExpression
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:49:59 +0000 (03:49 +0000)]
DebugInfo: Move DIExpression bit-piece API to MDExpression

llvm-svn: 234286

9 years agoDebugInfo: Remove special iterators from DIExpression
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:45:57 +0000 (03:45 +0000)]
DebugInfo: Remove special iterators from DIExpression

Remove special iterators from `DIExpression` in favour of same in
`MDExpression`.  There should be no functionality change here.

Note that the APIs are slightly different: `getArg(unsigned)` counts
from 0, not 1, in the `MDExpression` version of the iterator.

llvm-svn: 234285

9 years agoELF: Minimum alignment value is 1, not 0. NFC.
Rui Ueyama [Tue, 7 Apr 2015 03:44:26 +0000 (03:44 +0000)]
ELF: Minimum alignment value is 1, not 0. NFC.

Maybe we can interpret alignment 0 as "don't care", but for
consistency, it's good to set 1 instead of 0 where we allow
any alignments.

llvm-svn: 234284

9 years ago[LoopAccesses] New API to query if memchecks are necessary after partitioning
Adam Nemet [Tue, 7 Apr 2015 03:35:26 +0000 (03:35 +0000)]
[LoopAccesses] New API to query if memchecks are necessary after partitioning

This is used by Loop Distribution.

llvm-svn: 234283

9 years agoDebugInfo: Move DISubprogram::is*() queries to MDSubprogram
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:33:57 +0000 (03:33 +0000)]
DebugInfo: Move DISubprogram::is*() queries to MDSubprogram

Move body of `DISubprogram::isPrivate()` (etc.) to `MDSubprogram`, and
change the versions in `DISubprogram` to forward there.

This is just like r234275, but for subprograms instead of types.

llvm-svn: 234282

9 years agoELF: Add a comment to ELFFile::findAtom.
Rui Ueyama [Tue, 7 Apr 2015 02:52:34 +0000 (02:52 +0000)]
ELF: Add a comment to ELFFile::findAtom.

Also changed the local variable names to avoid line wrapping.

llvm-svn: 234281

9 years ago[Sema] Don't permit dependent alignments on non-dependent typedef-names
David Majnemer [Tue, 7 Apr 2015 02:37:09 +0000 (02:37 +0000)]
[Sema] Don't permit dependent alignments on non-dependent typedef-names

A dependent alignment attribute (like __attribute__((aligned(...))) or
__declspec(align(...))) on a non-dependent typedef or using declaration
poses a considerable challenge: the type is _not_ dependent, the size
_may_ be dependent if the type is used as an array type, the alignment
_is_ dependent.

It is reasonable for a compiler to be able to query the size and
alignment of a complete type.  Let's help that become an invariant.

This fixes PR22042.

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

llvm-svn: 234280

9 years agoFix weird comment line-wrapping.
Rui Ueyama [Tue, 7 Apr 2015 02:26:42 +0000 (02:26 +0000)]
Fix weird comment line-wrapping.

llvm-svn: 234279

9 years agoUse early continue.
Rui Ueyama [Tue, 7 Apr 2015 02:20:33 +0000 (02:20 +0000)]
Use early continue.

llvm-svn: 234278

9 years agoELF: Move more code from createAtoms to handleGnuLinkOnceSection.
Rui Ueyama [Tue, 7 Apr 2015 02:11:56 +0000 (02:11 +0000)]
ELF: Move more code from createAtoms to handleGnuLinkOnceSection.

So that createAtoms become more readable.

llvm-svn: 234277

9 years agoELF: Simplfiy ELFFile::createAtom.
Rui Ueyama [Tue, 7 Apr 2015 01:56:07 +0000 (01:56 +0000)]
ELF: Simplfiy ELFFile::createAtom.

createAtom function did too much in a single for-loop. This patch
splits the for-loop and extract COMDAT handling into a separate
function.

llvm-svn: 234276

9 years agoDebugInfo: Move DIType::is*() queries to MDType
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 01:24:30 +0000 (01:24 +0000)]
DebugInfo: Move DIType::is*() queries to MDType

Move body of `DIType::isObjectPointer()` (etc.) to `MDType`, and change
the versions in `DIType` to forward there.

llvm-svn: 234275

9 years agoDebugInfo: Move DIFlag-related API from DIDescriptor to DebugNode
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 01:21:40 +0000 (01:21 +0000)]
DebugInfo: Move DIFlag-related API from DIDescriptor to DebugNode

llvm-svn: 234274

9 years agoELF: Do not return error from handle{CommonSymbol,MergeString}.
Rui Ueyama [Tue, 7 Apr 2015 01:14:24 +0000 (01:14 +0000)]
ELF: Do not return error from handle{CommonSymbol,MergeString}.

llvm-svn: 234273

9 years agoELF: Do not return error from handleAbsoluteSymbol.
Rui Ueyama [Tue, 7 Apr 2015 01:08:16 +0000 (01:08 +0000)]
ELF: Do not return error from handleAbsoluteSymbol.

This function never fails.

llvm-svn: 234272

9 years agoELF: Do not return error from handleUndefinedSymbol.
Rui Ueyama [Tue, 7 Apr 2015 01:04:15 +0000 (01:04 +0000)]
ELF: Do not return error from handleUndefinedSymbol.

This function is not supposed to return an error value.

llvm-svn: 234271

9 years agoReport an error when -m<os>-version-min= does not specify a version.
Bob Wilson [Tue, 7 Apr 2015 01:03:35 +0000 (01:03 +0000)]
Report an error when -m<os>-version-min= does not specify a version.

Currently if you use -mmacosx-version-min or -mios-version-min without
specifying a version number, clang silently sets the minimum version to
"0.0.0". This is almost certainly not what was intended, so it is better
to report it as an error. rdar://problem/20433945

llvm-svn: 234270

9 years agoELF: Do not return error from handleDefinedSymbol.
Rui Ueyama [Tue, 7 Apr 2015 01:00:20 +0000 (01:00 +0000)]
ELF: Do not return error from handleDefinedSymbol.

handleDefinedSymbol has return type of ErrorOr<ELFDefinedAtom *>.
However, it never returns an error. We are not checking errors.
It's marked as ErrorOr "just in case". That's a bad engineering
practice.

This patch simplifies the return type of the function.

llvm-svn: 234269

9 years agoIR: Rename MDSubrange::getLo() to getLowerBound()
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 00:39:59 +0000 (00:39 +0000)]
IR: Rename MDSubrange::getLo() to getLowerBound()

During initial review, the `lo:` field was renamed to `lowerBound:`.
Make the same change to the C++ API.

llvm-svn: 234267

9 years agoFix polly build after LLVM r234263
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 00:29:05 +0000 (00:29 +0000)]
Fix polly build after LLVM r234263

llvm-svn: 234266

9 years agoFix some minor abuse of C++ terminology in comments.
Richard Smith [Tue, 7 Apr 2015 00:14:27 +0000 (00:14 +0000)]
Fix some minor abuse of C++ terminology in comments.

llvm-svn: 234265

9 years ago[WinEH] Don't create an alloca for unnamed catch parameters
Reid Kleckner [Tue, 7 Apr 2015 00:09:59 +0000 (00:09 +0000)]
[WinEH] Don't create an alloca for unnamed catch parameters

The catch object parameter to llvm.eh.begincatch is optional, and can be
null. We can save some ourselves the stack space, copy ctor, and dtor
calls if we pass null.

llvm-svn: 234264

9 years agoDebugInfo: Drop dead code for loose DIDescriptor construction API
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 00:09:47 +0000 (00:09 +0000)]
DebugInfo: Drop dead code for loose DIDescriptor construction API

Delete `DIDescriptor::is*()` and the various constructors from `MDNode*`
in `DIDescriptor` subclasses.

If this just broke your out-of-tree code, you need to make updates along
the lines of r234255, r234256, r234257 and r234258:

  - Generally, `DIX().isX()` => `isa<MDX>()`.  So, `D.isCompileUnit()`
    should just be `isa<MDCompileUnit>(D)`, modulo checks for null.
      - Exception: `DILexicalBlock` => `MDLexicalBlockBase`.
      - Exception: `DIDerivedType` => `MDDerivedTypeBase`.
      - Exception: `DICompositeType` => `MDCompositeTypeBase`.
      - Exception: `DIVariable` => `MDLocalVariable`.
  - Note that (e.g.) `DICompileUnit` has an implicit constructor from
    `MDCompileUnit*`.

llvm-svn: 234263