platform/upstream/llvm.git
9 years agoDI: Clarify isUnsignedDIType(), NFC
Duncan P. N. Exon Smith [Fri, 24 Jul 2015 19:42:12 +0000 (19:42 +0000)]
DI: Clarify isUnsignedDIType(), NFC

Refactor `isUnsignedDIType()` to deal with `DICompositeType` explicitly.
Since `DW_TAG_subroutine_type` isn't handled here (the assertions about
tags rule it out), this allows strengthening the `dyn_cast` to
`DIDerivedType`.

Besides making the code clearer, this it removes a use of
`DIDerivedTypeBase`.

llvm-svn: 243148

9 years ago[libunwind] Flip order of extern "C" and attribute(visibility)
Renato Golin [Fri, 24 Jul 2015 19:29:05 +0000 (19:29 +0000)]
[libunwind] Flip order of extern "C" and attribute(visibility)

GCC doesn't seems to like having the attribute before extern, but
Clang accepts it either way. This patch makes it compile on both.

llvm-svn: 243147

9 years agoAdd const to some Type* parameters which didn't need to be mutable. NFC.
Pete Cooper [Fri, 24 Jul 2015 19:19:26 +0000 (19:19 +0000)]
Add const to some Type* parameters which didn't need to be mutable.  NFC.

We were only getting the size of the type which doesn't need to modify
the type.

llvm-svn: 243146

9 years agoRemove unused variable. NFC.
Diego Novillo [Fri, 24 Jul 2015 19:18:32 +0000 (19:18 +0000)]
Remove unused variable. NFC.

llvm-svn: 243145

9 years agoBase the sys-root/mingw/include path on sysroot and not on /usr.
Yaron Keren [Fri, 24 Jul 2015 19:18:17 +0000 (19:18 +0000)]
Base the sys-root/mingw/include path on sysroot and not on /usr.

Thanks to Richard Smith for pointing this out!

llvm-svn: 243144

9 years agoDI: Strengthen some dyn_casts to DIDerivedType, NFC
Duncan P. N. Exon Smith [Fri, 24 Jul 2015 19:17:20 +0000 (19:17 +0000)]
DI: Strengthen some dyn_casts to DIDerivedType, NFC

The surrounding code proves in both cases that these must be
`DIDerivedType` if they're `DIDerivedTypeBase`, so strengthen the
`dyn_cast`s to the more specific type.

llvm-svn: 243143

9 years agoCompile fix; add missing ISL files
Michael Kruse [Fri, 24 Jul 2015 19:09:27 +0000 (19:09 +0000)]
Compile fix; add missing ISL files

The last ISL update added two files that we must also add to Polly.

llvm-svn: 243142

9 years agoRemove the user-count threshold when analyzing read attributes
Jingyue Wu [Fri, 24 Jul 2015 19:05:53 +0000 (19:05 +0000)]
Remove the user-count threshold when analyzing read attributes

Summary:
This threshold limited FunctionAttrs ability to prove arguments to be read-only.
In NVPTX, a specialized instruction ld.global.nc can be used to load memory
with non-coherent texture cache. We notice that in SHOC [1] benchmark, some
function arguments are not marked with readonly because FunctionAttrs reaches
a hardcoded threshold when analysis uses.

Removing this threshold won't cause significant regression in compilation time, because the worst-case time complexity of the algorithm is still O(# of instructions) for each parameter.

Patched by Xuetian Weng.

[1] https://github.com/vetter/shoc

Reviewers: nlewycky, jingyue, nicholas

Subscribers: nicholas, test, llvm-commits

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

llvm-svn: 243141

9 years ago[RewriteStatepointsForGC] Adjust naming scheme to be more stable
Philip Reames [Fri, 24 Jul 2015 19:01:39 +0000 (19:01 +0000)]
[RewriteStatepointsForGC] Adjust naming scheme to be more stable

The names for instructions inserted were previous dependent on iteration order.  By deriving the names from the original instructions, we can avoid instability in tests without resorting to ordered traversals.  It also makes the IR mildly easier to read at large scale.

llvm-svn: 243140

9 years ago[asan] Only link liblog on Android when it exists.
Evgeniy Stepanov [Fri, 24 Jul 2015 19:00:16 +0000 (19:00 +0000)]
[asan] Only link liblog on Android when it exists.

With r242975, liblog is only used on certain older platforms.

llvm-svn: 243139

9 years agoDI: Strengthen block-byref cast to DIDerivedType, NFC
Duncan P. N. Exon Smith [Fri, 24 Jul 2015 18:58:32 +0000 (18:58 +0000)]
DI: Strengthen block-byref cast to DIDerivedType, NFC

This code is visiting the members of a block-byref, and we know those
are all `DIDerivedType`.  Strengthen the cast.

llvm-svn: 243138

9 years ago[asan] Fix android system property access on aarch64.
Evgeniy Stepanov [Fri, 24 Jul 2015 18:57:44 +0000 (18:57 +0000)]
[asan] Fix android system property access on aarch64.

__system_property_get is gone from the NDK headers and libs in 64-bit
toolchains, but it is still exported by platform libc.so.

llvm-svn: 243137

9 years agoUse foreach loops for StructType::elements(). NFC.
Pete Cooper [Fri, 24 Jul 2015 18:55:49 +0000 (18:55 +0000)]
Use foreach loops for StructType::elements().  NFC.

We had a few places where we did

for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {

but those could instead do

for (auto *EltTy : STy->elements()) {

llvm-svn: 243136

9 years agoAdd const to a bunch of Type* in DataLayout. NFC.
Pete Cooper [Fri, 24 Jul 2015 18:29:09 +0000 (18:29 +0000)]
Add const to a bunch of Type* in DataLayout.  NFC.

Almost all methods in DataLayout took mutable pointers but didn't need to.
These were only accessing constant methods of the types, or using the Type*
to key a map.  Neither of these needs a mutable pointer.

llvm-svn: 243135

9 years agoDI: Only DICompositeType has getElements(), NFC
Duncan P. N. Exon Smith [Fri, 24 Jul 2015 18:17:17 +0000 (18:17 +0000)]
DI: Only DICompositeType has getElements(), NFC

There is an assertion inside `DICompositeTypeBase::getElements()` that
`this` is not a `DISubroutineType`, leaving only `DICompositeType`.
Make that clear at the call sites.

llvm-svn: 243134

9 years agoCorrect x86_64 Android fp128 mangled name
Chih-Hung Hsieh [Fri, 24 Jul 2015 18:12:54 +0000 (18:12 +0000)]
Correct x86_64 Android fp128 mangled name

These changes are for Android x86_64 targets to be compatible with current Android g++.
https://llvm.org/bugs/show_bug.cgi?id=23897
Use 'g' and 'Cg' for "long double" and "long double _Complex" mangled type names.

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

llvm-svn: 243133

9 years agoFix double implementation of log
Tom Stellard [Fri, 24 Jul 2015 18:07:14 +0000 (18:07 +0000)]
Fix double implementation of log

We need to use M_LOG2E instead of M_LOG2E_F.

llvm-svn: 243132

9 years agoImplement accurate log2 function
Tom Stellard [Fri, 24 Jul 2015 18:07:12 +0000 (18:07 +0000)]
Implement accurate log2 function

Use the implementation was ported from the AMD builtin library rather
than LLVM Intrinsics.

This has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 243131

9 years agoUse llvm intrinsics for native_log and native_log2
Tom Stellard [Fri, 24 Jul 2015 18:07:06 +0000 (18:07 +0000)]
Use llvm intrinsics for native_log and native_log2

llvm-svn: 243130

9 years agoDI: Make StaticDataMemberCache type-safe, NFC
Duncan P. N. Exon Smith [Fri, 24 Jul 2015 18:05:58 +0000 (18:05 +0000)]
DI: Make StaticDataMemberCache type-safe, NFC

Change `StaticDataMemberCache` to store references to `DIDerivedType`
directly, and remove now-unnecessary casts from the accessors.

llvm-svn: 243129

9 years agoMIR Parser: Run the machine verifier after initializing machine functions.
Alex Lorenz [Fri, 24 Jul 2015 17:44:49 +0000 (17:44 +0000)]
MIR Parser: Run the machine verifier after initializing machine functions.

llvm-svn: 243128

9 years ago[RuntimeDyld] MachO: Add support for ARM scattered vanilla relocations.
Lang Hames [Fri, 24 Jul 2015 17:40:04 +0000 (17:40 +0000)]
[RuntimeDyld] MachO: Add support for ARM scattered vanilla relocations.

llvm-svn: 243126

9 years agoTest commit.
Chih-Hung Hsieh [Fri, 24 Jul 2015 17:39:13 +0000 (17:39 +0000)]
Test commit.

llvm-svn: 243125

9 years agoMIR Tests: Add liveins and successors to make tests pass with machine verifier.
Alex Lorenz [Fri, 24 Jul 2015 17:36:55 +0000 (17:36 +0000)]
MIR Tests: Add liveins and successors to make tests pass with machine verifier.

This commit adds the liveins and successors properties to machine basic blocks
in some of the MIR tests to ensure that the tests will pass when the MIR parser
will run the machine verifier after initializing a machine function.

llvm-svn: 243124

9 years agoMIR Tests: Make the basic block successor test an X86 specific test.
Alex Lorenz [Fri, 24 Jul 2015 17:31:55 +0000 (17:31 +0000)]
MIR Tests: Make the basic block successor test an X86 specific test.

This commit moves and transforms the generic test
'CodeGen/MIR/successor-basic-blocks.mir' into an X86 specific test
'CodeGen/MIR/X86/successor-basic-blocks.mir'. This change is required in order
to enable the machine verifier for the MIR parser, as the machine verifier
verifies that the machine basic blocks contain instructions that actually
determine the machine basic block successors.

llvm-svn: 243123

9 years agoAVX-512: Implemented encoding , DAG lowering and intrinsics for Integer Truncate...
Igor Breger [Fri, 24 Jul 2015 17:24:15 +0000 (17:24 +0000)]
AVX-512: Implemented encoding , DAG lowering and intrinsics for Integer Truncate with/without saturation
Added tests for DAG lowering ,encoding and intrinsic

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

llvm-svn: 243122

9 years agoUpdate for r243115 which changed the DataLayout API on TargetMachine but
Chandler Carruth [Fri, 24 Jul 2015 17:23:09 +0000 (17:23 +0000)]
Update for r243115 which changed the DataLayout API on TargetMachine but
didn't update the gold-plugin.

llvm-svn: 243121

9 years ago[test] Attempt to fix failing test in non-darwin bots.
Argyrios Kyrtzidis [Fri, 24 Jul 2015 17:18:25 +0000 (17:18 +0000)]
[test] Attempt to fix failing test in non-darwin bots.

llvm-svn: 243120

9 years ago[code-completion] Strip outer nullability annotations when completing method implemen...
Argyrios Kyrtzidis [Fri, 24 Jul 2015 17:00:19 +0000 (17:00 +0000)]
[code-completion] Strip outer nullability annotations when completing method implementations.

The outer nullability is transferred from the declaration to the implementation so including them is redundant.
The inner ones are not transferred so they are kept to match the exact types. When we transfer the inner ones as well
adding them in the implementation will become redundant and we should strip those as well.

rdar://21737451

llvm-svn: 243119

9 years agoBind to the loopback when we are expecting a connection from 127.0.0.1 so we don...
Greg Clayton [Fri, 24 Jul 2015 16:55:00 +0000 (16:55 +0000)]
Bind to the loopback when we are expecting a connection from 127.0.0.1 so we don't set off firewall protections.

<rdar://problem/17897318>

llvm-svn: 243118

9 years agotest-release.sh: Defer test errors until the end
Hans Wennborg [Fri, 24 Jul 2015 16:16:09 +0000 (16:16 +0000)]
test-release.sh: Defer test errors until the end

This makes the script run to the end and produce tarballs even on test
failures, and then highlights any errors afterwards.

(I first tried just storing the errors in a global variable, but that
didn't work as the "test_llvmCore" function invocation is actually
running as a sub-shell.)

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

llvm-svn: 243116

9 years agoLLVM API Change: the Module always owns the DataLayout
Mehdi Amini [Fri, 24 Jul 2015 16:04:29 +0000 (16:04 +0000)]
LLVM API Change: the Module always owns the DataLayout

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243115

9 years agoRemove access to the DataLayout in the TargetMachine
Mehdi Amini [Fri, 24 Jul 2015 16:04:22 +0000 (16:04 +0000)]
Remove access to the DataLayout in the TargetMachine

Summary:
Replace getDataLayout() with a createDataLayout() method to make
explicit that it is intended to create a DataLayout only and not
accessing it for other purpose.

This change is the last of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned
by the module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

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

(cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243114

9 years agofix wrong comment; NFC
Sanjay Patel [Fri, 24 Jul 2015 16:02:14 +0000 (16:02 +0000)]
fix wrong comment; NFC

llvm-svn: 243113

9 years agoCorrecting some comments. (1) the function is named throughUsingDecl() and not throug...
Aaron Ballman [Fri, 24 Jul 2015 15:47:32 +0000 (15:47 +0000)]
Correcting some comments. (1) the function is named throughUsingDecl() and not throughUsingDeclaration(). (2) Testing shows that this does work for shadowed variables as well as shadowed functions. I could not find an example where this matcher was failing. NFC.

llvm-svn: 243111

9 years agoUpdate isl to isl-0.15-86-g595055e
Tobias Grosser [Fri, 24 Jul 2015 13:12:17 +0000 (13:12 +0000)]
Update isl to isl-0.15-86-g595055e

Besides a couple of cleanups and refactorings in isl, this change set fixes a
couple of bugs in isl, that can cause issues during code generation.

llvm-svn: 243110

9 years agoSilence a "not all control paths return a value" warning from MSVC. Should also silen...
Aaron Ballman [Fri, 24 Jul 2015 12:47:27 +0000 (12:47 +0000)]
Silence a "not all control paths return a value" warning from MSVC. Should also silence a -Wreturn-type warning. NFC intended.

llvm-svn: 243109

9 years agoVisual Studio is more permissive than other compilers; amends r243107 to fix a compil...
Aaron Ballman [Fri, 24 Jul 2015 12:44:02 +0000 (12:44 +0000)]
Visual Studio is more permissive than other compilers; amends r243107 to fix a compile error.

llvm-svn: 243108

9 years agoAdd an AST matcher, isFinal(), for testing whether a method or class declaration...
Aaron Ballman [Fri, 24 Jul 2015 12:35:41 +0000 (12:35 +0000)]
Add an AST matcher, isFinal(), for testing whether a method or class declaration are marked final.

llvm-svn: 243107

9 years agollvm/test/tools/dsymutil/ARM/lit.local.cfg: Fix possibly typo, s/X86/ARM/.
NAKAMURA Takumi [Fri, 24 Jul 2015 11:55:11 +0000 (11:55 +0000)]
llvm/test/tools/dsymutil/ARM/lit.local.cfg: Fix possibly typo, s/X86/ARM/.

llvm-svn: 243106

9 years agoApparently some of the bots add .svn dirs inside the test/Driver/Inputs
Yaron Keren [Fri, 24 Jul 2015 11:01:45 +0000 (11:01 +0000)]
Apparently some of the bots add .svn dirs inside the test/Driver/Inputs
directory structure. Try to make mingw toolchain resilient to such surprises.

llvm-svn: 243105

9 years agoInitialize variable to prevent garbage values (RenderScriptRuntime)
Ewan Crawford [Fri, 24 Jul 2015 10:01:11 +0000 (10:01 +0000)]
Initialize variable to prevent garbage values (RenderScriptRuntime)

The kernels_found variable is not initialized, so if it is not assigned true on line 823, then it will be a garbage value in the branch condition on line 828. This patch initializes the variable to false.

Patch by neilparikh.

Reviewers: domipheus
Differential Revision: http://reviews.llvm.org/D11323

llvm-svn: 243104

9 years ago[ARM] - Fix lowering of shufflevectors in AArch32
Luke Cheeseman [Fri, 24 Jul 2015 09:57:05 +0000 (09:57 +0000)]
[ARM] - Fix lowering of shufflevectors in AArch32

Some shufflevectors are currently being incorrectly lowered in the AArch32
backend as the existing checks for detecting the NEON operations from the
shufflevector instruction expects the shuffle mask and the vector operands to be
of the same length.

This is not always the case as the mask may be twice as long as the operand;
here only the lower half of the shufflemask gets checked, so provided the lower
half of the shufflemask looks like a vector transpose (or even is just all -1
for undef) then the intrinsics may get incorrectly lowered into a vector
transpose (VTRN) instruction.

This patch fixes this by accommodating for both cases and adds regression tests.

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

llvm-svn: 243103

9 years agoRevert "Fix an issue where LLDB would run out of stack space ..."
Pavel Labath [Fri, 24 Jul 2015 09:52:25 +0000 (09:52 +0000)]
Revert "Fix an issue where LLDB would run out of stack space ..."

This commit introduced an infinite recursion in
ValueObjectChild::CanUpdateWithInvalidExecutionContext (because FollowParentChain also considers
the current object), which broke nearly all the tests. Ignoring the current object removes the
recursion, but two tests still time out (TestDataFormatterLibcxxList.py and
TestValueObjectRecursion.py) for some reason. Reverting for now.

llvm-svn: 243102

9 years agoTry to appease clang buildbot by forcing libstdc++ in mingw.cpp test.
Yaron Keren [Fri, 24 Jul 2015 09:31:57 +0000 (09:31 +0000)]
Try to appease clang buildbot by forcing libstdc++ in mingw.cpp test.

llvm-svn: 243101

9 years agoWhen lowering vector shifts a check is performed to see if the value to shift by
Luke Cheeseman [Fri, 24 Jul 2015 09:31:48 +0000 (09:31 +0000)]
When lowering vector shifts a check is performed to see if the value to shift by
is an immediate, in this check the value is negated and stored in and int64_t.
The value can be -2^63 yet the result cannot be stored in an int64_t and this
gives some undefined behaviour causing failures. The negation is only necessary
when the values is within a certain range and so it should not need to negate
-2^63, this patch introduces this and also a regression test.

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

llvm-svn: 243100

9 years agoImprove C++ function name handling and step-in avoid regerxp handling
Tamas Berghammer [Fri, 24 Jul 2015 08:54:22 +0000 (08:54 +0000)]
Improve C++ function name handling and step-in avoid regerxp handling

If the function is a template then the return type is part of the
function name. This CL fixes the parsing of these function names in
the case when the return type contains ':'.

The name of free functions in C++ don't have context part. Fix the
logic geting the function name without arguments out from a full
function name to handle this case.

Change the handling of step-in-avoid-regexp to match the value against
the function name without it's arguments and return value. This is
required because the default regex ("^std::") would match any template
function returning an std object.

Fifferential revision: http://reviews.llvm.org/D11461

llvm-svn: 243099

9 years agoAdd extensive tests for the mingw toolchain and remove trailing slash from Arch.
Yaron Keren [Fri, 24 Jul 2015 08:50:15 +0000 (08:50 +0000)]
Add extensive tests for the mingw toolchain and remove trailing slash from Arch.

Address Richard Smith comments: remove the trailing seperator from the Arch
variable, implement six mingw_* trees under tools/clangtest/Driver/Inputs
and merge linux and Windows tests into a universal test that uses these trees.

llvm-svn: 243098

9 years ago[clang-cl] Implement support for the /Zl flag
David Majnemer [Fri, 24 Jul 2015 06:49:13 +0000 (06:49 +0000)]
[clang-cl] Implement support for the /Zl flag

The flag allows users to specify that they do not want the object file
to have any implicit /defaultlib directives.

This fixes PR24236.

llvm-svn: 243097

9 years ago[dsymutil] Implement support for universal mach-o object files.
Frederic Riss [Fri, 24 Jul 2015 06:41:11 +0000 (06:41 +0000)]
[dsymutil] Implement support for universal mach-o object files.

This patch allows llvm-dsymutil to read universal (aka fat) macho object
files and archives. The patch touches nearly everything in the BinaryHolder,
but it is fairly mechinical: the methods that returned MemoryBufferRefs or
ObjectFiles now return a vector of those, and the high-level access function
takes a triple argument to select the architecture.

There is no support yet for handling fat executables and thus no support for
writing fat object files.

llvm-svn: 243096

9 years ago[dsymutil] Make the triple detection more strict.
Frederic Riss [Fri, 24 Jul 2015 06:41:04 +0000 (06:41 +0000)]
[dsymutil] Make the triple detection more strict.

MachOObjectFile offers a method for detecting the correct triple, use
it instead of the previous approximation. This doesn't matter right
now, but it will become important for mach-o universal (fat) binaries.

llvm-svn: 243095

9 years ago[dsymutil] Refactor BinaryHolder internals. NFC
Frederic Riss [Fri, 24 Jul 2015 06:40:59 +0000 (06:40 +0000)]
[dsymutil] Refactor BinaryHolder internals. NFC

Call a helper that resets all the internal state of the BinaryHolder
when we change the underlying memory buffer. Makes a followup patch
a tiny bit smaller.

llvm-svn: 243094

9 years ago[AST] Perform additional canonicalization for DependentSizedArrayType
David Majnemer [Fri, 24 Jul 2015 05:54:19 +0000 (05:54 +0000)]
[AST] Perform additional canonicalization for DependentSizedArrayType

We treated DependentSizedArrayTypes with the same element type but
differing size expressions as equivalently canonical.  This would lead
to bizarre behavior during template instantiation.

This fixes PR24212.

llvm-svn: 243093

9 years agoCleanup ObjCInterfaceDecl lookup for ObjC literals
Alex Denisov [Fri, 24 Jul 2015 05:09:40 +0000 (05:09 +0000)]
Cleanup ObjCInterfaceDecl lookup for ObjC literals

llvm-svn: 243092

9 years agoHandle old style S packet correctly
Bhushan D. Attarde [Fri, 24 Jul 2015 04:06:20 +0000 (04:06 +0000)]
Handle old style S packet correctly

    SUMMARY:
    This patch fixes couple of issues:
    1. A thread tries to lock a mutex which is already locked.
    2. Updating a thread list before the stop packet is parsed so that it can get a valid thread id and allows to set the stop info correctly.

    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D11449

llvm-svn: 243091

9 years agoGenerating available_externally vtables for outline virtual functions
Piotr Padlewski [Fri, 24 Jul 2015 04:04:49 +0000 (04:04 +0000)]
Generating available_externally vtables for outline virtual functions

Generating available_externally vtables for optimizations purposes.
Unfortunatelly ItaniumABI doesn't guarantee that we will be able to
refer to virtual inline method by name.
But when we don't have any inline virtual methods, and key function is
not defined in this TU, we can generate that there will be vtable and
mark it as available_externally.

This is patch will help devirtualize better.
Differential Revision: http://reviews.llvm.org/D11441

llvm-svn: 243090

9 years agoRevert "Remove access to the DataLayout in the TargetMachine"
Mehdi Amini [Fri, 24 Jul 2015 03:36:55 +0000 (03:36 +0000)]
Revert "Remove access to the DataLayout in the TargetMachine"

This reverts commit 0f720d984f419c747709462f7476dff962c0bc41.

It breaks clang too badly, I need to prepare a proper patch for clang
first.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243089

9 years ago[Static Analyzer] Some tests do not turn on core checkers. Running the analyzers...
Gabor Horvath [Fri, 24 Jul 2015 03:25:13 +0000 (03:25 +0000)]
[Static Analyzer] Some tests do not turn on core checkers. Running the analyzers without the core checkers is not supported.

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

llvm-svn: 243088

9 years ago[bpf] initial support for debug_info
Alexei Starovoitov [Fri, 24 Jul 2015 03:17:08 +0000 (03:17 +0000)]
[bpf] initial support for debug_info

llvm-svn: 243087

9 years ago[llvm-reaobj] Display COFF-specific sections/tables only if the object is COFF.
Davide Italiano [Fri, 24 Jul 2015 02:14:20 +0000 (02:14 +0000)]
[llvm-reaobj] Display COFF-specific sections/tables only if the object is COFF.

Just skip them otherwise.

llvm-svn: 243086

9 years agoFix the cc1as crash when it outputs assembly
Steven Wu [Fri, 24 Jul 2015 02:12:43 +0000 (02:12 +0000)]
Fix the cc1as crash when it outputs assembly

In clang cc1as_main, when the output file type is “asm”, AsmStreamer
owns a formatted_raw_ostream which has a reference to FDOS
(raw_ostream), so AsmStreamer must be closed before FDOS is closed.

llvm-svn: 243085

9 years agoHandle resolvable branches in complete loop unroll heuristic.
Michael Zolotukhin [Fri, 24 Jul 2015 01:53:04 +0000 (01:53 +0000)]
Handle resolvable branches in complete loop unroll heuristic.

Summary:
Resolving a branch allows us to ignore blocks that won't be executed, and thus make our estimate more accurate.
This patch is intended to be applied after D10205 (though it could be applied independently).

Reviewers: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 243084

9 years agoRemove access to the DataLayout in the TargetMachine
Mehdi Amini [Fri, 24 Jul 2015 01:44:39 +0000 (01:44 +0000)]
Remove access to the DataLayout in the TargetMachine

Summary:
Replace getDataLayout() with a createDataLayout() method to make
explicit that it is intended to create a DataLayout only and not
accessing it for other purpose.

This change is the last of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned
by the module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

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

(cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243083

9 years agobuild: fix small typo in cmake doxygen build
Saleem Abdulrasool [Fri, 24 Jul 2015 01:14:25 +0000 (01:14 +0000)]
build: fix small typo in cmake doxygen build

A search word spelled as "searhc" in the LLVM_DOXYGEN_SEARCHENGINE_URL cmake
variable docstring.

Patch by Daniel Otero!

llvm-svn: 243082

9 years agoMIRParser/LLVMBuild.txt: Add MC for MCRegisterInfo::getDwarfRegNum().
NAKAMURA Takumi [Fri, 24 Jul 2015 01:12:36 +0000 (01:12 +0000)]
MIRParser/LLVMBuild.txt: Add MC for MCRegisterInfo::getDwarfRegNum().

llvm-svn: 243081

9 years agoReorder alphabetically.
NAKAMURA Takumi [Fri, 24 Jul 2015 01:12:28 +0000 (01:12 +0000)]
Reorder alphabetically.

llvm-svn: 243080

9 years agoClean up function attributes on PPC fast-isel tests.
Eric Christopher [Fri, 24 Jul 2015 01:07:50 +0000 (01:07 +0000)]
Clean up function attributes on PPC fast-isel tests.

llvm-svn: 243079

9 years ago[libFuzzer] allow users to supply their own implementation of rand
Kostya Serebryany [Fri, 24 Jul 2015 01:06:40 +0000 (01:06 +0000)]
[libFuzzer] allow users to supply their own implementation of rand

llvm-svn: 243078

9 years agoFix an issue where LLDB would run out of stack space trying to decide if a deeply...
Enrico Granata [Fri, 24 Jul 2015 00:57:19 +0000 (00:57 +0000)]
Fix an issue where LLDB would run out of stack space trying to decide if a deeply nested child can be updated in the face of an invalid execution context

The issue is that a child can't really ask the root object, since this decision could actually hinge on whether a dynamic and/or synthetic value is present
To do this, make values vote lazily for whether they are willing to allow this, so that we can navigate up the chain without recursively invoking ourselves

Tentative fix for rdar://21949558

llvm-svn: 243077

9 years ago[RewriteStatepointsForGC] Fix release build warning
Philip Reames [Fri, 24 Jul 2015 00:42:55 +0000 (00:42 +0000)]
[RewriteStatepointsForGC] Fix release build warning

llvm-svn: 243076

9 years agoAdd missing underlines for a docs section. NFC
Jonathan Roelofs [Fri, 24 Jul 2015 00:29:50 +0000 (00:29 +0000)]
Add missing underlines for a docs section. NFC

llvm-svn: 243075

9 years agoAdd UNUSED_IF_ASSERT_DISABLED and apply it.
Bruce Mitchener [Fri, 24 Jul 2015 00:23:29 +0000 (00:23 +0000)]
Add UNUSED_IF_ASSERT_DISABLED and apply it.

Summary:
This replaces (void)x; usages where they x was subsequently
involved in an assertion with this macro to make the
intent more clear.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 243074

9 years agounwind: Fix libc++abi and libgcc build.
Logan Chien [Fri, 24 Jul 2015 00:16:48 +0000 (00:16 +0000)]
unwind: Fix libc++abi and libgcc build.

To build libc++abi without libunwind, we should make sure that all
function calls to _Unwind_{Get,Set}{GR,IP}() are inlined as function
calls to _Unwind_VRS_{Get,Set}().  Otherwise, libc++abi.so will fail to
link since libgcc does not provide these symbol at all.

This commit fixes the problem by providing both the inlined version and
exported version.

llvm-svn: 243073

9 years agoFix Mac OS X build, debugserver version handling.
Bruce Mitchener [Fri, 24 Jul 2015 00:13:45 +0000 (00:13 +0000)]
Fix Mac OS X build, debugserver version handling.

Summary:
No longer rely on cmake to set DEBUGSERVER_VERSION_STR,
but now generate the _vers.c file like xcode does
and include the generated file into the build on Mac OS X.

This fixes the cmake Mac OS X build after an earlier change
by Jason Molenda.

Reviewers: clayborg, jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 243072

9 years ago[RewriteStatepointsForGC] Use a worklist algorithm for first part of base pointer...
Philip Reames [Fri, 24 Jul 2015 00:02:11 +0000 (00:02 +0000)]
[RewriteStatepointsForGC] Use a worklist algorithm for first part of base pointer algorithm [NFC]

The new code should hopefully be equivalent to the old code; it just uses a worklist to track instructions which need to visited rather than iterating over all instructions visited each time. This should be faster, but the primary benefit is that the purpose should be more clear and the diff of adding another instruction type (forthcoming) much more obvious.

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

llvm-svn: 243071

9 years agotest commit, only added one space
Lawrence Hu [Thu, 23 Jul 2015 23:55:28 +0000 (23:55 +0000)]
test commit, only added one space

llvm-svn: 243070

9 years agoFix the equal-vector-size rule for reinterpret_casts in C++
John McCall [Thu, 23 Jul 2015 23:54:07 +0000 (23:54 +0000)]
Fix the equal-vector-size rule for reinterpret_casts in C++
to consider the storage size of the vector instead of its
sizeof.  In other words, ban <3 x int> to <4 x int> casts,
which produced invalid IR anyway.

Also, attempt to be a little more rigorous, or at least
explicit, about when enums are allowed in these casts.

rdar://21901132

llvm-svn: 243069

9 years agoInstrProf: Fix a typo in the test for r243066
Justin Bogner [Thu, 23 Jul 2015 23:34:26 +0000 (23:34 +0000)]
InstrProf: Fix a typo in the test for r243066

llvm-svn: 243068

9 years agoDisable mutex error checking so it doesn't create problems with the multi-threaded...
Greg Clayton [Thu, 23 Jul 2015 23:32:08 +0000 (23:32 +0000)]
Disable mutex error checking so it doesn't create problems with the multi-threaded test case. The error would cause an assertion that could cause lldb to crash when unlocking a mutex returned an error because it was in use.

llvm-svn: 243067

9 years agoInstrProf: Don't extend coverage regions into the catch keyword
Justin Bogner [Thu, 23 Jul 2015 23:24:21 +0000 (23:24 +0000)]
InstrProf: Don't extend coverage regions into the catch keyword

The catch keyword isn't really part of a region, so it's fairly
meaningless to extend into it. This was usually harmless, but it could
crash when catch blocks involved macros in strange ways.

llvm-svn: 243066

9 years ago[NaryReassociate] remove redundant code
Jingyue Wu [Thu, 23 Jul 2015 23:13:37 +0000 (23:13 +0000)]
[NaryReassociate] remove redundant code

This check is already done by findClosestMatchingDominator.

llvm-svn: 243065

9 years agoMIR Serialization: Serialize the '.cfi_offset' CFI instruction.
Alex Lorenz [Thu, 23 Jul 2015 23:09:07 +0000 (23:09 +0000)]
MIR Serialization: Serialize the '.cfi_offset' CFI instruction.

Reviewers: Duncan P. N. Exon Smith
llvm-svn: 243062

9 years agoFix -Wextra-semi.
Rui Ueyama [Thu, 23 Jul 2015 23:03:55 +0000 (23:03 +0000)]
Fix -Wextra-semi.

Patch from Eugene.Zelenko!

llvm-svn: 243060

9 years agoWebAssembly: test that valid -mcpu flags are accepted.
JF Bastien [Thu, 23 Jul 2015 23:00:04 +0000 (23:00 +0000)]
WebAssembly: test that valid -mcpu flags are accepted.

Summary: AArch64 has a similar test.

Subscribers: sunfish, aemerson, llvm-commits, jfb

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

llvm-svn: 243058

9 years agofix crash in machine trace metrics due to processing dbg_value instructions (PR24199)
Sanjay Patel [Thu, 23 Jul 2015 22:56:53 +0000 (22:56 +0000)]
fix crash in machine trace metrics due to processing dbg_value instructions (PR24199)

The test in PR24199 ( https://llvm.org/bugs/show_bug.cgi?id=24199 ) crashes because machine
trace metrics was not ignoring dbg_value instructions when calculating data dependencies.

The machine-combiner pass asks machine trace metrics to calculate an instruction trace,
does some reassociations, and calls MachineInstr::eraseFromParentAndMarkDBGValuesForRemoval()
along with MachineTraceMetrics::invalidate(). The dbg_value instructions have their operands
invalidated, but the instructions are not expected to be deleted.

On a subsequent loop iteration of the machine-combiner pass, machine trace metrics would be
called again and die while accessing the invalid debug instructions.

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

llvm-svn: 243057

9 years ago[RewriteStatepointsForGC] Rename PhiState to reflect that it's associated w/more...
Philip Reames [Thu, 23 Jul 2015 22:49:14 +0000 (22:49 +0000)]
[RewriteStatepointsForGC] Rename PhiState to reflect that it's associated w/more than just PHIs

Today, Select instructions also have associated PhiStates.  In the near future, so will ExtractElement and SuffleVector.

llvm-svn: 243056

9 years ago[sanitizer] Fix double definition of a function.
Evgeniy Stepanov [Thu, 23 Jul 2015 22:37:39 +0000 (22:37 +0000)]
[sanitizer] Fix double definition of a function.

llvm-svn: 243055

9 years ago[RewriteStatepointsForGC] Use idomatic mechanisms for debug tracing [NFC]
Philip Reames [Thu, 23 Jul 2015 22:25:26 +0000 (22:25 +0000)]
[RewriteStatepointsForGC] Use idomatic mechanisms for debug tracing [NFC]

Deleting much of the code using trace-rewrite-statepoints and use idiomatic DEBUG statements instead.  This includes adding operator<< to a helper class.

llvm-svn: 243054

9 years agoSeveral improvements to the Either<T,U> type
Enrico Granata [Thu, 23 Jul 2015 22:17:39 +0000 (22:17 +0000)]
Several improvements to the Either<T,U> type

llvm-svn: 243053

9 years ago[ARM] Register (existing) ARMLoadStoreOpt pass with LLVM pass manager.
David Gross [Thu, 23 Jul 2015 22:12:46 +0000 (22:12 +0000)]
[ARM] Register (existing) ARMLoadStoreOpt pass with LLVM pass manager.

Summary: Among other things, this allows -print-after-all/-print-before-all to dump IR around this pass.

Subscribers: aemerson, llvm-commits, rengolin

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

llvm-svn: 243052

9 years ago[sanitizer] Implement logging to syslog.
Evgeniy Stepanov [Thu, 23 Jul 2015 22:05:20 +0000 (22:05 +0000)]
[sanitizer] Implement logging to syslog.

Previously, Android target had a logic of duplicating all sanitizer
output to logcat. This change extends it to all posix platforms via
the use of syslog, controlled by log_to_syslog flag. Enabled by
default on Android, off everywhere else.

A bit of cmake magic is required to allow Printf() to call a libc
function. I'm adding a stub implementation to support no-libc builds
like dfsan and safestack.

This is a second attempt. I believe I've fixed all the issues that
prompted the revert: Mac build, and all kinds of non-CMake builds
(there are 3 of those).

llvm-svn: 243051

9 years agoMoving tests in to X86 directory.
Colin LeMahieu [Thu, 23 Jul 2015 21:55:26 +0000 (21:55 +0000)]
Moving tests in to X86 directory.

llvm-svn: 243049

9 years agoAdd documentation for the objc_boxable attribute
Alex Denisov [Thu, 23 Jul 2015 21:53:13 +0000 (21:53 +0000)]
Add documentation for the objc_boxable attribute

llvm-svn: 243048

9 years agoTest commit.
David Gross [Thu, 23 Jul 2015 21:46:09 +0000 (21:46 +0000)]
Test commit.

llvm-svn: 243046

9 years ago[RewriteStatepointsForGC] Simplify code around meet of PhiStates [NFC]
Philip Reames [Thu, 23 Jul 2015 21:41:27 +0000 (21:41 +0000)]
[RewriteStatepointsForGC] Simplify code around meet of PhiStates [NFC]

We don't need to pass in the map from BDV to PhiStates; we can instead handle that externally and let the MeetPhiStates helper class just meet PhiStates.

llvm-svn: 243045

9 years agoUsing an input object file instead of trying to generate an object file.
Colin LeMahieu [Thu, 23 Jul 2015 21:40:19 +0000 (21:40 +0000)]
Using an input object file instead of trying to generate an object file.

llvm-svn: 243044

9 years agoSpecifying a test triple.
Colin LeMahieu [Thu, 23 Jul 2015 21:24:52 +0000 (21:24 +0000)]
Specifying a test triple.

llvm-svn: 243042

9 years ago[llvm-objdump] Add -D and --disassemble-all flags that attempt disassembly on all...
Colin LeMahieu [Thu, 23 Jul 2015 20:58:49 +0000 (20:58 +0000)]
[llvm-objdump] Add -D and --disassemble-all flags that attempt disassembly on all sections instead of just text sections.

llvm-svn: 243041

9 years ago[Scalarizer] Fix potential for stale data in Scattered across invocations
Matt Wala [Thu, 23 Jul 2015 20:53:46 +0000 (20:53 +0000)]
[Scalarizer] Fix potential for stale data in Scattered across invocations

Summary:
Scalarizer has two data structures that hold information about changes
to the function, Gathered and Scattered. These are cleared in finish()
at the end of runOnFunction() if finish() detects any changes to the
function.

However, finish() was checking for changes by only checking if
Gathered was non-empty. The function visitStore() only modifies
Scattered without touching Gathered. As a result, Scattered could have
ended up having stale data if Scalarizer only scalarized store
instructions. Since the data in Scattered is used during the execution
of the pass, this introduced dangling pointer errors.

The fix is to check whether both Scattered and Gathered are empty
before deciding what to do in finish(). This also fixes a problem
where the Function can be modified although the pass returns false.

Reviewers: rnk

Subscribers: rnk, srhines, llvm-commits

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

llvm-svn: 243040

9 years agoSema: Avoid a stack overflow on large CFGs
Duncan P. N. Exon Smith [Thu, 23 Jul 2015 20:15:50 +0000 (20:15 +0000)]
Sema: Avoid a stack overflow on large CFGs

Large CFGs cause `checkForFunctionCall()` to overflow its stack.  Break
the recursion by manually managing the call stack instead.

Patch by Vedant Kumar!

llvm-svn: 243039