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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 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

10 years ago[lld] Teach LLD how to parse most linker scripts
Rafael Auler [Mon, 3 Nov 2014 04:09:51 +0000 (04:09 +0000)]
[lld] Teach LLD how to parse most linker scripts

This patch does *not* implement any semantic actions, but it is a first step to
teach LLD how to read complete linker scripts. The additional linker scripts
statements whose parsing is now supported are:

* SEARCH_DIR directive
* SECTIONS directive
* Symbol definitions inside SECTIONS including PROVIDE and PROVIDE_HIDDEN
* C-like expressions used in many places in linker scripts
* Input to output sections mapping

The goal of this commit was guided towards completely parsing a default GNU ld
linker script and the linker script used to link the FreeBSD kernel. Thus, it
also adds a test case based on the default linker script used in GNU ld for
x86_64 ELF targets. I tested SPEC userland programs linked by GNU ld, using the
linker script dump'ed by this parser, and everything went fine. I then tested
linking the FreeBSD kernel with a dump'ed linker script, installed the new
kernel and booted it, everything went fine.

Directives that still need to be implemented:
* MEMORY
* PHDRS

Reviewers: silvas, shankarke and ruiu

http://reviews.llvm.org/D5852

llvm-svn: 221126

10 years agoclang-format: [Java] Allow trailing semicolons after enums.
Daniel Jasper [Mon, 3 Nov 2014 03:00:42 +0000 (03:00 +0000)]
clang-format: [Java] Allow trailing semicolons after enums.

Before:
  enum SomeThing { ABC, CDE }
  ;

After:
  enum SomeThing { ABC, CDE };

llvm-svn: 221125

10 years agoclang-format: [Java] Fix more generics formatting.
Daniel Jasper [Mon, 3 Nov 2014 02:45:58 +0000 (02:45 +0000)]
clang-format: [Java] Fix more generics formatting.

Before:
  < T extends B > T getInstance(Class<T> type);

After:
  <T extends B> T getInstance(Class<T> type);

llvm-svn: 221124

10 years agoSink range list handling down from DwarfUnit into its only use, in DwarfCompileUnit.
David Blaikie [Mon, 3 Nov 2014 02:41:49 +0000 (02:41 +0000)]
Sink range list handling down from DwarfUnit into its only use, in DwarfCompileUnit.

llvm-svn: 221123

10 years agoclang-format: [Java] Fix static generic methods.
Daniel Jasper [Mon, 3 Nov 2014 02:35:14 +0000 (02:35 +0000)]
clang-format: [Java] Fix static generic methods.

Before:
  public static<R> ArrayList<R> get() {}

After:
  public static <R> ArrayList<R> get() {}

llvm-svn: 221122

10 years agoclang-format: [Java] Fix class declaration formatting.
Daniel Jasper [Mon, 3 Nov 2014 02:27:28 +0000 (02:27 +0000)]
clang-format: [Java] Fix class declaration formatting.

Before:
  @SomeAnnotation()
  abstract
      class aaaaaaaaaaaa extends bbbbbbbbbbbbbbb implements cccccccccccc {
  }

After:
  @SomeAnnotation()
  abstract class aaaaaaaaaaaa extends bbbbbbbbbbbbbbb
      implements cccccccccccc {
  }

llvm-svn: 221121

10 years agoUse ErrorOr for the ::create factory on instrumented and sample profilers.
Diego Novillo [Mon, 3 Nov 2014 00:51:45 +0000 (00:51 +0000)]
Use ErrorOr for the ::create factory on instrumented and sample profilers.

Summary:
As discussed in
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141027/242445.html,
the creation of reader and writer instances is better done using
ErrorOr. There are no functional changes, but several callers needed to
be adjusted.

Reviewers: bogner

Subscribers: llvm-commits

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

llvm-svn: 221120

10 years agoR600: Don't unnecessarily repeat the register class
Matt Arsenault [Sun, 2 Nov 2014 23:46:59 +0000 (23:46 +0000)]
R600: Don't unnecessarily repeat the register class

llvm-svn: 221119

10 years agoR600/SI: Use REG_SEQUENCE instead of INSERT_SUBREGs
Matt Arsenault [Sun, 2 Nov 2014 23:46:54 +0000 (23:46 +0000)]
R600/SI: Use REG_SEQUENCE instead of INSERT_SUBREGs

llvm-svn: 221118

10 years agoSupport REG_SEQUENCE in tablegen.
Matt Arsenault [Sun, 2 Nov 2014 23:46:51 +0000 (23:46 +0000)]
Support REG_SEQUENCE in tablegen.

The problem is mostly that variadic output instruction
aren't handled, so it is rejected for having an inconsistent
number of operands, and then the right number of operands
isn't emitted.

llvm-svn: 221117

10 years agoFix typo
Matt Arsenault [Sun, 2 Nov 2014 23:46:47 +0000 (23:46 +0000)]
Fix typo

llvm-svn: 221116

10 years agoFix missing C++ mode comment
Matt Arsenault [Sun, 2 Nov 2014 23:46:44 +0000 (23:46 +0000)]
Fix missing C++ mode comment

llvm-svn: 221115

10 years agoclang-format: Fix false positive in lambda detection.
Daniel Jasper [Sun, 2 Nov 2014 22:46:42 +0000 (22:46 +0000)]
clang-format: Fix false positive in lambda detection.

Before:
  delete [] a -> b;

After:
  delete[] a->b;

This fixes part of llvm.org/PR21419.

llvm-svn: 221114

10 years agoclang-format: [Java] Support enums without trailing semicolon.
Daniel Jasper [Sun, 2 Nov 2014 22:31:39 +0000 (22:31 +0000)]
clang-format: [Java] Support enums without trailing semicolon.

Before:
  class SomeClass {
    enum SomeThing { ABC, CDE } void f() {
    }
  }

After:
  class SomeClass {
    enum SomeThing { ABC, CDE }
    void f() {
    }
  }

This fixed llvm.org/PR21458.

llvm-svn: 221113

10 years agoclang-format: [Java] Don't break imports.
Daniel Jasper [Sun, 2 Nov 2014 22:13:03 +0000 (22:13 +0000)]
clang-format: [Java] Don't break imports.

This fixes llvm.org/PR21453.

llvm-svn: 221112

10 years agoFix the Makefile build by actually building ABI/SysV-ppc
Filipe Cabecinhas [Sun, 2 Nov 2014 22:03:15 +0000 (22:03 +0000)]
Fix the Makefile build by actually building ABI/SysV-ppc

llvm-svn: 221111

10 years agoclang-format: [Java] Add space between "synchronized" and "(".
Daniel Jasper [Sun, 2 Nov 2014 22:00:57 +0000 (22:00 +0000)]
clang-format: [Java] Add space between "synchronized" and "(".

Before:
  synchronized(mData) {
    // ...
  }

After:
  synchronized (mData) {
    // ...
  }

This fixes llvm.org/PR21455.

llvm-svn: 221110

10 years agoclang-format: [Java] Support generics with "?".
Daniel Jasper [Sun, 2 Nov 2014 21:52:57 +0000 (21:52 +0000)]
clang-format: [Java] Support generics with "?".

Before:
  @Override
  public Map < String,
          ? > getAll() {
    // ...
  }

After:
  @Override
  public Map<String, ?> getAll() {
    // ...
  }

This fixes llvm.org/PR21454.

llvm-svn: 221109