platform/upstream/llvm.git
9 years agoDocs: give binutils/gold instructions for CMake too.
Tim Northover [Tue, 4 Nov 2014 02:16:03 +0000 (02:16 +0000)]
Docs: give binutils/gold instructions for CMake too.

Patch by Steve King.

llvm-svn: 221227

9 years agoRevert "Transforms: reapply SVN r219899"
Reid Kleckner [Tue, 4 Nov 2014 02:02:14 +0000 (02:02 +0000)]
Revert "Transforms: reapply SVN r219899"

This reverts commit r220811 and r220839. It made an incorrect change to
musttail handling.

llvm-svn: 221226

9 years ago[TSan] Don't strip binary/library name until the moment we print it.
Alexey Samsonov [Tue, 4 Nov 2014 01:55:20 +0000 (01:55 +0000)]
[TSan] Don't strip binary/library name until the moment we print it.

This commit changes the place where TSan runtime turns full path
to binary or shared library into its basename
(/usr/foo/mybinary -> mybinary). Instead of doing it as early as possible
(when we obtained the full path from the symbolizer), we now do it as
late as possible (right before printing the error report).

This seems like a right thing to do - stripping to basename is a detail
of report formatting implementation, and should belong there. Also, we
might need the full path at some point - for example, to match the
suppressions.

llvm-svn: 221225

9 years agoAdd test for type properties of std::reference_wrapper
Eric Fiselier [Tue, 4 Nov 2014 01:54:44 +0000 (01:54 +0000)]
Add test for type properties of std::reference_wrapper

llvm-svn: 221224

9 years agoRemove setPreservesCFG from instcombine. The pass, in particular, does not
Mark Heffernan [Tue, 4 Nov 2014 01:51:01 +0000 (01:51 +0000)]
Remove setPreservesCFG from instcombine.  The pass, in particular, does not
preserve LoopSimplify because instcombine may replace branch predicates
with undef which loop simplify then replaces with always exit.  Replace
setPreservesCFG with the more constrained preservation of DomTree and
LoopInfo.

llvm-svn: 221223

9 years ago[llvm-api-change] Use findProgramByName.
Michael J. Spencer [Tue, 4 Nov 2014 01:30:55 +0000 (01:30 +0000)]
[llvm-api-change] Use findProgramByName.

llvm-svn: 221222

9 years agoUse findProgramByName.
Michael J. Spencer [Tue, 4 Nov 2014 01:29:59 +0000 (01:29 +0000)]
Use findProgramByName.

llvm-svn: 221221

9 years ago[Support][Program] Add findProgramByName(Name, OptionalPaths)
Michael J. Spencer [Tue, 4 Nov 2014 01:29:29 +0000 (01:29 +0000)]
[Support][Program] Add findProgramByName(Name, OptionalPaths)

llvm-svn: 221220

9 years agoUse the LLVM_GNUC_PREREQ macro instead of the longhand version check
Reid Kleckner [Tue, 4 Nov 2014 01:28:33 +0000 (01:28 +0000)]
Use the LLVM_GNUC_PREREQ macro instead of the longhand version check

llvm-svn: 221219

9 years agoRemove the END_WITH_NULL macro now that Clang doesn't use it
Reid Kleckner [Tue, 4 Nov 2014 01:15:53 +0000 (01:15 +0000)]
Remove the END_WITH_NULL macro now that Clang doesn't use it

llvm-svn: 221218

9 years agoUse the new LLVM_END_WITH_NULL name
Reid Kleckner [Tue, 4 Nov 2014 01:13:43 +0000 (01:13 +0000)]
Use the new LLVM_END_WITH_NULL name

llvm-svn: 221217

9 years agoRemove the static version of getScatteredRelocationType() now that r221211 added
Kevin Enderby [Tue, 4 Nov 2014 01:12:39 +0000 (01:12 +0000)]
Remove the static version of getScatteredRelocationType() now that r221211 added
a public version MachOObjectFile::getScatteredRelocationType().

This should fix the build bot for the unused function error.

llvm-svn: 221216

9 years agoRename END_WITH_NULL to LLVM_END_WITH_NULL and move to Compiler.h
Reid Kleckner [Tue, 4 Nov 2014 01:12:21 +0000 (01:12 +0000)]
Rename END_WITH_NULL to LLVM_END_WITH_NULL and move to Compiler.h

We shouldn't put this kind of attribute stuff in DataTypes.h.

Leave the END_WITH_NULL name for now so I can update clang without
making build spam.

llvm-svn: 221215

9 years agoThe patchpoint lowering logic would crash with live constants equal to
Sanjoy Das [Tue, 4 Nov 2014 00:59:21 +0000 (00:59 +0000)]
The patchpoint lowering logic would crash with live constants equal to
the tombstone or empty keys of a DenseMap<int64_t, T>.  This patch
fixes the issue (and adds a tests case).

llvm-svn: 221214

9 years agoFixed SBTarget::ReadMemory() to work correctly and the TestTargetAPI.py test case...
Greg Clayton [Tue, 4 Nov 2014 00:56:30 +0000 (00:56 +0000)]
Fixed SBTarget::ReadMemory() to work correctly and the TestTargetAPI.py test case that was reading target memory in TargetAPITestCase.test_read_memory_with_dsym and TargetAPITestCase.test_read_memory_with_dwarf.

The problem was that SBTarget::ReadMemory() was making a new section offset lldb_private::Address by doing:

size_t
SBTarget::ReadMemory (const SBAddress addr,
                      void *buf,
                      size_t size,
                      lldb::SBError &error)
{
        ...
        lldb_private::Address addr_priv(addr.GetFileAddress(), NULL);
        bytes_read = target_sp->ReadMemory(addr_priv, false, buf, size, err_priv);

This is wrong. If you get the file addresss from the "addr" argument and try to read memory using that, it will think the file address is a load address and it will try to resolve it accordingly. This will work fine if your executable is loaded at the same address (no slide), but it won't work if there is a slide.

The fix is to just pass along the "addr.ref()" instead of making a new addr_priv as this will pass along the lldb_private::Address that is inside the SBAddress (which is what we want), and not always change it into something that becomes a load address (if we are running), or abmigious file address (think address zero when you have 150 shared libraries that have sections that start at zero, which one would you pick). The main reason for passing a section offset address to SBTarget::ReadMemory() is so you _can_ read from the actual section + offset that is specified in the SBAddress.

llvm-svn: 221213

9 years agoPECOFF: Use the string table for long section names in EXEs/DLLs
David Majnemer [Tue, 4 Nov 2014 00:53:57 +0000 (00:53 +0000)]
PECOFF: Use the string table for long section names in EXEs/DLLs

Normally, PE files have section names of eight characters or less.
However, this is problematic for DWARF because DWARF section names are
things like .debug_aranges.

Instead of truncating the section name, redirect the section name into
the string table.

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

llvm-svn: 221212

9 years agoAdd the code and test cases for 32-bit Intel to llvm-objdump’s Mach-O symbolizer.
Kevin Enderby [Tue, 4 Nov 2014 00:43:16 +0000 (00:43 +0000)]
Add the code and test cases for 32-bit Intel to llvm-objdump’s Mach-O symbolizer.

llvm-svn: 221211

9 years ago[Hexagon] Reverting 220584 to address ASAN errors.
Colin LeMahieu [Tue, 4 Nov 2014 00:14:36 +0000 (00:14 +0000)]
[Hexagon] Reverting 220584 to address ASAN errors.

llvm-svn: 221210

9 years agoChange logic in StackMaps::recordStackMapOpers to use the isInt<32>
Sanjoy Das [Tue, 4 Nov 2014 00:06:57 +0000 (00:06 +0000)]
Change logic in StackMaps::recordStackMapOpers to use the isInt<32>
predicate instead of bitwise operations.

This is not a functional change.

llvm-svn: 221209

9 years agoAdded a test case for reading ivars from the
Sean Callanan [Tue, 4 Nov 2014 00:06:34 +0000 (00:06 +0000)]
Added a test case for reading ivars from the
Objective-C runtime.  We'll need to do more
(subclasses, partially-defined classes, etc.)
but this tests that at least the basics work.

llvm-svn: 221208

9 years agoImplement a framework for live debugging on Windows.
Zachary Turner [Tue, 4 Nov 2014 00:00:12 +0000 (00:00 +0000)]
Implement a framework for live debugging on Windows.

When processes are launched for debugging on Windows now, LLDB
will detect changes such as DLL loads and unloads, breakpoints,
thread creation and deletion, etc.

These notifications are not yet propagated to LLDB in a way that
LLDB understands what is happening with the process.  This only
picks up the notifications from the OS in a way that they can be
sent to LLDB with subsequent patches.

Reviewed by: Scott Graham

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

llvm-svn: 221207

9 years agoLower __builtin_fabs* to @llvm.fabs.*
Reid Kleckner [Mon, 3 Nov 2014 23:52:09 +0000 (23:52 +0000)]
Lower __builtin_fabs* to @llvm.fabs.*

mingw64's headers implement fabs by calling __builtin_fabs, so using the
library call results in an infinite loop. If the backend legalizes
@llvm.fabs as a call to fabs later, things should work out, as the crt
provides a definition.

llvm-svn: 221206

9 years agoRemove dead AST type argument to EmitFAbs
Reid Kleckner [Mon, 3 Nov 2014 23:51:40 +0000 (23:51 +0000)]
Remove dead AST type argument to EmitFAbs

llvm-svn: 221205

9 years agoRename variables to conform to llvm coding standards.
Akira Hatanaka [Mon, 3 Nov 2014 23:24:10 +0000 (23:24 +0000)]
Rename variables to conform to llvm coding standards.

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

llvm-svn: 221204

9 years agoUse AA in LoadCombine
Hal Finkel [Mon, 3 Nov 2014 23:19:16 +0000 (23:19 +0000)]
Use AA in LoadCombine

LoadCombine can be smarter about aborting when a writing instruction is
encountered, instead of aborting upon encountering any writing instruction, use
an AliasSetTracker, and only abort when encountering some write that might
alias with the loads that could potentially be combined.

This was originally motivated by comments made (and a test case provided) by
David Majnemer in response to PR21448. It turned out that LoadCombine was not
responsible for that PR, but LoadCombine should also be improved so that
unrelated stores (and @llvm.assume) don't interrupt load combining.

llvm-svn: 221203

9 years agoUse common range handling for the CU's ranges
David Blaikie [Mon, 3 Nov 2014 23:10:59 +0000 (23:10 +0000)]
Use common range handling for the CU's ranges

This generalizes the range handling for ranges in both the skeleton and
full unit, laying the foundation for the addition of more ranges (rather
than just the CU's special case) in the skeleton CU with fission+gmlt.

llvm-svn: 221202

9 years agoFix this test to set a breakpoint at the correct location that will always get hit...
Greg Clayton [Mon, 3 Nov 2014 23:10:56 +0000 (23:10 +0000)]
Fix this test to set a breakpoint at the correct location that will always get hit so it doesn't intermittently fail on MacOSX.

llvm-svn: 221201

9 years agoRemove local handling of ASAN_OPTIONS and UBSAN_OPTIONS.
Rafael Espindola [Mon, 3 Nov 2014 23:09:25 +0000 (23:09 +0000)]
Remove local handling of ASAN_OPTIONS and UBSAN_OPTIONS.

They are now forwarded by TestingConfig.py.

llvm-svn: 221200

9 years ago[AArch64] Make function processLogicalImmediate more efficient. NFC.
Akira Hatanaka [Mon, 3 Nov 2014 23:06:31 +0000 (23:06 +0000)]
[AArch64] Make function processLogicalImmediate more efficient. NFC.

llvm-svn: 221199

9 years agoHandle ASAN_OPTIONS and UBSAN_OPTIONS in TestingConfig.py
Rafael Espindola [Mon, 3 Nov 2014 23:04:56 +0000 (23:04 +0000)]
Handle ASAN_OPTIONS and UBSAN_OPTIONS in TestingConfig.py

Currently they are passed to tests of llvm itself, but not, for example, lld.

With this patch the options are visible in every test.

llvm-svn: 221198

9 years agoFixed a test suite error on MacOSX where people were using ".data" as the data sectio...
Greg Clayton [Mon, 3 Nov 2014 23:02:08 +0000 (23:02 +0000)]
Fixed a test suite error on MacOSX where people were using ".data" as the data section name for all file formats. Instead fix the test by finding the section by section type so the test is agnostic to the file format (and passes on MacOSX).

llvm-svn: 221197

9 years agoFixed a test suite error on MacOSX where people were using ".data" as the data sectio...
Greg Clayton [Mon, 3 Nov 2014 22:58:38 +0000 (22:58 +0000)]
Fixed a test suite error on MacOSX where people were using ".data" as the data section name for all file formats. Instead fix the test by finding the section by section type so the test is agnostic to the file format (and passes on MacOSX).

llvm-svn: 221196

9 years ago[TSan] Remove bogus unused global variables
Alexey Samsonov [Mon, 3 Nov 2014 22:46:13 +0000 (22:46 +0000)]
[TSan] Remove bogus unused global variables

llvm-svn: 221195

9 years ago[TSan] Use StackTrace from sanitizer_common where applicable
Alexey Samsonov [Mon, 3 Nov 2014 22:23:44 +0000 (22:23 +0000)]
[TSan] Use StackTrace from sanitizer_common where applicable

Summary:
This change removes `__tsan::StackTrace` class. There are
now three alternatives:
  # Lightweight `__sanitizer::StackTrace`, which doesn't own a buffer
  of PCs. It is used in functions that need stack traces in read-only
  mode, and helps to prevent unnecessary allocations/copies (e.g.
  for StackTraces fetched from StackDepot).
  # `__sanitizer::BufferedStackTrace`, which stores buffer of PCs in
  a constant array. It is used in TraceHeader (non-Go version)
  # `__tsan::VarSizeStackTrace`, which owns buffer of PCs, dynamically
  allocated via TSan internal allocator.

Test Plan: compiler-rt test suite

Reviewers: dvyukov, kcc

Reviewed By: kcc

Subscribers: llvm-commits, kcc

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

llvm-svn: 221194

9 years ago[TSan} Build Go version with -std=c++11
Alexey Samsonov [Mon, 3 Nov 2014 22:18:12 +0000 (22:18 +0000)]
[TSan} Build Go version with -std=c++11

llvm-svn: 221192

9 years agorefactor duplicated code. NFC.
Rafael Espindola [Mon, 3 Nov 2014 22:17:49 +0000 (22:17 +0000)]
refactor duplicated code. NFC.

llvm-svn: 221191

9 years ago[TSan] Fix signed-compare warning in the unit test
Alexey Samsonov [Mon, 3 Nov 2014 22:17:39 +0000 (22:17 +0000)]
[TSan] Fix signed-compare warning in the unit test

llvm-svn: 221190

9 years agoRevert "Temporary disable formatting error"
Tobias Grosser [Mon, 3 Nov 2014 22:11:20 +0000 (22:11 +0000)]
Revert "Temporary disable formatting error"

This reverts commit r221159, as clang-format is again back to its old behaviour
and we do not cause any buildbot error messages any more.

llvm-svn: 221189

9 years agoMove the no-prototype calling conv check after decl merging
Reid Kleckner [Mon, 3 Nov 2014 21:56:03 +0000 (21:56 +0000)]
Move the no-prototype calling conv check after decl merging

Now we don't warn on this code:
  void __stdcall f(void);
  void __stdcall f();

My previous commit regressed this functionality because I didn't update
the relevant test case which used a definition.

llvm-svn: 221188

9 years agoInstCombine: Remove infinite loop caused by FoldOpIntoPhi
David Majnemer [Mon, 3 Nov 2014 21:55:12 +0000 (21:55 +0000)]
InstCombine: Remove infinite loop caused by FoldOpIntoPhi

FoldOpIntoPhi could create an infinite loop if the PHI could potentially
reach a BB it was considering inserting instructions into.  The
instructions it would insert would eventually lead to other combines
firing which would, again, lead to FoldOpIntoPhi firing.

The solution is to handicap FoldOpIntoPhi so that it doesn't attempt to
insert instructions that the PHI might reach.

This fixes PR21377.

llvm-svn: 221187

9 years agoPush the CURangeList down into the skeleton CU (where available) rather than the...
David Blaikie [Mon, 3 Nov 2014 21:52:56 +0000 (21:52 +0000)]
Push the CURangeList down into the skeleton CU (where available) rather than the full CU

So that it may be shared between skeleton/full compile unit, for CU
ranges and other ranges to be added for fission+gmlt.

(at some point we might want some kind of object shared between the
skeleton and full compile units for all those things we only want one of
in that scope, rather than having the full unit always look through to
the skeleton... - alternatively, we might be able to have the skeleton
pointer (or another, separate pointer) point to the skeleton or to the
unit itself in non-fission, so we don't have to special case its
absence)

llvm-svn: 221186

9 years ago[X86] Add debug print name for X86ISD::[US]MUL8. NFC-ish.
Ahmed Bougacha [Mon, 3 Nov 2014 21:25:18 +0000 (21:25 +0000)]
[X86] Add debug print name for X86ISD::[US]MUL8. NFC-ish.

The opcodes were added in r220516, but I forgot to add the print names.

llvm-svn: 221185

9 years agoDon't diagnose no-prototype callee-cleanup function definitions
Reid Kleckner [Mon, 3 Nov 2014 21:24:50 +0000 (21:24 +0000)]
Don't diagnose no-prototype callee-cleanup function definitions

We already have a warning on the call sites of code like this:
  void f() { }
  void g() { f(1, 2, 3); }
t.c:2:21: warning: too many arguments in call to 'f'

We can limit ourselves to diagnosing unprototyped forward declarations
of f to cut down on noise.

llvm-svn: 221184

9 years ago[lit] Forward LD_PRELOAD to tests.
Rafael Espindola [Mon, 3 Nov 2014 21:24:43 +0000 (21:24 +0000)]
[lit] Forward LD_PRELOAD to tests.

With this patch I can use asan to test the gold plugin without having
to build gold itself with asan.

llvm-svn: 221183

9 years agoAdd DwarfCompileUnit::BaseAddress to track the base address used by relative addressi...
David Blaikie [Mon, 3 Nov 2014 21:15:30 +0000 (21:15 +0000)]
Add DwarfCompileUnit::BaseAddress to track the base address used by relative addressing in debug_ranges and debug_loc

This is one of a few steps to generalize range handling to include the
CU range (thus the CU's range list will be moved into the range list
list, losing track of the base address in the process), which means
generalizing ranges from both the skeleton and full unit under fission.

And... then I can used that generalized support for ranges in
fission+gmlt where there'll be a bunch more ranges in the skeleton.

llvm-svn: 221182

9 years agoThe change previously committed as 220983 broke large binary memory reads. I kept...
Greg Clayton [Mon, 3 Nov 2014 21:02:54 +0000 (21:02 +0000)]
The change previously committed as 220983 broke large binary memory reads. I kept the "idx - 1" fix from 220983, but reverted the while loop that was incorrectly added.

The details are: large packets (like large memory reads (m packets) or large binary memory reads (x packet)) can get responses that come in across multiple read() calls. The while loop that was added meant that if only a partial packet came in (like only "$abc" coming for a response) GDBRemoteCommunication::CheckForPacket() was called, it would deadlock in the while loop because no more data is going to come in as this function needs to be called again with more data from another read. So the original fix will need to be corrected and resubmitted.

<rdar://problem/18853744>

llvm-svn: 221181

9 years agoFix leak found by asan.
Rafael Espindola [Mon, 3 Nov 2014 20:55:23 +0000 (20:55 +0000)]
Fix leak found by asan.

llvm-svn: 221180

9 years agoFix a leak found by asan.
Rafael Espindola [Mon, 3 Nov 2014 20:49:17 +0000 (20:49 +0000)]
Fix a leak found by asan.

llvm-svn: 221179

9 years ago[ARM, inline-asm] Fix ARMTargetLowering::getRegForInlineAsmConstraint to return
Akira Hatanaka [Mon, 3 Nov 2014 20:37:04 +0000 (20:37 +0000)]
[ARM, inline-asm] Fix ARMTargetLowering::getRegForInlineAsmConstraint to return
register class tGPRRegClass if the target is thumb1.

This commit fixes a crash that occurs during register allocation which was
triggered when a virtual register defined by an inline-asm instruction had to
be spilled.

rdar://problem/18740489

llvm-svn: 221178

9 years agoMSVC requires redeclarations to repeat noexcept
Reid Kleckner [Mon, 3 Nov 2014 20:35:30 +0000 (20:35 +0000)]
MSVC requires redeclarations to repeat noexcept

llvm-svn: 221177

9 years ago[X86] 8bit divrem: Improve codegen for AH register extraction.
Ahmed Bougacha [Mon, 3 Nov 2014 20:26:35 +0000 (20:26 +0000)]
[X86] 8bit divrem: Improve codegen for AH register extraction.

For 8-bit divrems where the remainder is used, we used to generate:
    divb  %sil
    shrw  $8, %ax
    movzbl  %al, %eax

That was to avoid an H-reg access, which is problematic mainly because
it isn't possible in REX-prefixed instructions.

This patch optimizes that to:
    divb  %sil
    movzbl  %ah, %eax

To do that, we explicitly extend AH, and extract the L-subreg in the
resulting register.  The extension is done using the NOREX variants of
MOVZX.  To support signed operations, MOVSX_NOREX is also added.
Further, this introduces a new SDNode type, [us]divrem_ext_hreg, which is
then lowered to a sequence containing a single zext (rather than 2).

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

llvm-svn: 221176

9 years agoEarlyCSE should ignore calls to @llvm.assume
Hal Finkel [Mon, 3 Nov 2014 20:21:32 +0000 (20:21 +0000)]
EarlyCSE should ignore calls to @llvm.assume

EarlyCSE uses a simple generation scheme for handling memory-based
dependencies, and calls to @llvm.assume (which are marked as writing to memory
to ensure the preservation of control dependencies) disturb that scheme
unnecessarily. Skipping calls to @llvm.assume is legal, and the alternative
(adding AA calls in EarlyCSE) is likely undesirable (we have GVN for that).

Fixes PR21448.

llvm-svn: 221175

9 years agoRequire asserts to unbreak the buildbots.
Roman Divacky [Mon, 3 Nov 2014 19:50:48 +0000 (19:50 +0000)]
Require asserts to unbreak the buildbots.

llvm-svn: 221174

9 years agoReapply: R600: Make sure to inline all internal functions
Tom Stellard [Mon, 3 Nov 2014 19:49:05 +0000 (19:49 +0000)]
Reapply: R600: Make sure to inline all internal functions

Function calls aren't supported yet.

This was reverted due to build breakages, which should be fixed now.

llvm-svn: 221173

9 years agoFurther restrict issuance of 'override' warning if method
Fariborz Jahanian [Mon, 3 Nov 2014 19:46:18 +0000 (19:46 +0000)]
Further restrict issuance of 'override' warning if method
is argument to a macro which is defined in system header.

llvm-svn: 221172

9 years ago[Reassociate] Canonicalize negative constants out of expressions.
Chad Rosier [Mon, 3 Nov 2014 19:11:30 +0000 (19:11 +0000)]
[Reassociate] Canonicalize negative constants out of expressions.

This gives CSE/GVN more options to eliminate duplicate expressions.
This is a follow up patch to http://reviews.llvm.org/D4904.

http://reviews.llvm.org/D5363

llvm-svn: 221171

9 years agoImplement vaarg lowering for ppc32. Lowering of scalars and aggregates
Roman Divacky [Mon, 3 Nov 2014 18:32:54 +0000 (18:32 +0000)]
Implement vaarg lowering for ppc32. Lowering of scalars and aggregates
is supported. Complex numbers are not.

llvm-svn: 221170

9 years agoRelax the LLVM_NOEXCEPT _MSC_VER version check back to 1900
Reid Kleckner [Mon, 3 Nov 2014 18:22:42 +0000 (18:22 +0000)]
Relax the LLVM_NOEXCEPT _MSC_VER version check back to 1900

Unconditional noexcept support was added in the VS 2013 Nov CTP. Given
that there have been three CTPs since then, I don't think we need
careful macro magic to target that specific tech preview. Instead,
target the major release version number of 1900, which corresponds to
the as-yet unreleased VS "14".

llvm-svn: 221169

9 years agoNormally an 'optnone' function goes through fast-isel, which does not
Paul Robinson [Mon, 3 Nov 2014 18:19:26 +0000 (18:19 +0000)]
Normally an 'optnone' function goes through fast-isel, which does not
call DAGCombiner. But we ran into a case (on Windows) where the
calling convention causes argument lowering to bail out of fast-isel,
and we end up in CodeGenAndEmitDAG() which does run DAGCombiner.
So, we need to make DAGCombiner check for 'optnone' after all.

Commit includes the test that found this, plus another one that got
missed in the original optnone work.

llvm-svn: 221168

9 years agoIR: MDNode => Value: Instruction::getAllMetadataOtherThanDebugLoc()
Duncan P. N. Exon Smith [Mon, 3 Nov 2014 18:13:57 +0000 (18:13 +0000)]
IR: MDNode => Value: Instruction::getAllMetadataOtherThanDebugLoc()

Change `Instruction::getAllMetadataOtherThanDebugLoc()` from a vector of
`MDNode` to one of `Value`.  Part of PR21433.

llvm-svn: 221167

9 years agoRemove the cortex-a9-mp CPU.
Charlie Turner [Mon, 3 Nov 2014 17:38:00 +0000 (17:38 +0000)]
Remove the cortex-a9-mp CPU.

This CPU definition is redundant. The Cortex-A9 is defined as
supporting multiprocessing extensions. Remove its definition and
update appropriate tests.

LLVM defines both a cortex-a9 CPU and a cortex-a9-mp CPU. The only
difference between the two CPU definitions in ARM.td is that
cortex-a9-mp contains the feature FeatureMP for multiprocessing
extensions.

This is redundant since the Cortex-A9 is defined as having
multiprocessing extensions in the TRMs. armcc also defines the
Cortex-A9 as having multiprocessing extensions by default.

Change-Id: Ifcadaa6c322be0a33d9d2a39cfdd7da1d75981a7
llvm-svn: 221166

9 years agoFix warnings about missing override.
Rafael Espindola [Mon, 3 Nov 2014 17:14:46 +0000 (17:14 +0000)]
Fix warnings about missing override.

llvm-svn: 221165

9 years agoCleanup some unused or trivial functions in DwarfCompileUnit
David Blaikie [Mon, 3 Nov 2014 17:10:38 +0000 (17:10 +0000)]
Cleanup some unused or trivial functions in DwarfCompileUnit

llvm-svn: 221164

9 years agoThis patch reverts r220496 which issues warning on comparing
Fariborz Jahanian [Mon, 3 Nov 2014 17:03:07 +0000 (17:03 +0000)]
This patch reverts r220496 which issues warning on comparing
parameters with nonnull attribute when comparison is always
true/false. Patch causes false positive when parameter is
modified in the function.

llvm-svn: 221163

9 years agoEmit OpenCL local global variables without zeorinitializer
Matt Arsenault [Mon, 3 Nov 2014 16:51:53 +0000 (16:51 +0000)]
Emit OpenCL local global variables without zeorinitializer

Local variables are not initialized, and every target has
been (incorrectly) ignoring the unnecessary request for
zero initialization.

llvm-svn: 221162

9 years agoSink DwarfUnit::CURanges into DwarfCompileUnit
David Blaikie [Mon, 3 Nov 2014 16:40:43 +0000 (16:40 +0000)]
Sink DwarfUnit::CURanges into DwarfCompileUnit

llvm-svn: 221161

9 years agoDon't allow dllimport/export on classes with internal linkage (PR21399)
Hans Wennborg [Mon, 3 Nov 2014 16:09:16 +0000 (16:09 +0000)]
Don't allow dllimport/export on classes with internal linkage (PR21399)

Trying to import or export such classes doesn't make sense, and Clang
would assert trying to export vtables for them.

This is consistent with how we treat functions with internal linkage,
but it is stricter than MSVC so we may have to back down if it breaks
real code.

llvm-svn: 221160

9 years agoTemporary disable formatting error
Tobias Grosser [Mon, 3 Nov 2014 15:42:45 +0000 (15:42 +0000)]
Temporary disable formatting error

This should silence the buildbots until we understand if the clang-format
changes in r221125 have been intentional. See reply on cfe-commits for details.

llvm-svn: 221159

9 years agoRevert "clang-format: [Java] Allow trailing semicolons after enums."
Daniel Jasper [Mon, 3 Nov 2014 15:42:11 +0000 (15:42 +0000)]
Revert "clang-format: [Java] Allow trailing semicolons after enums."

This reverts commit b5bdb2ef59ab922bcb4d6e843fffaee1f7f68a8c.

This doesn't really seem necessary on second though and causes problems
with C++ enum formatting.

llvm-svn: 221158

9 years ago[AArch64] Fix miscompile of comparison with 0xffffffffffffffff
Oliver Stannard [Mon, 3 Nov 2014 15:28:40 +0000 (15:28 +0000)]
[AArch64] Fix miscompile of comparison with 0xffffffffffffffff

Some literals in the AArch64 backend had 15 'f's rather than 16, causing
comparisons with a constant 0xffffffffffffffff to be miscompiled.

llvm-svn: 221157

9 years agoHandle ctor/init_array initialization.
Sid Manning [Mon, 3 Nov 2014 14:56:05 +0000 (14:56 +0000)]
Handle ctor/init_array initialization.

Hexagon was not calling InitializeELF and could not select between
ctors and init_array.

Phabricator revision: http://reviews.llvm.org/D6061

llvm-svn: 221156

9 years agoMerge the directive-eabi_attribute.s and directive-eabi_attribute-2.s tests.
Charlie Turner [Mon, 3 Nov 2014 14:52:00 +0000 (14:52 +0000)]
Merge the directive-eabi_attribute.s and directive-eabi_attribute-2.s tests.

test/MC/ARM/directive-eabi_attribute.s had gotten out-of-sync with
test/MC/ARM/directive-eabi_attribute-2.s. The former tests the encoding of
build attributes in object files, and the latter the encoding in assembly
files. Since both these tests need to be updated at the same time, it makes
sense to combine them into a single test. The object file encodings are being
checked against the ouput of -arm-attributes rather than by direct byte
comparisons which makes for easier reading.

Change-Id: I0075de506ae5626fb2fa235383fe5ce6a65a15a9
llvm-svn: 221155

9 years agoDon't dllimport inline functions when targeting MinGW (PR21366)
Hans Wennborg [Mon, 3 Nov 2014 14:24:45 +0000 (14:24 +0000)]
Don't dllimport inline functions when targeting MinGW (PR21366)

It turns out that MinGW never dllimports of exports inline functions.
This means that code compiled with Clang would fail to link with
MinGW-compiled libraries since we might try to import functions that
are not imported.

To fix this, make Clang never dllimport inline functions when targeting
MinGW.

llvm-svn: 221154

9 years agoAdd CRLF support to LineIterator.
Rafael Espindola [Mon, 3 Nov 2014 14:09:47 +0000 (14:09 +0000)]
Add CRLF support to LineIterator.

The MRI scripts have to work with CRLF, and in general it is probably
a good idea to support this in a core utility like LineIterator.

llvm-svn: 221153

9 years ago[clang-tidy] Added -fix-errors option
Alexander Kornienko [Mon, 3 Nov 2014 14:06:31 +0000 (14:06 +0000)]
[clang-tidy] Added -fix-errors option

Summary:
Added -fix-errors option to allow applying fixes when compiler errors
are present. Without this flag -fix would bail out if there are compiler errors.
This is needed to avoid applying wrong fixes if Clang fails to recover from
compilation errors correctly.

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: curdeius, cfe-commits

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

llvm-svn: 221152

9 years agoRevert r221150, as it broke sanitizer tests
Oliver Stannard [Mon, 3 Nov 2014 12:19:03 +0000 (12:19 +0000)]
Revert r221150, as it broke sanitizer tests

llvm-svn: 221151

9 years agoEmit .eh_frame with relocations to functions, rather than sections
Oliver Stannard [Mon, 3 Nov 2014 12:02:51 +0000 (12:02 +0000)]
Emit .eh_frame with relocations to functions, rather than sections

When LLVM emits DWARF call frame information, it currently creates a local,
section-relative symbol in the code section, which is pointed to by a
relocation on the .eh_frame section. However, for C++ we emit some functions in
section groups, and the SysV ABI has some rules to make it easier to remove
these sections
(http://www.sco.com/developers/gabi/latest/ch4.sheader.html#section_group_rules):

  A symbol table entry with STB_LOCAL binding that is defined relative to one
  of a group's sections, and that is contained in a symbol table section that is
  not part of the group, must be discarded if the group members are discarded.
  References to this symbol table entry from outside the group are not allowed.

This means that we need to use the function symbol for the relocation, not a
temporary symbol.

There was a comment in the code claiming that the local symbol was used to
avoid creating a relocation, but a relocation must be created anyway as the
code and CFI are in different sections.

llvm-svn: 221150

9 years ago[OCaml] Fix mismatched CAMLparam/CAMLreturn.
Peter Zotov [Mon, 3 Nov 2014 11:47:14 +0000 (11:47 +0000)]
[OCaml] Fix mismatched CAMLparam/CAMLreturn.

Also, revert r221142--it was an incorrect fix to this bug
which fixed tests by accident.

llvm-svn: 221149

9 years agoTest commit.
Charlie Turner [Mon, 3 Nov 2014 10:58:05 +0000 (10:58 +0000)]
Test commit.

Fixes two typos.

Change-Id: I129f647de8933e1d8f0dc9941bcb91602edce7e2
llvm-svn: 221148

9 years agoCMake: Add libm to list of system libs printed by llvm-config.
Peter Collingbourne [Mon, 3 Nov 2014 10:38:26 +0000 (10:38 +0000)]
CMake: Add libm to list of system libs printed by llvm-config.

This is required by the interpreter library, and also matches the autoconf
behavior.

llvm-svn: 221147

9 years ago[mips] Remove unused prototype and variable. NFC.
Daniel Sanders [Mon, 3 Nov 2014 10:14:57 +0000 (10:14 +0000)]
[mips] Remove unused prototype and variable. NFC.

llvm-svn: 221146

9 years ago[OCaml] Add -g on DEBUG_SYMBOLS=1, not ENABLE_OPTIMIZED.
Peter Zotov [Mon, 3 Nov 2014 10:06:19 +0000 (10:06 +0000)]
[OCaml] Add -g on DEBUG_SYMBOLS=1, not ENABLE_OPTIMIZED.

Thanks echristo for pointing this out.

llvm-svn: 221145

9 years agoUnbreak build.
Peter Zotov [Mon, 3 Nov 2014 09:58:41 +0000 (09:58 +0000)]
Unbreak build.

A bug in lit.cfg was introduced in r221137.

llvm-svn: 221144

9 years ago[OCaml] Don't use deprecated non-caml_namespaced functions.
Peter Zotov [Mon, 3 Nov 2014 09:51:47 +0000 (09:51 +0000)]
[OCaml] Don't use deprecated non-caml_namespaced functions.

llvm-svn: 221143

9 years ago[OCaml] Initialize local roots prior to raising.
Peter Zotov [Mon, 3 Nov 2014 09:51:44 +0000 (09:51 +0000)]
[OCaml] Initialize local roots prior to raising.

On 4.02, the OCaml unwinder otherwise gets confused and segfaults.

llvm-svn: 221142

9 years ago[OCaml] Core package should depend on LLVMTransformUtils for LLVMCloneModule.
Peter Zotov [Mon, 3 Nov 2014 09:51:41 +0000 (09:51 +0000)]
[OCaml] Core package should depend on LLVMTransformUtils for LLVMCloneModule.

llvm-svn: 221141

9 years ago[OCaml] Fix ocamlc -custom builds when configured as --enable-shared.
Peter Zotov [Mon, 3 Nov 2014 09:51:37 +0000 (09:51 +0000)]
[OCaml] Fix ocamlc -custom builds when configured as --enable-shared.

llvm-svn: 221140

9 years ago[OCaml] Avoid embedding absolute paths into executables.
Peter Zotov [Mon, 3 Nov 2014 09:51:34 +0000 (09:51 +0000)]
[OCaml] Avoid embedding absolute paths into executables.

Bindings built out-of-tree, e.g. via OPAM, should append
a line to META.llvm like the following:

linkopts = "-cclib -L$libdir -cclib -Wl,-rpath,$libdir"

where $libdir is the lib/ directory where LLVM libraries are
installed.

llvm-svn: 221139

9 years ago[OCaml] Don't build stub libraries twice.
Peter Zotov [Mon, 3 Nov 2014 09:51:28 +0000 (09:51 +0000)]
[OCaml] Don't build stub libraries twice.

The default Makefile.rules BUILD_ARCHIVE machinery was
unintentionally enabled.

llvm-svn: 221138

9 years ago[OCaml] Run tests twice, with ocamlc and ocamlopt (if available)
Peter Zotov [Mon, 3 Nov 2014 09:50:53 +0000 (09:50 +0000)]
[OCaml] Run tests twice, with ocamlc and ocamlopt (if available)

ocamlc and ocamlopt expose a distinct set of buildsystem bugs, e.g.
only ocamlc would detect -custom or -dllib-related bugs, and as all
buildbots will have ocamlopt, these bugs will stay hidden.

This change should add no more than 30 seconds of testing time.

llvm-svn: 221137

9 years ago[OCaml] META: remove exists_if(toplevel).
Peter Zotov [Mon, 3 Nov 2014 09:50:02 +0000 (09:50 +0000)]
[OCaml] META: remove exists_if(toplevel).

ocamlfind ignores the predicates in this case, making the package
unavailable for batch compilation as well.

llvm-svn: 221136

9 years ago[OCaml] ExecutionEngine package should not depend on interpreter.
Peter Zotov [Mon, 3 Nov 2014 09:49:42 +0000 (09:49 +0000)]
[OCaml] ExecutionEngine package should not depend on interpreter.

Interpreter support was removed in r220957.

llvm-svn: 221135

9 years agoForgot to add input file for test added in r221133
David Majnemer [Mon, 3 Nov 2014 07:58:16 +0000 (07:58 +0000)]
Forgot to add input file for test added in r221133

llvm-svn: 221134

9 years agollvm-vtabledump: Handle Itanium VTables
David Majnemer [Mon, 3 Nov 2014 07:23:25 +0000 (07:23 +0000)]
llvm-vtabledump: Handle Itanium VTables

Add support in the vtable dumper for the Itanium ABI.

llvm-svn: 221133

9 years ago[x86] Add cx16 feature to KNL, SKX, and CoreAVXi CPUs.
Craig Topper [Mon, 3 Nov 2014 07:05:28 +0000 (07:05 +0000)]
[x86] Add cx16 feature to KNL, SKX, and CoreAVXi CPUs.

llvm-svn: 221132

9 years ago[x86] Realphabetize the feature string decoding function since it was mostly in alpha...
Craig Topper [Mon, 3 Nov 2014 07:05:26 +0000 (07:05 +0000)]
[x86] Realphabetize the feature string decoding function since it was mostly in alphabetical order.

llvm-svn: 221131

9 years agoAdd FSGSBASE intrinsics to x86 intrinsic headers.
Craig Topper [Mon, 3 Nov 2014 06:51:41 +0000 (06:51 +0000)]
Add FSGSBASE intrinsics to x86 intrinsic headers.

llvm-svn: 221130

9 years agoInstCombine: Combine (X | Y) - X to (~X & Y)
David Majnemer [Mon, 3 Nov 2014 05:53:55 +0000 (05:53 +0000)]
InstCombine: Combine (X | Y) - X to (~X & Y)

This implements the transformation from (X | Y) - X to (~X & Y).

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

llvm-svn: 221129

9 years ago[LinkerScript] Change ErrorOr usage to fix MSVC2012 buildbots
Rafael Auler [Mon, 3 Nov 2014 05:26:18 +0000 (05:26 +0000)]
[LinkerScript] Change ErrorOr usage to fix MSVC2012 buildbots

Number parsing functions used an ErrorOr<> idiom that is not supported in
MSVC2012. This patch fixes this.

llvm-svn: 221128

9 years agoRemove definitions from Intrin.h that already exist in one of the other x86 intrinsic...
Craig Topper [Mon, 3 Nov 2014 04:19:58 +0000 (04:19 +0000)]
Remove definitions from Intrin.h that already exist in one of the other x86 intrinsic headers. Add a run line with Broadwell as the cpu type to ms-intrin.cpp test to catch some of these in the future.

llvm-svn: 221127