Commit Graph

202552 Commits

Author SHA1 Message Date
Colin LeMahieu 229a1e69fc Teaching llvm-mc how to understand the defsym command line option. This allows integer-constant symbols to be defined on the command line and used during assembly.
llvm-svn: 239240
2015-06-07 01:46:24 +00:00
Rui Ueyama 4b22fa7437 COFF: Move Windows-specific code from Chunk.{cpp,h} to DLL.{cpp,h}.
llvm-svn: 239239
2015-06-07 01:15:04 +00:00
Rui Ueyama ad66098c20 COFF: Fix default output file path.
Default output filename is the same as the first object file's
name with its extension replaced with ".exe".

llvm-svn: 239238
2015-06-07 00:20:32 +00:00
Rui Ueyama 4a9fbbca9f COFF: Add comments and move main function to the top. NFC.
llvm-svn: 239237
2015-06-06 23:32:08 +00:00
Rui Ueyama cc608e4f35 COFF: Rename writeHeader -> writeHeaderTo.
Chunk has writeTo function which takes uint8_t *Buf.
writeHeaderTo feels more consistent with that because this member
function also takes uint8_t *Buf.

llvm-svn: 239236
2015-06-06 23:19:38 +00:00
Rui Ueyama 929d8c52b1 COFF: Inline a constant that is used only once.
llvm-svn: 239235
2015-06-06 23:19:36 +00:00
Rui Ueyama e56f9c0883 Remove redundant `using namespace`.
llvm-svn: 239234
2015-06-06 23:11:39 +00:00
Rui Ueyama 55168c9f70 COFF: Add .didat section.
llvm-svn: 239233
2015-06-06 23:07:01 +00:00
Rui Ueyama 458df98869 COFF: Update comments.
llvm-svn: 239232
2015-06-06 22:56:55 +00:00
Davide Italiano fa1a31eec6 [Object/ELF] Provide helpers for symbol types.
These were, originally, in a different form in lld.
They can be reused for other tools, e.g. llvm-readobj.

llvm-svn: 239231
2015-06-06 22:54:09 +00:00
Rui Ueyama c6ea057d7f COFF: Move .idata constructor from Writer to Chunk.
Previously, half of the constructor for .idata contents was in Chunks.cpp
and the rest was in Writer.cpp. This patch moves the latter to Chunks.cpp.
Now IdataContents class manages everything for .idata section.

llvm-svn: 239230
2015-06-06 22:46:15 +00:00
David Majnemer 3f0fb98d01 [InstCombine, InstSimplify] Move xforms from Combine to Simplify
There were several SelectInst combines that always returned an existing
instruction instead of modifying an old one or creating a new one.
These are prime candidates for moving to InstSimplify.

llvm-svn: 239229
2015-06-06 22:40:21 +00:00
Filipe Cabecinhas a911af0e8c Use early return idiom. NFC
llvm-svn: 239228
2015-06-06 20:44:53 +00:00
Colin LeMahieu 1c8c213529 [MC] Common symbols weren't being checked for redeclaration which allowed an assembly file to generate an assertion in setCommon(): !isCommon(). This change allows redeclaration as long as the size and alignment match exactly, otherwise report a fatal error.
llvm-svn: 239227
2015-06-06 20:12:40 +00:00
Simon Atanasyan 253fd15977 [Mips] Factor out some bit manipulation code into separate routines
No functional changes.

llvm-svn: 239226
2015-06-06 17:26:35 +00:00
Simon Atanasyan c859644f67 [Mips] Check symbol alignment for some MIPS relocations.
llvm-svn: 239225
2015-06-06 17:26:28 +00:00
Simon Atanasyan 439af8550e [Mips] Perform an overflow checking for relocations results
llvm-svn: 239224
2015-06-06 17:26:18 +00:00
Simon Atanasyan 26b1c4584d [Mips] Rearrange relocation related cases in the `switch` operator
No functional changes.

llvm-svn: 239223
2015-06-06 17:26:09 +00:00
Simon Atanasyan e801f43655 [Mips] Use signed/unsigned types in relocation calculations consistently
No functional changes.

llvm-svn: 239222
2015-06-06 17:26:04 +00:00
Simon Atanasyan 6d19105c1d [Mips] Handle all grouped relocations in a uniform way
No functional changes.

llvm-svn: 239221
2015-06-06 17:25:58 +00:00
Chaoren Lin bcd2786a6d Use skipIf instead of skipUnless in TestTerminal for better readability.
llvm-svn: 239220
2015-06-06 14:51:34 +00:00
Tobias Grosser 6091417ebc Add NVIDIA vprintf printing to RuntimeDebugBuilder
llvm-svn: 239219
2015-06-06 08:43:22 +00:00
Sanjoy Das ad714b1af3 [LoopUnroll] Fix truncation bug in canUnrollCompletely.
Summary:
canUnrollCompletely takes `unsigned` values for `UnrolledCost` and
`RolledDynamicCost` but is passed in `uint64_t`s that are silently
truncated.  Because of this, when `UnrolledSize` is a large integer
that has a small remainder with UINT32_MAX, LLVM tries to completely
unroll loops with high trip counts.

Reviewers: mzolotukhin, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 239218
2015-06-06 05:24:10 +00:00
David Majnemer 1c297e66fb [CVP] Don't assume Constants of type i1 can be known to be true or false
CVP wants to analyze the condition operand of a select along an edge.
It succeeds in getting back a Constant but not a ConstantInt.  Instead,
it gets a ConstantExpr.  It then assumes that the Constant must be equal
to false because it isn't equal to true.

Instead, perform an additional comparison.

This fixes PR23752.

llvm-svn: 239217
2015-06-06 04:56:51 +00:00
Rui Ueyama 743afa0736 COFF: Merge Chunk::applyRelocations with Chunk::writeTo.
In this design, Chunk is the only thing that knows how to write
its contents to output file as well as how to apply relocations
there. The writer shouldn't know about the details.

llvm-svn: 239216
2015-06-06 04:07:39 +00:00
David Majnemer 468f670021 [InstCombine] Don't miscompile select to poison
If we have (select a, b, c), it is sometimes valid to simplify this to a
single select operand.  However, doing so is only valid if the
computation doesn't inject poison into the computation.

It might be helpful to consider the following example:
  (select (icmp ne %i, INT_MAX), (add nsw %i, 1), INT_MIN)

The select is equivalent to (add %i, 1) but not (add nsw %i, 1).

Self hosting on x86_64 revealed that this occurs very, very rarely so
bailing out is hopefully pretty reasonable.

llvm-svn: 239215
2015-06-06 02:30:43 +00:00
Rafael Espindola f3d49b30b5 Handle 16 bit PC relative relocations.
Fixes pr23771.

llvm-svn: 239214
2015-06-06 02:29:56 +00:00
Peter Collingbourne 8a484c3017 clang-cl: Implement /GL in terms of -flto.
No documentation yet; the linker needs more work.

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

llvm-svn: 239213
2015-06-06 02:09:34 +00:00
Peter Collingbourne ace2f091fd COFF: Read linker directives from bitcode files.
Differential Revision: http://reviews.llvm.org/D10285

llvm-svn: 239212
2015-06-06 02:00:45 +00:00
NAKAMURA Takumi 1781a687e7 TargetParser: Fix comments in enum(s) introduced in r239150. [-Wdocumentation]
llvm-svn: 239211
2015-06-06 01:41:35 +00:00
Craig Topper f4b449cec2 [TableGen] Change OpInit::getNumOperands and getOperand to use unsigned integers. NFC
llvm-svn: 239210
2015-06-06 01:34:04 +00:00
Craig Topper 1af1566ce6 [TableGen] Remove trailing whitespace, add space between 'if' and paren, other formatting fixes. NFC
llvm-svn: 239209
2015-06-06 01:34:01 +00:00
Craig Topper 5a2dfdcd20 [TableGen] Remove unnecessary temporary. NFC
llvm-svn: 239208
2015-06-06 01:34:00 +00:00
Craig Topper 5904beb666 [TableGen] Fold variable declaration/initialization into if condition for a couple short lived variables. NFC
llvm-svn: 239207
2015-06-06 01:33:58 +00:00
Craig Topper daf263de84 [TableGen] Remove unnecessary outer 'if' and merge it's conditions into the inner 'if's. NFC
llvm-svn: 239206
2015-06-06 01:33:55 +00:00
Craig Topper 25a849ca02 [TableGen] Fold variable declarations with their assignments. NFC
llvm-svn: 239205
2015-06-06 00:44:45 +00:00
Craig Topper 6d4e8e3218 [TableGen] Correct the documentation for 'foreach' in the Language Intro.
llvm-svn: 239204
2015-06-06 00:44:42 +00:00
Chaoren Lin 5d76b1b56e Fix TestAttachDenied and TestChangeProcessGroup for remote Windows to Android.
Summary: Updated `append_to_remote_wd` to work for both remote and local.

Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 239203
2015-06-06 00:25:50 +00:00
Chaoren Lin 05763f5752 Update TestGdbRemoteAbort and TestGdbRemoteSegFault to use `get_signal_number`.
Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 239201
2015-06-06 00:19:01 +00:00
Frederic Riss 123303122d [dsymutil] Fix misspelled CHECK line.
llvm-svn: 239200
2015-06-05 23:46:18 +00:00
Pavel Labath 83a4b3f225 Remove unused editline includes
LLDB included editline in a couple of places, not respecting LLDB_DISABLE_LIBEDIT. As far as I can tell, these includes are not used, so I am removing them.

llvm-svn: 239199
2015-06-05 23:14:14 +00:00
Frederic Riss 5a642079d7 [dsymutil] Add support for linking the debug_frame section.
Linking the debug frame section is actually very easy as we just have to
patch the start address in the FDE header and then copy the rest of the
FDE without even looking at it. The only small complexity comes from the
handling of the CIEs that we should unique across object file. This is
also really easy by using a StringMap keyed on the raw contents of the
CIE.

llvm-svn: 239198
2015-06-05 23:06:11 +00:00
David Majnemer 8423df927e Move a test from static-assert.cpp to DeclPrinterTest
It's better not to rely on the diagnostics engine to pretty print the
argument to decltype.  Instead, exercise the functionality in
DeclPrinterTest.

llvm-svn: 239197
2015-06-05 22:40:53 +00:00
Marshall Clow b41e76bb0b Fix PR#23767. Add tests for iterator invalidation for deque::erase/pop_front/pop_back
llvm-svn: 239196
2015-06-05 22:34:19 +00:00
Chaoren Lin 55c1c3495d Fix TestNamespace and TestThreadJump for remote Windows to Android.
Summary:
Update DYLDRendezvous and SOEntry to use FileSpecs instead of storing paths as
strings, which caused incorrect comparison results due to denormalization.

Reviewers: clayborg, vharron, ovyalov

Reviewed By: ovyalov

Subscribers: jwolfe, emaste, tberghammer, lldb-commits

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

llvm-svn: 239195
2015-06-05 22:03:19 +00:00
Eric Christopher 56df435693 Fix typo of function name.
llvm-svn: 239194
2015-06-05 22:03:01 +00:00
Eric Christopher 162c91ccc4 Rename the single non-style conformant function in TargetCodeGenInfo
and update all callers.

llvm-svn: 239193
2015-06-05 22:03:00 +00:00
Akira Hatanaka c100c56a20 Move the code in TargetPassConfig::addPass that inserts machine printer pass to
the overloaded version of addPass which takes Pass*.

This change enables inserting the machine printer pass when the overloaded
version of addPass that takes Pass* is called to add a pass, instead of the
one which takes AnalysisID. I need this to prevent make-check tests from
failing when I commit another patch later.

llvm-svn: 239192
2015-06-05 21:58:14 +00:00
Frederic Riss a81e88141e [dsymutil] Rename a variable to appease some bots.
Anyway having the type and the name of the member being the same
thing wasn't the wisest of the choices.

llvm-svn: 239190
2015-06-05 21:21:57 +00:00
Frederic Riss 4f5874a51f [dsymutil] Have the YAML deserialization rewrite the object address of symbols.
The main use of the YAML debug map format is for testing inside LLVM. If we have IR
files in the tests used to generate object files, then we obviously don't know the
addresses of the symbols inside the object files beforehand.

This change lets the YAML import lookup the addresses in the object files and rewrite
them. This will allow to have test that really don't need any binary input.

llvm-svn: 239189
2015-06-05 21:12:07 +00:00