Commit Graph

204865 Commits

Author SHA1 Message Date
Oleksiy Vyalov c8a3e9273c Try to enable TestProcessAttach tests on Linux.
http://reviews.llvm.org/D11013

llvm-svn: 241702
2015-07-08 18:15:32 +00:00
Rui Ueyama e16a75d5a1 COFF: Handle /machine option in a similar manner for other options. NFC.
llvm-svn: 241701
2015-07-08 18:14:51 +00:00
Reid Kleckner 0a3f5f634a [SEH] Add missing test case from previous realignment commit
llvm-svn: 241700
2015-07-08 18:09:39 +00:00
Reid Kleckner ed012dbf2a [SEH] Ensure that empty __except blocks have their own BB
The 32-bit lowering assumed that WinEHPrepare had this invariant.
WinEHPrepare did it for C++, but not SEH. The result was that we would
insert calls to llvm.x86.seh.restoreframe in normal basic blocks, which
corrupted the frame pointer.

llvm-svn: 241699
2015-07-08 18:08:52 +00:00
James Y Knight bc832ed51d Expand LangRef.html's documentation on LLVM's inline assembly.
While trying to figure out how this was all supposed to work, I
figured I'd start writing down some documentation, since it was
basically completely missing.

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

llvm-svn: 241698
2015-07-08 18:08:36 +00:00
Stephane Sezer 38a1b7ea58 Move WindowsDYLD to the Plugins/DynamicLoader directory.
Summary:
This commit moves the Windows DyanamicLoader to the common DynamicLoader
directory. This is required to remote debug Windows targets.

This commit also initializes the Windows DYLD plugin in
SystemInitializerCommon (similarly to both POSIX and MacOSX DYLD
plugins) so that we can automatically instantiate this class when
connected to a windows process.

Test Plan: Build.

Reviewers: zturner

Subscribers: lldb-commits, abdulras

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

llvm-svn: 241697
2015-07-08 18:07:13 +00:00
Peter Collingbourne e008391ea2 Create lld-link2 symlink/copy for new COFF linker.
This situation will only be temporary; I imagine we will eventually want to
have the new linker take the lld-link alias after we remove the old one.
However, I would like to port the CFI test suite in the compiler-rt
repository to Windows using the new COFF linker's LTO support; these tests
currently use gcc-style command lines and invoke the linker via the
compiler driver.

We can select the linker using the -fuse-ld flag, which Clang supports on
Windows, but it takes an executable name, rather than a list of arguments
(so "-fuse-ld=lld -flavor link2" wouldn't work), and it doesn't seem worth
the effort to extend the Clang driver to support arguments.

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

llvm-svn: 241696
2015-07-08 18:05:22 +00:00
Sean Callanan 83b8ad0eaa Fixed a serious bug in DeportType where the types could retain DeclContexts that
pointed into the artificial function constructed for the expression.  I now make
anything that pointed to the function as its DeclContext be global while the
copy occurs; afterward I restored the old DeclContext.

Added a testcase that make sure that this works properly and doesn't crash
anything.

<rdar://problem/21049838>

llvm-svn: 241695
2015-07-08 18:03:41 +00:00
Duncan P. N. Exon Smith e086afa667 MC: Make MCSubtargetInfo::isCPUStringValid() const, NFC
This method doesn't modify any members, so it should be const.

llvm-svn: 241694
2015-07-08 17:41:53 +00:00
Duncan P. N. Exon Smith ad98745561 MC: Constify MCSubtargetInfo in getDeprecationInfo(), NFC
There's no reason to be able to mutate `MCSubtargetInfo` in
`getDeprecationInfo()`.  Constify the reference.

llvm-svn: 241693
2015-07-08 17:30:55 +00:00
Rafael Espindola 65a9953d69 Inline function into only use.
llvm-svn: 241692
2015-07-08 17:26:24 +00:00
Rafael Espindola c291a4b212 Add a helper function to reduce a bit of code duplication.
llvm-svn: 241691
2015-07-08 17:08:26 +00:00
Adrian Prantl 26686c4af0 Update PCHInternals.rst to document PCH wrapped in object file containers.
llvm-svn: 241690
2015-07-08 16:52:51 +00:00
David Majnemer 2c345a337c COFF: Emit a symbol table if /debug is specified
Providing a symbol table in the executable is quite useful when
debugging a fully-linked executable without having to reconstruct one
from DWARF.

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

llvm-svn: 241689
2015-07-08 16:37:50 +00:00
Sean Callanan c307c27035 Revert r241672, which breaks the OS X build by introducing a dependency on
platform-specific symbols that are not implemented on OS X.

The build error that caused this is

Undefined symbols for architecture x86_64:
  "lldb_private::NativeProcessProtocol::Attach(unsigned long long, lldb_private::NativeProcessProtocol::NativeDelegate&, std::__1::shared_ptr<lldb_private::NativeProcessProtocol>&)", referenced from:
      lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::AttachToProcess(unsigned long long) in liblldb-core.a(GDBRemoteCommunicationServerLLGS.o)
  "lldb_private::NativeProcessProtocol::Launch(lldb_private::ProcessLaunchInfo&, lldb_private::NativeProcessProtocol::NativeDelegate&, std::__1::shared_ptr<lldb_private::NativeProcessProtocol>&)", referenced from:
      lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::LaunchProcess() in liblldb-core.a(GDBRemoteCommunicationServerLLGS.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

llvm-svn: 241688
2015-07-08 16:33:46 +00:00
Eli Bendersky 8e131f8cbc Cosmetic cleanups - NFC
Remove commented lines, trailing whitespace, etc.

llvm-svn: 241687
2015-07-08 16:33:21 +00:00
James Y Knight f238d176eb [SPARC] Cleanup handling of the Y/ASR registers.
- Implement copying ASR to/from GPR regs.
- Mark ASRs as non-allocatable, so it won't try to arbitrarily use
  them inappropriately.
- Instead of inserting explicit WRASR/RDASR nodes in the MUL/DIV
  routines, just do normal register copies.
- Also...mark div as using Y, not just writing it.

Added a test case with some code which previously died with an
assertion failure (with -O0), or produced wrong code (otherwise).

(Third time's the charm?)

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

llvm-svn: 241686
2015-07-08 16:25:12 +00:00
Rafael Espindola 51271bdc4f Use a range loop. NFC.
llvm-svn: 241685
2015-07-08 16:16:15 +00:00
Adrian Prantl dfb9618687 Revert "Fix a linker issue with clang-check on Linux."
This reverts commit r241636 as it turned out to be unnecessary.

llvm-svn: 241684
2015-07-08 15:57:42 +00:00
Krzysztof Parzyszek 21b53a5120 [Hexagon] Generate "insert" instructions more aggressively
llvm-svn: 241683
2015-07-08 14:47:34 +00:00
Krzysztof Parzyszek d19b4767ff Revert 241681: causes Windows builds to fail
llvm-svn: 241682
2015-07-08 14:34:13 +00:00
Krzysztof Parzyszek 712b15b45e [Hexagon] Generate "insert" instructions more aggressively
llvm-svn: 241681
2015-07-08 14:22:27 +00:00
NAKAMURA Takumi e1dc95c6c1 [CMake] clang-check: Prune redundant libdeps introduced in r241653.
llvm-svn: 241680
2015-07-08 14:13:27 +00:00
David Srbecky d515e94070 Tolerate DWARF compile unit without filename.
Summary:
The DW_AT_name attribute of compile unit is optional.
If it is missing, try to get filename from the debug_line section.
This allows the compile unit to be useful without the filename.

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

llvm-svn: 241679
2015-07-08 14:00:04 +00:00
Petar Jovanovic 26a4a40137 [MIPS] Add support for direct-to-nacl in Clang
For Mips direct-to-nacl, the goal is to be close to le32 front-end and
use Mips32EL backend. This patch defines new NaClMips32ELTargetInfo and
modifies it slightly to be close to le32. It also adds necessary parts,
inline with ARM and X86.

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

llvm-svn: 241678
2015-07-08 13:07:31 +00:00
Simon Atanasyan fb1662f563 The LLD tests require 'llvm-lib', ensure that this is built.
llvm-svn: 241676
2015-07-08 11:40:43 +00:00
Simon Atanasyan 22c4c9ee8f [yaml2obj] Align section content using AddressAlign field's value
Use AddressAlign field's value to properly align sections content in the
yaml2obj tool. Before this change the yaml2obj ignored AddressAlign and
always aligned section on 16 bytes boundary.

llvm-svn: 241674
2015-07-08 10:12:40 +00:00
Silviu Baranga 1b6b50a921 [LAA] Merge memchecks for accesses separated by a constant offset
Summary:
Often filter-like loops will do memory accesses that are
separated by constant offsets. In these cases it is
common that we will exceed the threshold for the
allowable number of checks.

However, it should be possible to merge such checks,
sice a check of any interval againt two other intervals separated
by a constant offset (a,b), (a+c, b+c) will be equivalent with
a check againt (a, b+c), as long as (a,b) and (a+c, b+c) overlap.
Assuming the loop will be executed for a sufficient number of
iterations, this will be true. If not true, checking against
(a, b+c) is still safe (although not equivalent).

As long as there are no dependencies between two accesses,
we can merge their checks into a single one. We use this
technique to construct groups of accesses, and then check
the intervals associated with the groups instead of
checking the accesses directly.

Reviewers: anemet

Subscribers: llvm-commits

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

llvm-svn: 241673
2015-07-08 09:16:33 +00:00
Pavel Labath 235c8405eb Avoid going through Platform when creating a NativeProcessProtocol instance
Summary:
This commit avoids the Platform instance when spawning or attaching to a process in lldb-server.
Instead, I have the server call a (static) method of NativeProcessProtocol directly. The reason
for this is that I believe that NativeProcessProtocol should be decoupled from the Platform
(after all, it always knows which platform it is running on, unlike the rest of lldb).
Additionally, the kind of platform actions a NativeProcessProtocol instance is likely to differ
greatly from the platform actions of the lldb client, so I think the separation makes sense.

After this, the only dependency NativeProcessLinux has on PlatformLinux is the ResolveExecutable
method, which needs additional refactoring.

Reviewers: ovyalov, clayborg

Subscribers: lldb-commits

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

llvm-svn: 241672
2015-07-08 09:08:53 +00:00
Simon Pilgrim 752de5dff2 [X86][SSE] Added (V)ROUNDSD + (V)ROUNDSS stack folding support
llvm-svn: 241671
2015-07-08 08:07:57 +00:00
Alexey Bataev 5d49b83020 [EH] Fix for clang bug 24005 - no cleanup for array of memcpy-able objects in struct (patch by Denis Zobnin)
The fix is to emit cleanup for arrays of memcpy-able objects in struct if an exception is thrown later during copy-construction.
Differential Revision: http://reviews.llvm.org/D10989

llvm-svn: 241670
2015-07-08 07:31:02 +00:00
Simon Atanasyan f1eef8025f [yaml2obj] Use regex to match sections offsets. NFC
llvm-svn: 241669
2015-07-08 06:57:24 +00:00
David Majnemer e4752e753f Revert "parser: wordsmith diagnostic message" and "parser: diagnose empty attribute blocks"
This reverts commit r239846 and r239879.  They caused clang's
-fms-extensions behavior to incorrectly parse lambdas and includes a
testcase to ensure we don't regress again.

This issue was found in PR24027.

llvm-svn: 241668
2015-07-08 05:55:00 +00:00
David Majnemer cefbc7cfcb [CodeGen] Correctly handle base classes which are passed in memory
We didn't correctly process the case where a base class is classified as
MEMORY.  This would cause us to trip over an assertion.

This fixes PR24020.

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

llvm-svn: 241667
2015-07-08 05:14:29 +00:00
David Majnemer 699dd04a13 [CodeGen] Don't crash classifying a union of an AVX vector and an int
We forgot to run postMerge after decided that the union had to be
classified as MEMORY.  This left us with Lo == MEMORY and Hi == SSEUp
which is an invalid combination.

This fixes PR24021.

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

llvm-svn: 241666
2015-07-08 05:07:05 +00:00
Karthik Bhat d2bc0d8423 Allow constfolding of llvm.sin.* and llvm.cos.* intrinsics
This patch const folds llvm.sin.* and llvm.cos.* intrinsics whenever feasible.

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

llvm-svn: 241665
2015-07-08 03:55:47 +00:00
NAKAMURA Takumi 4c3ab458a5 SemaDeclObjC.cpp: Escape \@ in comment lines. [-Wdocumentation]
llvm-svn: 241664
2015-07-08 02:35:56 +00:00
NAKAMURA Takumi 58843eede5 Revert r241621, "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working."
It broke the build that relies on LLVM_EXTERNAL_CLANG_*.

llvm-svn: 241663
2015-07-08 02:35:43 +00:00
Richard Smith 7a591a4a46 [modules] When determining the visible module set during template
instantiation, use the set of modules visible from the template definition, not
from whichever declaration the specialization was instantiated from.

llvm-svn: 241662
2015-07-08 02:22:15 +00:00
NAKAMURA Takumi bbe5c4cdcd [CMake] Reorder libdeps. NFC.
llvm-svn: 241661
2015-07-08 02:06:29 +00:00
NAKAMURA Takumi f3fda08a80 [CMake] Fill up required libs, corresponding to r241653.
llvm-svn: 241660
2015-07-08 02:06:21 +00:00
Adrian Prantl 437105a4de llvm-objdump: Replace the -macho -raw option with a generic -raw-clang-ast
option that works with all object container formats.
Now that clang modules/PCH are object containers this option is useful to
to construct pipes like

  llvm-objdump -raw-clang-ast foo.pcm | llvm-bcanalyzer -

to inspect the AST contents in a PCH container.
Will be tested via clang.

Belatedly addresses review feedback for r233390.

llvm-svn: 241659
2015-07-08 02:04:15 +00:00
Rui Ueyama 4e1536c155 COFF: Fix AMD64_SECTION relocation.
llvm-svn: 241658
2015-07-08 01:47:28 +00:00
Rui Ueyama 11863b4ae1 COFF: Support x86 file header and relocations.
llvm-svn: 241657
2015-07-08 01:45:29 +00:00
Adrian Prantl 8c73ba65bb Change the expectation for test/Tooling/ms-asm-no-target.cpp since
clang-check now initializes the available targets to support
clang module containers.

llvm-svn: 241656
2015-07-08 01:39:38 +00:00
Mehdi Amini ffc1402fad Remove IsLittleEndian from TargetLowering and redirect to DataLayout
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: llvm-commits, rafael, yaron.keren

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241655
2015-07-08 01:00:38 +00:00
Mehdi Amini f50daedfc7 Redirect DataLayout from TargetMachine to Module in SjLjEHPrepare
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: yaron.keren, rafael, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241654
2015-07-08 01:00:31 +00:00
Adrian Prantl bc068586ac Revert "Revert r241620 and follow-up commits" and move the initialization
of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp.

llvm-svn: 241653
2015-07-08 01:00:30 +00:00
Jim Ingham 22302e5995 Make command files specified to the driver actually print their
results if the -Q option is not provided.  Also took out the quietly
option from AddInitialCommand, we don't use that to set this option,
we use the override set by the -Q option.

<rdar://problem/21232087>

llvm-svn: 241652
2015-07-08 00:59:59 +00:00
Sean Callanan 007135e612 Fixed the C modules test case on Darwin by streamlining its code.
We don't need to do the fancy dance with checking whether the iterator
represents a #define -- in fact, that's the wrong thing to do.  The thing to do
is check whether the highest-priority module that did something to the module
#defined or #undefd it.  If it #defined it, then the MacroInfo* will be non-NULL
and we're good to go.

llvm-svn: 241651
2015-07-08 00:13:49 +00:00