Commit Graph

204494 Commits

Author SHA1 Message Date
Rui Ueyama 7a247ee242 COFF: Fix a bug that /delayload was case-sensitive.
llvm-svn: 241316
2015-07-03 01:40:14 +00:00
Akira Hatanaka 6f9cfaf85b Make corrections to r241314.
The return type of a function follows the signext attribute.

llvm-svn: 241315
2015-07-03 01:05:19 +00:00
Akira Hatanaka 5720be5e34 Fix test case to appease buildbot.
Test case trap-fnattr.cpp was failng on clang-ppc64-elf-linux2 because ppc64
sign-extends the i32 return value.
 
This is a follow-up to r241306.

llvm-svn: 241314
2015-07-03 00:50:30 +00:00
Rui Ueyama 49d6cd35ad COFF: Fix /base option.
Previously, __ImageBase symbol got a different value than the one
specified by /base:<number> because the symbol was created in the
SymbolTable's constructor. When the constructor is called,
no command line options are processed yet, so the symbol was
created always with the initial value. This caused wrong relocations
and thus caused mysterious crashes of some executables linked by LLD.

llvm-svn: 241313
2015-07-03 00:02:19 +00:00
Nadav Rotem 754eb7c563 Fix an overly aggressive assertion in getCopyFromPartsVector.
The assertion in getCopyFromPartsVector assumed that the vector 'part' must
match the type of argument (arguments are potentially split into multiple
parts). However, in some cases the targets return a 'part' of the right size
but with a different type. We already handle this case correctly later on
and generate a bitcast. This commit just makes sure that we are actually
checking the property that we care about.

llvm-svn: 241312
2015-07-02 23:23:52 +00:00
Rui Ueyama 6be9099140 COFF: Define SymbolTable::insert to simplify. NFC.
llvm-svn: 241311
2015-07-02 22:52:33 +00:00
Justin Bogner 0cd9248d9e Driver: Remove the Job class. NFC
We had a strange relationship here where we made a list of Jobs
inherit from a single Job, but there weren't actually any places where
this arbitrary nesting was used or needed.

Simplify all of this by removing Job entirely and updating all of the
users to either work with a JobList or a single Command.

llvm-svn: 241310
2015-07-02 22:52:08 +00:00
Justin Bogner 94817612e2 Driver: Don't use reserved names. NFC
llvm-svn: 241309
2015-07-02 22:52:04 +00:00
Adrian Prantl 18c073ad6b DIBuilder: Now that DICompileUnit is distinct, stop using temporary nodes
for the arrays.

llvm-svn: 241308
2015-07-02 22:32:52 +00:00
Greg Clayton 374b67144a Improve the packet dumper to be able to read the target.xml so it can dump register values when disassembling the packet log.
llvm-svn: 241307
2015-07-02 22:22:45 +00:00
Akira Hatanaka 85365cd72a Attach attribute "trap-func-name" to call sites of llvm.trap and llvm.debugtrap.
This is needed to use clang's command line option "-ftrap-function" for LTO and
enable changing the trap function name on a per-call-site basis.

rdar://problem/21225723

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

llvm-svn: 241306
2015-07-02 22:15:41 +00:00
Akira Hatanaka 56c70441dc Use function attribute "trap-func-name" and remove TargetOptions::TrapFuncName.
This commit changes normal isel and fast isel to read the user-defined trap
function name from function attribute "trap-func-name" attached to llvm.trap or
llvm.debugtrap instead of from TargetOptions::TrapFuncName. This is needed to
use clang's command line option "-ftrap-function" for LTO and enable changing
the trap function name on a per-call-site basis.

Out-of-tree projects currently using TargetOptions::TrapFuncName to specify the
trap function name should attach attribute "trap-func-name" to the call sites
of llvm.trap and llvm.debugtrap instead.

rdar://problem/21225723

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

llvm-svn: 241305
2015-07-02 22:13:27 +00:00
Akira Hatanaka 5c40eeabef Add functions for adding and testing string attributes to CallInst. NFC.
This change is needed later when I make changes to attach string function
attributes to llvm.trap and llvm.debugtrap.

llvm-svn: 241304
2015-07-02 22:08:48 +00:00
Peter Collingbourne a68d90fa52 UBSan: Enable runtime library tests on Windows, and get most tests passing.
Specifically:

- Disable int128 tests on Windows, as MSVC cl.exe does not support
  int128, so we might not have been able to build the runtime
  with int128 support.

- XFAIL the vptr tests as we lack Microsoft ABI support.

- XFAIL enum.cpp as UBSan fails to add the correct instrumentation code
  for some reason.

- Modify certain tests that build executables multiple times to use
  unique names for each executable. This works around a race condition
  observed on Windows.

- Implement IsAccessibleMemoryRange for Windows to fix the last
  misaligned.cpp test.

- Introduce a substitution for testing crashes on Windows using
  KillTheDoctor.

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

llvm-svn: 241303
2015-07-02 22:08:38 +00:00
Dan Gohman bfaf7e15d1 [WebAssembly] Set the HasFloatingPointExceptions flag for WebAssembly.
llvm-svn: 241302
2015-07-02 21:36:25 +00:00
Rafael Espindola d0212cd46c Try to fix the build of IntelJITEventListener.
llvm-svn: 241301
2015-07-02 21:24:12 +00:00
Benjamin Kramer 642f173ae9 Switch users of the 'for (StmtRange range = stmt->children(); range; ++range)‘ pattern to range for loops.
The pattern was born out of the lack of range-based for loops in C++98
and is somewhat obscure. No functionality change intended.

llvm-svn: 241300
2015-07-02 21:03:14 +00:00
Benjamin Kramer 9c218592c8 [CodeGen] Use llvm::join to simplify string joining.
While there replace stable_sort of std::string with just sort, stability
is not necessary for "simple" value types. No functional change intended.

llvm-svn: 241299
2015-07-02 21:02:39 +00:00
Rafael Espindola cd55286893 Update for llvm changes.
llvm-svn: 241298
2015-07-02 20:55:28 +00:00
Rafael Espindola 5d0c2ffadf Return ErrorOr from SymbolRef::getName.
This function can really fail since the string table offset can be out of
bounds.

Using ErrorOr makes sure the error is checked.

Hopefully a lot of the boilerplate code in tools/* can go away once we have
a diagnostic manager in Object.

llvm-svn: 241297
2015-07-02 20:55:21 +00:00
Justin Bogner 4dc5adc731 InstrProf: Add a comment to clarify an argument
llvm-svn: 241296
2015-07-02 20:47:25 +00:00
Rui Ueyama 7a333c66be COFF: Fix locally-imported symbols.
Previously, pointers pointed by locally-imported symbols were broken.
It has only 4 bytes although the correct size is 8 byte. This patch
fixes that bug.

llvm-svn: 241295
2015-07-02 20:33:50 +00:00
Rui Ueyama 65813edfe2 COFF: Make symbols satisfy weak ordering.
Previously, SymbolBody::compare(A, B) didn't satisfy weak ordering.
There was a case that A < B and B < A could have been true.
This is because we just pick LHS if A and B are consisdered equivalent.

This patch is to make symbols being weakly ordered. If A and B are
not tie, one of A < B && B > A or A > B && B < A is true.
This is not an improtant property for a single-threaded environment
because everything is deterministic anyways. However, in a multi-
threaded environment, this property becomes important.

If a symbol is defined or lazy, ties are resolved by its file index.
For simple types that we don't really care about their identities,
symbols are compared by their addresses.

llvm-svn: 241294
2015-07-02 20:33:48 +00:00
Kit Barton b61173e791 This patch adds support for the vector merge even word and vector merge odd word
instructions introduced in POWER8.

These are the Clang-related changes for http://reviews.llvm.org/D10704

All builtins are added in altivec.h and guarded with the POWER8_VECTOR macro.

Phabricator review: http://reviews.llvm.org/D10736

llvm-svn: 241293
2015-07-02 19:29:05 +00:00
Gabor Horvath 2ed9456015 [Static Analyzer] No longer include the full path of the source file in the single file tests' bug identifiers.
llvm-svn: 241292
2015-07-02 19:20:46 +00:00
Davide Italiano 18960b9bb7 [Sema] Range-loopify SemaTemplateInstantiateDecl.cpp. NFC.
llvm-svn: 241291
2015-07-02 19:20:11 +00:00
Bill Schmidt a1c30053e7 [PPC64LE] Remove implicit-subreg restriction from VSX swap removal
In r241285, I removed the SUBREG_TO_REG restriction from VSX swap
removal, determining that this was overly conservative.  We have
another form of the same restriction in that we check for the presence
of implicit subregs in vector operations.  As with SUBREG_TO_REG for
partial register conversions, an implicit subreg is safe in and of
itself, provided no other operation makes a lane-sensitive assumption
about the result.  This patch removes that restriction, by removing
the HasImplicitSubreg flag and all code that relies on it.

I've added a test case that fails to optimize before this patch is
applied, and optimizes properly with the patch.  Test based on a
report from Anton Blanchard.

llvm-svn: 241290
2015-07-02 19:01:22 +00:00
Bruce Mitchener a868c13c51 Fix typos
Summary: Fixes more typos.

Reviewers: clayborg

Subscribers: lldb-commits-list

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

llvm-svn: 241289
2015-07-02 18:48:40 +00:00
Sanjoy Das b1ca4eb6ae [Statepoints] Make operator bool() explicit.
(Addressing post-commit review.)

llvm-svn: 241288
2015-07-02 18:15:18 +00:00
Ed Maste ae9f2b9b24 Move PlatformFreeBSD to its own namespace
Based on r233679

llvm-svn: 241287
2015-07-02 17:35:22 +00:00
Rafael Espindola 03e23121f8 Remove a report_fatal_error that should be unreachable.
If we created a relocation iterator, we have a valid relocation section.

llvm-svn: 241286
2015-07-02 17:16:07 +00:00
Bill Schmidt 7c691fee1c [PPC64LE] Teach swap optimization about the doubleword splat idiom
With a previous patch, the VSX swap optimization is able to recognize
the doubleword load-splat idiom that can be implemented using lxvdsx.
However, that does not cover a doubleword splat where the source is a
register.  We can implement this using xxspltd (a special form of
xxpermdi).  This patch teaches the swap optimization pass about this
idiom.

As a prerequisite, it also permits swap optimization to succeed for
all forms of SUBREG_TO_REG.  Previously we were conservative and only
allowed SUBREG_TO_REG when it copied a full register.  However, on
reflection any form of SUBREG_TO_REG is safe in and of itself, so long
as an unsafe operation is not performed on its result.  In particular,
a widening SUBREG_TO_REG often occurs as an input to a doubleword
splat idiom, particularly in auto-vectorized code.

The doubleword splat idiom is an XXPERMDI operation where both source
registers are identical, and the selection mask is either 0 (splat the
first element) or 3 (splat the second element).  To determine whether
the registers are identical, we use the existing mechanism for looking
through "copy-like" operations.  That mechanism has a side effect of
marking the XXPERMDI operation as using a physical register, which
would invalidate its presence in a swap-optimized region.  This is
correct for the form of XXPERMDI that performs a swap and hence would
be removed, but is not what we want for a doubleword-splat variety of
XXPERMDI.  Therefore we reset the physical-register flag on the
XXPERMDI when it represents a splat.

A simple test case is added to verify that we generate the splat and
that we also remove the xxswapd instructions that would otherwise be
associated with the load and store of another operand.

llvm-svn: 241285
2015-07-02 17:03:06 +00:00
Rafael Espindola 2cd195166f Convert a member variable to a local one.
llvm-svn: 241284
2015-07-02 16:59:57 +00:00
Gabor Ballabas 5fe650c5e1 Reworking the test part of r241149
The test part of r241149 has been reverted in r241451, due to misplaced test cases.
This patch splits those test cases among the appropriate targets.

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

llvm-svn: 241283
2015-07-02 16:53:23 +00:00
Greg Clayton d6171a74f0 Make sure we can lookup re-exported symbols after recent changes to lldb_private::Symbol.
Recently lldb_private::Symbol was changed so the old code:

Address &Symbol::GetAddress();

Is now:

Address Symbol::GetAddress();

And the Address object that is returned will be invalid for non-address based symbols. When we have re-exported symbols this code would now fail:

    const Address sym_address = sym_ctx.symbol->GetAddress();

    if (!sym_address.IsValid())
        continue;

    symbol_load_addr = sym_ctx.symbol->ResolveCallableAddress(*target_sp);

    if (symbol_load_addr == LLDB_INVALID_ADDRESS)
    {
        symbol_load_addr = sym_address.GetLoadAddress(target_sp.get());
    }

It used to return an Address reference to the value of the re-exported symbol that contained no section and a zero value for Address.m_offset (since the original symbol in the symbol table had a value of zero). When a reference was returned, this meant the "sym_address.IsValid()" would return true because the Address.m_offset was not LLDB_INVALID_ADDRESS, it was zero. This was working by mistake.

The Symbol::ResolveCallableAddress(...) actually checks for reexported symbols and whole bunch of other cases and resolves the address correctly, so we should let it do its thing and not cut it off before it can resolve the address with the "if (!sym_address.IsValid()) continue;".

llvm-svn: 241282
2015-07-02 16:43:49 +00:00
Rafael Espindola 4e7212177f Fix for PR23310: llvm-dis crashes when trying to upgrade an intrinsic.
When trying to upgrade @llvm.x86.sse2.psrl.dq while parsing a module,
BitcodeReader adds the function to its worklist twice, resulting in a
crash when accessing it the second time.

This patch replaces the worklist vector by a map.

Patch by Philip Pfaffe.

llvm-svn: 241281
2015-07-02 16:22:40 +00:00
Rafael Espindola d80c526e74 Handle .dynsym a bit more like we handle .symtab.
They have the same format and we find them in the same way, no reason to handle
them differently.

llvm-svn: 241280
2015-07-02 16:03:38 +00:00
Rafael Espindola 86e3340f31 Rangify some loops.
Patch by Philip Pfaffe!

llvm-svn: 241279
2015-07-02 15:55:09 +00:00
Leny Kholodov ca95120f05 Fix linking issue after r241271 (dbghelp.lib was removed from default dependencies on Windows)
llvm-svn: 241278
2015-07-02 15:54:13 +00:00
Rafael Espindola 668048cea7 Use default member initializes. NFC.
llvm-svn: 241277
2015-07-02 15:48:05 +00:00
Chaoren Lin 7755b29108 Remove outdated comment.
llvm-svn: 241276
2015-07-02 15:30:59 +00:00
Rafael Espindola 5ab8e2e85c Revert "Refactored ARMTargetInfo in order to use the API of llvm/lib/Support/TargetParser.cpp for extracting target specific information."
This reverts commit r241267. Tests were failing on the bots.

llvm-svn: 241275
2015-07-02 15:14:10 +00:00
Simon Atanasyan b28f504226 [ELF] Remove dead code. NFC
llvm-svn: 241274
2015-07-02 15:04:08 +00:00
Daniel Jasper f144620cc1 clang-format: [JS] Treat regex literals like string literals.
Using the token type "unknown" can interfere badly with
WhitespaceManager's way of handling multiline comments.

llvm-svn: 241273
2015-07-02 15:00:44 +00:00
Yaron Keren 07d4496ab7 Remove whitespace from start of line, NFC.
llvm-svn: 241272
2015-07-02 14:44:35 +00:00
Leny Kholodov bebb27b0d2 [Support] Lazy load of dbghlp.dll on Windows
This patch changes linkage with dbghlp.dll for clang from static (at load time)
to on demand (at the first use of required functions). Clang uses dbghlp.dll
only in minor use-cases. First of all in case of crash and in case of plugin load.
The dbghlp.dll library can be absent on system. In this case clang will fail
to load. With lazy load of dbghlp.dll clang can work even if dbghlp.dll
is not available.

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

llvm-svn: 241271
2015-07-02 14:34:57 +00:00
Michael Kuperstein 16d307fb80 [X86] Convert an instruction relaxation test to use objdump instead of readobj
Patch by: david.l.kreitzer@intel.com

llvm-svn: 241270
2015-07-02 14:27:35 +00:00
Rafael Espindola e7b37f1401 Move error checking from once per relocation to once per relocation section.
llvm-svn: 241269
2015-07-02 14:27:07 +00:00
Yaron Keren 6967cbb319 Remove whitespace from start of line, NFC.
llvm-svn: 241268
2015-07-02 14:25:09 +00:00
Alexandros Lamprineas ec44b157f1 Refactored ARMTargetInfo in order to use the API of llvm/lib/Support/TargetParser.cpp
for extracting target specific information.

Change-Id: Ia0b83ecdb8d9223f9c4ef38dd9206969f78e53f3
llvm-svn: 241267
2015-07-02 14:21:40 +00:00