platform/upstream/llvm.git
10 years ago[UBSan] Introduce UBSAN_OPTIONS environment variable.
Alexey Samsonov [Wed, 23 Jul 2014 18:32:55 +0000 (18:32 +0000)]
[UBSan] Introduce UBSAN_OPTIONS environment variable.

If UBSan is run in a standalone mode (w/o any other sanitizer), it
still uses functions from sanitizer_common, some of which depend on
the value of runtime flags. Allow to override the default values of these
flags with UBSAN_OPTIONS variable. In particular, UBSAN_OPTIONS=symbolize=0
can be used to turn off online symbolization.

llvm-svn: 213782

10 years agoEnsure that if some unspecified person were to pass in an invalid architecture when...
Enrico Granata [Wed, 23 Jul 2014 18:18:38 +0000 (18:18 +0000)]
Ensure that if some unspecified person were to pass in an invalid architecture when trying to create a target, that it would fail, but not cause LLDB to crash.

llvm-svn: 213781

10 years ago[SKX] Added missed test files for rev 213757
Robert Khasanov [Wed, 23 Jul 2014 18:17:49 +0000 (18:17 +0000)]
[SKX] Added missed test files for rev 213757

llvm-svn: 213780

10 years ago[Refactor] Unify IslAst print methods
Johannes Doerfert [Wed, 23 Jul 2014 18:14:43 +0000 (18:14 +0000)]
[Refactor] Unify IslAst print methods

  + Add const annotations to some member functions

llvm-svn: 213779

10 years agoMake sure we don't crash if someone (E.G.) comments out on entry from g_core_definiti...
Greg Clayton [Wed, 23 Jul 2014 18:12:06 +0000 (18:12 +0000)]
Make sure we don't crash if someone (E.G.) comments out on entry from g_core_definitions[] without removing the ArchSpec::Core enumeration when submitting from source.

We now catch the issue with a static_assert() at compile time and use llvm::array_lengthof(g_core_definitions) as well.

<rdar://problem/17767541>

llvm-svn: 213778

10 years agoAsmParser: remove deprecated LLIR support
Saleem Abdulrasool [Wed, 23 Jul 2014 18:09:31 +0000 (18:09 +0000)]
AsmParser: remove deprecated LLIR support

linker_private and linker_private_weak were deprecated in 3.5.  Remove support
for them now that the 3.5 branch has been created.

llvm-svn: 213777

10 years agoExecutionEngine: remove a stray semicolon
Saleem Abdulrasool [Wed, 23 Jul 2014 18:09:28 +0000 (18:09 +0000)]
ExecutionEngine: remove a stray semicolon

Detected via GCC 4.8 [-Wpedantic].

llvm-svn: 213776

10 years agoRename metadata in test which was missed when renaming loop unroll metadata in r213771.
Mark Heffernan [Wed, 23 Jul 2014 17:59:07 +0000 (17:59 +0000)]
Rename metadata in test which was missed when renaming loop unroll metadata in r213771.

llvm-svn: 213775

10 years ago[SKX] Fix lowercase "error:" in rev 213757
Robert Khasanov [Wed, 23 Jul 2014 17:42:13 +0000 (17:42 +0000)]
[SKX] Fix lowercase "error:" in rev 213757

llvm-svn: 213774

10 years ago[NVPTX] Make sure we do not generate MULWIDE ISD nodes when optimizations are disabled
Justin Holewinski [Wed, 23 Jul 2014 17:40:45 +0000 (17:40 +0000)]
[NVPTX] Make sure we do not generate MULWIDE ISD nodes when optimizations are disabled

With optimizations disabled, we disable the isel patterns for mul.wide; but we
were still generating MULWIDE ISD nodes.  Now, we only try to generate MULWIDE
ISD nodes in DAGCombine if the optimization level is not zero.

llvm-svn: 213773

10 years agoIn unroll pragma syntax and loop hint metadata, change "enable" forms to a new form...
Mark Heffernan [Wed, 23 Jul 2014 17:31:37 +0000 (17:31 +0000)]
In unroll pragma syntax and loop hint metadata, change "enable" forms to a new form using the string "full".

llvm-svn: 213772

10 years agoIn unroll pragma syntax and loop hint metadata, change "enable" forms to a new form...
Mark Heffernan [Wed, 23 Jul 2014 17:31:31 +0000 (17:31 +0000)]
In unroll pragma syntax and loop hint metadata, change "enable" forms to a new form using the string "full".

llvm-svn: 213771

10 years agotest commit: remove trailing space
Alex Lorenz [Wed, 23 Jul 2014 17:18:05 +0000 (17:18 +0000)]
test commit: remove trailing space

llvm-svn: 213770

10 years agoFix test/Driver/cl-x86-flags.c by providing explicit --target
Artyom Skrobov [Wed, 23 Jul 2014 17:09:26 +0000 (17:09 +0000)]
Fix test/Driver/cl-x86-flags.c by providing explicit --target

This isn't very neat, but we haven't found any better ways to
make this test work with non-X86 default target.

llvm-svn: 213769

10 years agoUpdate the synopsis and comments with the results of LWG #2255. No code to back it...
Marshall Clow [Wed, 23 Jul 2014 16:58:25 +0000 (16:58 +0000)]
Update the synopsis and comments with the results of LWG #2255. No code to back it up at the moment; just comments

llvm-svn: 213768

10 years agoAdd stopgap option -fmodule-implementation-of <name>
Ben Langmuir [Wed, 23 Jul 2014 15:30:23 +0000 (15:30 +0000)]
Add stopgap option -fmodule-implementation-of <name>

This flag specifies that we are building an implementation file of the
module <name>, preventing importing <name> as a module. This does not
consider this to be the 'current module' for the purposes of doing
modular checks like decluse or non-modular-include warnings, unlike
-fmodule-name.

This is needed as a stopgap until:
1) we can resolve relative includes to a VFS-mapped module (or can
   safely import a header textually and as part of a module)

and ideally
2) we can safely do incremental rebuilding when implementation files
   import submodules.

llvm-svn: 213767

10 years agoAdd kalimba architecture checking to TestImageListMultiArchitecture
Todd Fiala [Wed, 23 Jul 2014 15:16:35 +0000 (15:16 +0000)]
Add kalimba architecture checking to TestImageListMultiArchitecture

Verify that ObjectFileELF's kalimba detection works regardless
of the host platform.

Change by Matthew Gardiner.

llvm-svn: 213763

10 years agoImplement sin builtin for float types
Tom Stellard [Wed, 23 Jul 2014 15:16:21 +0000 (15:16 +0000)]
Implement sin builtin for float types

This double version still uses @llvm.sin.

llvm-svn: 213762

10 years agoImplement cos builtin for float types
Tom Stellard [Wed, 23 Jul 2014 15:16:18 +0000 (15:16 +0000)]
Implement cos builtin for float types

The double version still uses @llvm.cos.

llvm-svn: 213761

10 years agoImplement atan2 builtin
Tom Stellard [Wed, 23 Jul 2014 15:16:16 +0000 (15:16 +0000)]
Implement atan2 builtin

llvm-svn: 213760

10 years agoImplement atan builtin
Tom Stellard [Wed, 23 Jul 2014 15:16:13 +0000 (15:16 +0000)]
Implement atan builtin

llvm-svn: 213759

10 years ago[AArch64] Lower sdiv x, pow2 using add + select + shift.
Chad Rosier [Wed, 23 Jul 2014 14:57:52 +0000 (14:57 +0000)]
[AArch64] Lower sdiv x, pow2 using add + select + shift.

The target-independent DAGcombiner will generate:
asr w1, X, #31 w1 = splat sign bit.
add X, X, w1, lsr #28 X = X + 0 or pow2-1
asr w0, X, asr #4 w0 = X/pow2

However, the add + shifts is expensive, so generate:
add w0, X, 15 w0 = X + pow2-1
cmp X, wzr X - 0
csel X, w0, X, lt X = (X < 0) ? X + pow2-1 : X;
asr w0, X, asr 4 w0 = X/pow2

llvm-svn: 213758

10 years ago[SKX] Enabling mask instructions: encoding, lowering
Robert Khasanov [Wed, 23 Jul 2014 14:49:42 +0000 (14:49 +0000)]
[SKX] Enabling mask instructions: encoding, lowering
KMOVB, KMOVW, KMOVD, KMOVQ, KNOTB, KNOTW, KNOTD, KNOTQ

Reviewed by Elena Demikhovsky <elena.demikhovsky@intel.com>

llvm-svn: 213757

10 years agoImprove documentation on triple encoding expectations for qHostInfo response.
Todd Fiala [Wed, 23 Jul 2014 14:48:41 +0000 (14:48 +0000)]
Improve documentation on triple encoding expectations for qHostInfo response.

Change by Matthew Gardiner.

llvm-svn: 213756

10 years agoUpdate lldb to track recent Triple arm64 enum removal and collapse into aarch64.
Todd Fiala [Wed, 23 Jul 2014 14:37:35 +0000 (14:37 +0000)]
Update lldb to track recent Triple arm64 enum removal and collapse into aarch64.

See the following llvm change for details:

r213743 | tnorthover | 2014-07-23 05:32:47 -0700 (Wed, 23 Jul 2014) | 9 lines
AArch64: remove arm64 triple enumerator.

This change fixes build breaks on Linux and MacOSX lldb.

llvm-svn: 213755

10 years agoARM: spot SBFX-compatbile code expressed with sign_extend_inreg
Tim Northover [Wed, 23 Jul 2014 13:59:12 +0000 (13:59 +0000)]
ARM: spot SBFX-compatbile code expressed with sign_extend_inreg

We were assuming all SBFX-like operations would have the shl/asr form, but
often when the field being extracted is an i8 or i16, we end up with a
SIGN_EXTEND_INREG acting on a shift instead. Simple enough to check for though.

llvm-svn: 213754

10 years agoARM: add patterns for [su]xta[bh] from just a shift.
Tim Northover [Wed, 23 Jul 2014 13:59:07 +0000 (13:59 +0000)]
ARM: add patterns for [su]xta[bh] from just a shift.

Although the final shifter operand is a rotate, this actually only matters for
the half-word extends when the amount == 24. Otherwise folding a shift in is
just as good.

llvm-svn: 213753

10 years agoEnable partial libcall inlining for all targets by default.
James Molloy [Wed, 23 Jul 2014 13:33:00 +0000 (13:33 +0000)]
Enable partial libcall inlining for all targets by default.

This pass attempts to speculatively use a sqrt instruction if one exists on the target, falling back to a libcall if the target instruction returned NaN.

This was enabled for MIPS and System-Z, but is well guarded and is good for most targets - GCC does this for (that I've checked) X86, ARM and AArch64.

llvm-svn: 213752

10 years agoPrevent assert in ASTMatchFinder.
Daniel Jasper [Wed, 23 Jul 2014 13:17:47 +0000 (13:17 +0000)]
Prevent assert in ASTMatchFinder.

If nodes without memoization data (e.g. TypeLocs) are bound to specific
names, that effectively prevents memoization as those elements cannot be
compared effectively. If it is tried anyway, this can lead to an assert
as demonstrated in the new test.

In the long term, the better solution will be to enable DynTypedNodes
without memoization data. For now, simply skip memoization instead.

llvm-svn: 213751

10 years ago[ARM] Make the assembler reject unpredictable pre/post-indexed ARM STRB instructions.
Tilmann Scheller [Wed, 23 Jul 2014 13:03:47 +0000 (13:03 +0000)]
[ARM] Make the assembler reject unpredictable pre/post-indexed ARM STRB instructions.

The ARM ARM prohibits STRB instructions with writeback into the source register. With this commit this constraint is now enforced and we stop assembling STRB instructions with unpredictable behavior.

llvm-svn: 213750

10 years agoAdded release notes for MIPS.
Daniel Sanders [Wed, 23 Jul 2014 12:59:26 +0000 (12:59 +0000)]
Added release notes for MIPS.

llvm-svn: 213749

10 years agoAArch64: remove "arm64_be" support in favour of "aarch64_be".
Tim Northover [Wed, 23 Jul 2014 12:58:11 +0000 (12:58 +0000)]
AArch64: remove "arm64_be" support in favour of "aarch64_be".

There really is no arm64_be: it was a useful fiction to test big-endian support
while both backends existed in parallel, but now the only platform that uses
the name (iOS) doesn't have a big-endian variant, let alone one called
"arm64_be".

llvm-svn: 213748

10 years agoAArch64: use aarch64_be instead of arm64_be in all tests.
Tim Northover [Wed, 23 Jul 2014 12:57:31 +0000 (12:57 +0000)]
AArch64: use aarch64_be instead of arm64_be in all tests.

arm64_be doesn't really exist; it was useful for testing while AArch64 and
ARM64 were separate, but now the only real way to refer to the system is
aarch64_be.

llvm-svn: 213747

10 years ago[ARM] Make the assembler reject unpredictable pre/post-indexed ARM STR instructions.
Tilmann Scheller [Wed, 23 Jul 2014 12:38:17 +0000 (12:38 +0000)]
[ARM] Make the assembler reject unpredictable pre/post-indexed ARM STR instructions.

The ARM ARM prohibits STR instructions with writeback into the source register. With this commit this constraint is now enforced and we stop assembling STR instructions with unpredictable behavior.

llvm-svn: 213745

10 years agoAArch64: update Clang for merged arm64/aarch64 triples.
Tim Northover [Wed, 23 Jul 2014 12:32:58 +0000 (12:32 +0000)]
AArch64: update Clang for merged arm64/aarch64 triples.

The main subtlety here is that the Darwin tools still need to be given "-arch
arm64" rather than "-arch aarch64". Fortunately this already goes via a custom
function to handle weird edge-cases in other architectures, and it tested.

I removed a few arm64_be tests because that really isn't an interesting thing
to worry about. No-one using big-endian is also referring to the target as
arm64 (at least as far as toolchains go). Mostly they date from when arm64 was
a separate target and we *did* need a parallel name simply to test it at all.
Now aarch64_be is sufficient.

llvm-svn: 213744

10 years agoAArch64: remove arm64 triple enumerator.
Tim Northover [Wed, 23 Jul 2014 12:32:47 +0000 (12:32 +0000)]
AArch64: remove arm64 triple enumerator.

Having both Triple::arm64 and Triple::aarch64 is extremely confusing, and
invites bugs where only one is checked. In reality, the only legitimate
difference between the two (arm64 usually means iOS) is also present in the OS
part of the triple and that's what should be checked.

We still parse the "arm64" triple, just canonicalise it to Triple::aarch64, so
there aren't any LLVM-side test changes.

llvm-svn: 213743

10 years ago[mips] -mno-shared should only be given to the assembler when -fPIC/-fpic/-fPIE/...
Daniel Sanders [Wed, 23 Jul 2014 12:06:13 +0000 (12:06 +0000)]
[mips] -mno-shared should only be given to the assembler when -fPIC/-fpic/-fPIE/-fpie is not in effect.

This fixes compiler recursion on MIPS32r2.

llvm-svn: 213741

10 years agoAdd the fix that should've accompanied r213738.
Benjamin Kramer [Wed, 23 Jul 2014 11:50:54 +0000 (11:50 +0000)]
Add the fix that should've accompanied r213738.

llvm-svn: 213740

10 years agocheck_clang_tidy_fix.sh: Fail immediately if clang-tidy crashes.
Benjamin Kramer [Wed, 23 Jul 2014 11:49:49 +0000 (11:49 +0000)]
check_clang_tidy_fix.sh: Fail immediately if clang-tidy crashes.

Otherwise we'll get confusing messages from FileCheck instead of seeing the real issue.

llvm-svn: 213739

10 years agoReapply r213647 with a fix.
Benjamin Kramer [Wed, 23 Jul 2014 11:49:46 +0000 (11:49 +0000)]
Reapply r213647 with a fix.

ASTMatchers currently have problems mixing bound TypeLoc nodes with Decl/Stmt
nodes. That should be fixed soon but for this checker there we only need the
TypeLoc to generate a fixit so postpone the potentially heavyweight AST walking
until after we know that we're going to emit a warning.

This is covered by existing test cases.

Original message:
[clang-tidy] Add a check for RAII temporaries.

This tries to find code similar that immediately destroys
an object that looks like it's trying to follow RAII.
  {
    scoped_lock(&global_mutex);
    critical_section();
  }

This checker will have false positives if someone uses this pattern
to legitimately invoke a destructor immediately (or the statement is
at the end of a scope anyway). To reduce the number we ignore this
pattern in macros (this is heavily used by gtest) and ignore objects
with no user-defined destructor.

llvm-svn: 213738

10 years agoASTMatchers: Bound node results are always const, make selectFirst's template argumen...
Benjamin Kramer [Wed, 23 Jul 2014 11:41:44 +0000 (11:41 +0000)]
ASTMatchers: Bound node results are always const, make selectFirst's template argument implicitly const.

This avoids adding const to every user of selectFirst and also allows it to
match TypeLocs which BoundNodes doesn't use magic const removal specializations
for. No functionality change.

llvm-svn: 213737

10 years agoRevert r211771. It was: "[X86] Improve the selection of SSE3/AVX addsub instructions".
Andrea Di Biagio [Wed, 23 Jul 2014 11:20:24 +0000 (11:20 +0000)]
Revert r211771. It was: "[X86] Improve the selection of SSE3/AVX addsub instructions".

This chang fully reverts r211771.
That revision added a canonicalization rule which has the potential to causes a
combine-cycle in the target-independent canonicalizing DAG combine.

The plan is to move the logic that forms target specific addsub nodes as part of
the lowering of shuffles.

llvm-svn: 213736

10 years ago[OPENMP] Initial parsing and sema analysis for 'update' clause of 'atomic' directive.
Alexey Bataev [Wed, 23 Jul 2014 10:25:33 +0000 (10:25 +0000)]
[OPENMP] Initial parsing and sema analysis for 'update' clause of 'atomic' directive.

llvm-svn: 213735

10 years ago[Driver][Mips] Restore FIXME comment was removed accidentally.
Simon Atanasyan [Wed, 23 Jul 2014 09:27:10 +0000 (09:27 +0000)]
[Driver][Mips] Restore FIXME comment was removed accidentally.

llvm-svn: 213734

10 years agoARM: Add doc for ACLE memory barrier intrinsics
Yi Kong [Wed, 23 Jul 2014 09:25:02 +0000 (09:25 +0000)]
ARM: Add doc for ACLE memory barrier intrinsics

Add documentations for ACLE memory barrier intrinsics, describing their motion
barrier characteristics.

llvm-svn: 213733

10 years ago[x86] Clean up a test case to use check labels and spell out the exact
Chandler Carruth [Wed, 23 Jul 2014 09:11:48 +0000 (09:11 +0000)]
[x86] Clean up a test case to use check labels and spell out the exact
instruction sequences with CHECK-NEXT for these test cases.

This notably exposes how absolutely horrible the generated code is for
several of these test cases, and will make any future updates to the
test as our vector instruction selection gets better.

llvm-svn: 213732

10 years agoAdd module map entry for ARM ACLE header file
Yi Kong [Wed, 23 Jul 2014 09:00:21 +0000 (09:00 +0000)]
Add module map entry for ARM ACLE header file

llvm-svn: 213731

10 years ago[ARM] Add regression test for the earlyclobber constraint of ARM STRB.
Tilmann Scheller [Wed, 23 Jul 2014 08:39:50 +0000 (08:39 +0000)]
[ARM] Add regression test for the earlyclobber constraint of ARM STRB.

The constraint was added in r213369.

llvm-svn: 213730

10 years ago[ARM] Add earlyclobber constraint to pre/post-indexed ARM STRH instructions.
Tilmann Scheller [Wed, 23 Jul 2014 08:12:51 +0000 (08:12 +0000)]
[ARM] Add earlyclobber constraint to pre/post-indexed ARM STRH instructions.

The post-indexed instructions were missing the constraint, causing unpredictable STRH instructions to be emitted.

The earlyclobber constraint on the pre-indexed STR instructions is not strictly necessary, as the instruction selection for pre-indexed STR instructions goes through an additional layer of pseudo instructions which have the constraint defined, however it doesn't hurt to specify the constraint directly on the pre-indexed instructions as well, since at some point someone might create instances of them programmatically and then the constraint is definitely needed.

llvm-svn: 213729

10 years ago[OPENMP] Initial parsing an sema analysis for 'write' clause of 'atomic' directive.
Alexey Bataev [Wed, 23 Jul 2014 07:46:59 +0000 (07:46 +0000)]
[OPENMP] Initial parsing an sema analysis for 'write' clause of 'atomic' directive.

llvm-svn: 213728

10 years ago[SDAG] Make the DAGCombine worklist not grow endlessly due to duplicate
Chandler Carruth [Wed, 23 Jul 2014 07:08:53 +0000 (07:08 +0000)]
[SDAG] Make the DAGCombine worklist not grow endlessly due to duplicate
insertions.

The old behavior could cause arbitrarily bad memory usage in the DAG
combiner if there was heavy traffic of adding nodes already on the
worklist to it. This commit switches the DAG combine worklist to work
the same way as the instcombine worklist where we null-out removed
entries and only add new entries to the worklist. My measurements of
codegen time shows slight improvement. The memory utilization is
unsurprisingly dominated by other factors (the IR and DAG itself
I suspect).

This change results in subtle, frustrating churn in the particular order
in which DAG combines are applied which causes a number of minor
regressions where we fail to match a pattern previously matched by
accident. AFAICT, all of these should be using AddToWorklist to directly
or should be written in a less brittle way. None of the changes seem
drastically bad, and a few of the changes seem distinctly better.

A major change required to make this work is to significantly harden the
way in which the DAG combiner handle nodes which become dead
(zero-uses). Previously, we relied on the ability to "priority-bump"
them on the combine worklist to achieve recursive deletion of these
nodes and ensure that the frontier of remaining live nodes all were
added to the worklist. Instead, I've introduced a routine to just
implement that precise logic with no indirection. It is a significantly
simpler operation than that of the combiner worklist proper. I suspect
this will also fix some other problems with the combiner.

I think the x86 changes are really minor and uninteresting, but the
avx512 change at least is hiding a "regression" (despite the test case
being just noise, not testing some performance invariant) that might be
looked into. Not sure if any of the others impact specific "important"
code paths, but they didn't look terribly interesting to me, or the
changes were really minor. The consensus in review is to fix any
regressions that show up after the fact here.

Thanks to the other reviewers for checking the output on other
architectures. There is a specific regression on ARM that Tim already
has a fix prepped to commit.

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

llvm-svn: 213727

10 years agoWe may visit a call that uses an alloca multiple times in callUsesLocalStack, sometim...
Nick Lewycky [Wed, 23 Jul 2014 06:24:49 +0000 (06:24 +0000)]
We may visit a call that uses an alloca multiple times in callUsesLocalStack, sometimes with IsNocapture true and sometimes with IsNocapture false. We accidentally skipped work we needed to do in the IsNocapture=false case if we were called with IsNocapture=true the first time. Fixes PR20405!

llvm-svn: 213726

10 years agoImprove diagnostic on default-initializing const variables (PR20208).
Nico Weber [Wed, 23 Jul 2014 05:16:10 +0000 (05:16 +0000)]
Improve diagnostic on default-initializing const variables (PR20208).

This tweaks the diagnostic wording slighly, and adds a fixit on a note.
An alternative would be to add the fixit directly on the diagnostic, see
the review thread linked to from the bug for a few notes on that approach.

llvm-svn: 213725

10 years agoRevert "Include assembly files in builtins library build"
Renato Golin [Wed, 23 Jul 2014 04:46:23 +0000 (04:46 +0000)]
Revert "Include assembly files in builtins library build"

This reverts commit r213684, since it was breaking the compiler-rt
build and the sanitizers' bot.

llvm-svn: 213724

10 years agoRework to let RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s pass on win32.
NAKAMURA Takumi [Wed, 23 Jul 2014 04:32:21 +0000 (04:32 +0000)]
Rework to let RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s pass on win32.

FIXME: "llvm-rtdyld -verify -check" is still sensitive to path separator.
Fix searching StubMap to be tolerant of both '/' and '\\' on Win32.

llvm-svn: 213723

10 years agoRevert r213647; the added test triggers an assertion.
Richard Smith [Wed, 23 Jul 2014 04:13:00 +0000 (04:13 +0000)]
Revert r213647; the added test triggers an assertion.

llvm-svn: 213722

10 years agoSuppress a test on win32 for now, llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86...
NAKAMURA Takumi [Wed, 23 Jul 2014 04:05:58 +0000 (04:05 +0000)]
Suppress a test on win32 for now, llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s.

FIXME: Fix searching StubMap with '/' and '\\' on Win32.
llvm-svn: 213721

10 years agoRuntimeDyld/X86/MachO_x86-64_PIC_relocations.s: Use %/T here, or sed(1) would be...
NAKAMURA Takumi [Wed, 23 Jul 2014 04:05:46 +0000 (04:05 +0000)]
RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s: Use %/T here, or sed(1) would be confused with dos path.

llvm-svn: 213720

10 years agoAST printer: fix double space before base class with no access specifier.
Richard Smith [Wed, 23 Jul 2014 03:22:10 +0000 (03:22 +0000)]
AST printer: fix double space before base class with no access specifier.

llvm-svn: 213719

10 years agoWhen pretty-printing a declaration of a pack, put the ellipsis before the name
Richard Smith [Wed, 23 Jul 2014 03:17:06 +0000 (03:17 +0000)]
When pretty-printing a declaration of a pack, put the ellipsis before the name
being declared, not at the end. When pretty-printing a non-type template
parameter, put the name of the parameter in the middle of the type, not at the
end.

llvm-svn: 213718

10 years ago[OPENMP] Initial parsing and sema analysis for 'read' clause in 'atomic' directive.
Alexey Bataev [Wed, 23 Jul 2014 02:27:21 +0000 (02:27 +0000)]
[OPENMP] Initial parsing and sema analysis for 'read' clause in 'atomic' directive.

llvm-svn: 213717

10 years agoPlugins: silence a few more signed comparision warnings
Saleem Abdulrasool [Wed, 23 Jul 2014 01:53:54 +0000 (01:53 +0000)]
Plugins: silence a few more signed comparision warnings

Address a few signed-compare warnings that were triggered on GCC 4.8.2.

llvm-svn: 213716

10 years agoTarget: silence a GCC warning
Saleem Abdulrasool [Wed, 23 Jul 2014 01:53:52 +0000 (01:53 +0000)]
Target: silence a GCC warning

GCC emits a warning:
    warning: enumeral and non-enumeral type in conditional expression [enabled by default]
which does not seem to have a flag to control it.  Simply add an explicit cast
for the boolean value.

llvm-svn: 213715

10 years agotest: add an explicit target triple
Saleem Abdulrasool [Wed, 23 Jul 2014 01:32:32 +0000 (01:32 +0000)]
test: add an explicit target triple

Now that we support WoA, this test fails on ARM build bots as __va_start has a
different signature on different architectures.

llvm-svn: 213714

10 years ago[PECOFF] Fix entry point functions selection
Rui Ueyama [Wed, 23 Jul 2014 00:57:57 +0000 (00:57 +0000)]
[PECOFF] Fix entry point functions selection

On Windows there are four "main" functions -- main, wmain, WinMain,
or wWinMain. Their parameter types are diffferent. The standard
library provides four different entry functions (i.e.
{w,}{WinMain,main}CRTStartup) for them. You need to use the right
entry routine for your "main" function.

If you give an /entry option, the specified name is used
unconditionally.

Otherwise, the linker needs to select the right one based on
user-supplied entry point function. This can be done after the
linker reads all the input files.

This patch moves the code to determine the entry point function
from the driver to a virtual input file. It also implements the
correct logic for the entry point function selection.

llvm-svn: 213713

10 years ago[mach-o] add initial support for modes in arm code.
Nick Kledzik [Wed, 23 Jul 2014 00:51:37 +0000 (00:51 +0000)]
[mach-o] add initial support for modes in arm code.

This patch just supports marking ranges that are thumb code (vs arm code).
Future patches will mark data and jump table ranges. The ranges are encoded
as References with offsetInAtom being the start of the range and the target
being the same atom.

llvm-svn: 213712

10 years agoTrailing whitespace.
NAKAMURA Takumi [Wed, 23 Jul 2014 00:42:52 +0000 (00:42 +0000)]
Trailing whitespace.

llvm-svn: 213711

10 years agoRuntimeDyldMachOAArch64.h: Fix a warning. [-Wunused-variable]
NAKAMURA Takumi [Wed, 23 Jul 2014 00:17:44 +0000 (00:17 +0000)]
RuntimeDyldMachOAArch64.h: Fix a warning. [-Wunused-variable]

llvm-svn: 213710

10 years agoPR14615: add (passing) tests for this already-fixed bug
Richard Smith [Tue, 22 Jul 2014 23:56:53 +0000 (23:56 +0000)]
PR14615: add (passing) tests for this already-fixed bug

llvm-svn: 213709

10 years ago[MCJIT] Make stub_addr functionality in RuntimeDyldChecker work in release mode.
Lang Hames [Tue, 22 Jul 2014 23:50:51 +0000 (23:50 +0000)]
[MCJIT] Make stub_addr functionality in RuntimeDyldChecker work in release mode.

There's no reason to restrict this particular piece of RuntimeDyldChecker
functionality to +Asserts builds.

This should fix failures in MachO_x86-64_PIC_relocations.s on release bots.

llvm-svn: 213708

10 years agoEnable lldb-platform exe support for Linux.
Todd Fiala [Tue, 22 Jul 2014 23:41:36 +0000 (23:41 +0000)]
Enable lldb-platform exe support for Linux.

This change enables lldb-platform for Linux.  In addition, it does the following:

* fixes Host::GetLLDBPath() to work on Linux/*BSD for ePathTypeSupportExecutableDir-relative paths.

* adds more logging and comments around lldb-platform startup and remote lldb-platform usage.

* refactors lldb-platform remote-* support for Darwin and Linux into PlatformPOSIX.  This, in theory, is the bulk of what is needed for *BSD to make remote connections to lldb-platform as well (although I haven't tested that yet).  FreeBSD can make similar changes to their Platform* as was made here for PlatformLinux to pick up the rest of the bits.

* teaches GDBRemoteCommunication to use lldb-gdbserver for non-Apple hosts.

llvm-svn: 213707

10 years ago[MCJIT] Teach RuntimeDyldChecker to handle underscores at the start of symbols.
Lang Hames [Tue, 22 Jul 2014 23:17:21 +0000 (23:17 +0000)]
[MCJIT] Teach RuntimeDyldChecker to handle underscores at the start of symbols.

RuntimeDyldChecker had been testing isalpha(Expr[0]) to recognise symbol tokens,
and throwing unrecognized token errors when it hit symbols with leading
underscores. This fixes that.

llvm-svn: 213706

10 years agoXFAIL the test on MIPS
Juergen Ributzka [Tue, 22 Jul 2014 23:15:01 +0000 (23:15 +0000)]
XFAIL the test on MIPS

Not sure how to debug this one without a MIPS machine. Any takers?

llvm-svn: 213705

10 years ago[FastIsel][AArch64] Add support for the FastLowerCall and FastLowerIntrinsicCall...
Juergen Ributzka [Tue, 22 Jul 2014 23:14:58 +0000 (23:14 +0000)]
[FastIsel][AArch64] Add support for the FastLowerCall and FastLowerIntrinsicCall target-hooks.

This commit modifies the existing call lowering functions to be used as the
FastLowerCall and FastLowerIntrinsicCall target-hooks instead.

This enables patchpoint intrinsic lowering for AArch64.

This fixes <rdar://problem/17733076>

llvm-svn: 213704

10 years ago[AArch64] Use CHECK-LABEL in ARM64 ABI unit tests.
Juergen Ributzka [Tue, 22 Jul 2014 23:14:54 +0000 (23:14 +0000)]
[AArch64] Use CHECK-LABEL in ARM64 ABI unit tests.

llvm-svn: 213703

10 years ago[Sanitizer] Disable Wframe-larger-than on PowerPC hosts
Alexey Samsonov [Tue, 22 Jul 2014 23:10:13 +0000 (23:10 +0000)]
[Sanitizer] Disable Wframe-larger-than on PowerPC hosts

llvm-svn: 213702

10 years ago[MCJIT] Improve stub_addr file-not-found diagnostic to help track down a
Lang Hames [Tue, 22 Jul 2014 23:07:52 +0000 (23:07 +0000)]
[MCJIT] Improve stub_addr file-not-found diagnostic to help track down a
buildbot failure.

llvm-svn: 213701

10 years ago[mach-o] add support for round tripping all arm/thumb relocations
Nick Kledzik [Tue, 22 Jul 2014 23:07:49 +0000 (23:07 +0000)]
[mach-o] add support for round tripping all arm/thumb relocations

Update the parse-arm-relocs.yaml test case to run the linker back to back
to ensure all relocations round trip in and out of mach-o.

llvm-svn: 213700

10 years ago[PECOFF] Parameterize ResovalbeSymbols object.
Rui Ueyama [Tue, 22 Jul 2014 22:55:06 +0000 (22:55 +0000)]
[PECOFF] Parameterize ResovalbeSymbols object.

So that it can be shared by multiple input files.

llvm-svn: 213699

10 years ago[MCJIT] Refactor and add stub inspection to the RuntimeDyldChecker framework.
Lang Hames [Tue, 22 Jul 2014 22:47:39 +0000 (22:47 +0000)]
[MCJIT] Refactor and add stub inspection to the RuntimeDyldChecker framework.

This patch introduces a 'stub_addr' builtin that can be used to find the address
of the stub for a given (<file>, <section>, <symbol>) tuple. This address can be
used both to verify the contents of stubs (by loading from the returned address)
and to verify references to stubs (by comparing against the returned address).

Example (1) - Verifying stub contents:

Load 8 bytes (assuming a 64-bit target) from the stub for 'x' in the __text
section of f.o, and compare that value against the addres of 'x'.

# rtdyld-check: *{8}(stub_addr(f.o, __text, x) = x

Example (2) - Verifying references to stubs:

Decode the immediate of the instruction at label 'l', and verify that it's
equal to the offset from the next instruction's PC to the stub for 'y' in the
__text section of f.o (i.e. it's the correct PC-rel difference).

# rtdyld-check: decode_operand(l, 4) = stub_addr(f.o, __text, y) - next_pc(l)
l:
        movq    y@GOTPCREL(%rip), %rax

Since stub inspection requires cooperation with RuntimeDyldImpl this patch
pimpl-ifies RuntimeDyldChecker. Its implementation is moved in to a new class,
RuntimeDyldCheckerImpl, that has access to the definition of RuntimeDyldImpl.

llvm-svn: 213698

10 years ago[PECOFF] Remember /noentry option so that later passes can handle it.
Rui Ueyama [Tue, 22 Jul 2014 22:19:42 +0000 (22:19 +0000)]
[PECOFF] Remember /noentry option so that later passes can handle it.

This is a part of a larger change to move the entry point
processing to a later pass than the driver. On Windows the default
entry point function varies depending on user-provided functions.
That means the driver is not able to correctly know the entry point
function name. Only passes after the core linker can infer it.

llvm-svn: 213697

10 years agoSBCommunication: Fix a pointer-to-function to void-pointer cast
David Majnemer [Tue, 22 Jul 2014 22:12:58 +0000 (22:12 +0000)]
SBCommunication: Fix a pointer-to-function to void-pointer cast

reinterpret_cast may not convert a pointer-to-function to a
void-pointer.  Take a detour through intptr_t and *then* convert to a
pointer-to-function.

This fixes a diagnostic emitted by GCC.

llvm-svn: 213696

10 years agoScriptInterpreterPython: %p should be used with void-pointer
David Majnemer [Tue, 22 Jul 2014 22:02:48 +0000 (22:02 +0000)]
ScriptInterpreterPython: %p should be used with void-pointer

printf's %p format specifier expects an argument of type void-pointer,
not type PyThreadState*.  Fix this with a static_cast.

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

llvm-svn: 213695

10 years agoAppease the buildbots.
Juergen Ributzka [Tue, 22 Jul 2014 22:02:19 +0000 (22:02 +0000)]
Appease the buildbots.

llvm-svn: 213694

10 years agoHost: Fix a pointer-to-function to void-pointer cast
David Majnemer [Tue, 22 Jul 2014 22:00:42 +0000 (22:00 +0000)]
Host: Fix a pointer-to-function to void-pointer cast

reinterpret_cast may not convert a pointer-to-function to a
void-pointer.  Take a detour through intptr_t and *then* convert to a
pointer-to-function.

This silences a warning emitted by GCC when building LLDB.

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

llvm-svn: 213693

10 years agoSBHostOS: Fix a pointer-to-function to void-pointer cast
David Majnemer [Tue, 22 Jul 2014 22:00:04 +0000 (22:00 +0000)]
SBHostOS: Fix a pointer-to-function to void-pointer cast

reinterpret_cast may not convert a pointer-to-function to a
void-pointer.  Take a detour through intptr_t and *then* convert to a
pointer-to-function.

This fixes a warning emitted by GCC.

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

llvm-svn: 213692

10 years agoPluginManager: Don't cast from void-pointer to pointer-to-function
David Majnemer [Tue, 22 Jul 2014 21:59:22 +0000 (21:59 +0000)]
PluginManager: Don't cast from void-pointer to pointer-to-function

GCC warns on reinterpret_cast expressions involving a void-pointer
source and a pointer-to-function destination.  Take a detour through
intptr_t to silence it.

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

llvm-svn: 213691

10 years ago[Mips] Replace assembler code by YAML to make the 'entry-name.test' test target
Simon Atanasyan [Tue, 22 Jul 2014 21:47:34 +0000 (21:47 +0000)]
[Mips] Replace assembler code by YAML to make the 'entry-name.test' test target
independent.

llvm-svn: 213690

10 years ago[RuntimeDyld][MachO][AArch64] Add a helper function for encoding addends in instructions.
Juergen Ributzka [Tue, 22 Jul 2014 21:42:55 +0000 (21:42 +0000)]
[RuntimeDyld][MachO][AArch64] Add a helper function for encoding addends in instructions.

Factor out the addend encoding into a helper function and simplify the
processRelocationRef.

Also add a few simple rtdyld tests. More tests to come once GOTs can be tested too.

Related to <rdar://problem/17768539>

llvm-svn: 213689

10 years ago[RuntimeDyld][MachO][AArch64] Implement the decodeAddend method.
Juergen Ributzka [Tue, 22 Jul 2014 21:42:51 +0000 (21:42 +0000)]
[RuntimeDyld][MachO][AArch64] Implement the decodeAddend method.

This adds the required functionality to decode the immediate encoded in an
instruction that is referenced in a relocation entry.

llvm-svn: 213688

10 years ago[RuntimeDyld][MachO][AArch64] Add assertion to check for duplicate addend definition.
Juergen Ributzka [Tue, 22 Jul 2014 21:42:49 +0000 (21:42 +0000)]
[RuntimeDyld][MachO][AArch64] Add assertion to check for duplicate addend definition.

In MachO for AArch64 it is possible to have an explicit addend defined by
the ARM64_RELOC_ADDEND relocation or having an addend encoded within the
instruction. Only one of them are allowed per relocation.

llvm-svn: 213687

10 years ago[RuntimeDyld] Change the return type of decodeAddend to match the storage type.
Juergen Ributzka [Tue, 22 Jul 2014 21:42:46 +0000 (21:42 +0000)]
[RuntimeDyld] Change the return type of decodeAddend to match the storage type.

llvm-svn: 213686

10 years agoFix incompatible assembly in ARM builtins library
Renato Golin [Tue, 22 Jul 2014 20:59:41 +0000 (20:59 +0000)]
Fix incompatible assembly in ARM builtins library

Convert the CBNZ backward branch instruction to CMP and BNE
avoiding illegal backwards branch and making the assembly code
in synh-ops.h to be UAL compliant.

Patch by: Sumanth Gundapaneni

llvm-svn: 213685

10 years agoInclude assembly files in builtins library build
Renato Golin [Tue, 22 Jul 2014 20:59:38 +0000 (20:59 +0000)]
Include assembly files in builtins library build

The CMake assembler build system ignores the .S assembly files in builtins
library build. This patch fixes the issue.

Patch by: Sumanth Gundapaneni

llvm-svn: 213684

10 years agoTypeSynthetic: Fix a pointer-to-function to void-pointer cast
David Majnemer [Tue, 22 Jul 2014 20:40:01 +0000 (20:40 +0000)]
TypeSynthetic: Fix a pointer-to-function to void-pointer cast

reinterpret_cast may not convert a pointer-to-function to a
void-pointer.  Take a detour through intptr_t and *then* convert to a
pointer-to-function.

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

llvm-svn: 213682

10 years agoMangled: Fix an 'unused variable' warning on GNU/Linux
David Majnemer [Tue, 22 Jul 2014 20:36:37 +0000 (20:36 +0000)]
Mangled: Fix an 'unused variable' warning on GNU/Linux

Platforms which don't use LLDB's built-in demangler don't use the
'mangled_length' variable.  Instead, replace it's only use by an
expression it is equivalent to.

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

llvm-svn: 213681

10 years agoUse the correct from type in a SCS
Ehsan Akhgari [Tue, 22 Jul 2014 20:20:14 +0000 (20:20 +0000)]
Use the correct from type in a SCS

Summary:
If during constructing a standard conversion sequence, we resolve an
overload, we need to adjust the from type in the SCS according to the
resolved operator.

I found this bug when debugging PR20218.  This doesn't seem to be
observable, so there is no good way of testing it.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 213680

10 years agoThis patch implements optimization as mentioned in PR19753: Optimize comparisons...
Suyog Sarda [Tue, 22 Jul 2014 19:19:36 +0000 (19:19 +0000)]
This patch implements optimization as mentioned in PR19753: Optimize comparisons with "ashr/lshr exact" of a constanst.
It handles the errors which were seen in PR19958 where wrong code was being emitted due to earlier patch.
Added code for lshr as well as non-exact right shifts.

It implements :
(icmp eq/ne (ashr/lshr const2, A), const1)" ->
(icmp eq/ne A, Log2(const2/const1)) ->
(icmp eq/ne A, Log2(const2) - Log2(const1))

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

llvm-svn: 213678

10 years agoAdded InstCombine transform for pattern "(A & B) ^ (A ^ B) -> (A | B)"
Suyog Sarda [Tue, 22 Jul 2014 18:30:54 +0000 (18:30 +0000)]
Added InstCombine transform for pattern "(A & B) ^ (A ^ B) -> (A | B)"

Patch idea by Ankit Jain !

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

llvm-svn: 213677

10 years agoAdded InstCombine Transform for patterns:
Suyog Sarda [Tue, 22 Jul 2014 18:09:41 +0000 (18:09 +0000)]
Added InstCombine Transform for patterns:
"((~A & B) | A) -> (A | B)" and "((A & B) | ~A) -> (~A | B)"

Original Patch credit to Ankit Jain !!

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

llvm-svn: 213676