platform/upstream/llvm.git
9 years ago[mips][FastISel] Handle calls with non legal types i8 and i16.
Vasileios Kalintiris [Tue, 12 May 2015 12:29:17 +0000 (12:29 +0000)]
[mips][FastISel] Handle calls with non legal types i8 and i16.

Summary: Allow calls with non legal integer types based on i8 and i16 to be processed by mips fast-isel.

Based on a patch by Reed Kotler.

Test Plan:
"Make check" test forthcoming.
Test-suite passes at O0/O2 and with mips32 r1/r2

Reviewers: rkotler, dsanders

Subscribers: llvm-commits, rfuhler

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

llvm-svn: 237121

9 years ago[clang-tidy] Treat all types with non-trivial destructors as RAII.
Alexander Kornienko [Tue, 12 May 2015 12:17:20 +0000 (12:17 +0000)]
[clang-tidy] Treat all types with non-trivial destructors as RAII.

This solves some false negatives at a cost of adding some false positives that
can be fixed easily and (almost) automatically.

llvm-svn: 237120

9 years ago[mips][FastISel] Simplify callabi.ll by using multiple check prefixes.
Vasileios Kalintiris [Tue, 12 May 2015 12:17:11 +0000 (12:17 +0000)]
[mips][FastISel] Simplify callabi.ll by using multiple check prefixes.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237119

9 years agoDisable GCC optimizations for builtin functions in lldb tests
Ilia K [Tue, 12 May 2015 12:13:12 +0000 (12:13 +0000)]
Disable GCC optimizations for builtin functions in lldb tests

This patch adds new default flag -fno-builtin which forces gcc to not optimize builtin functions.
For example, without this flag GCC replaces printf("hello\n") -> puts("hello") even if -O0 was specified

Also this patch fixes the MiDataTestCase.test_lldbmi_data_disassemble test on Linux/gcc.

llvm-svn: 237118

9 years ago[mips][FastISel] Allow computation of addresses from constant expressions.
Vasileios Kalintiris [Tue, 12 May 2015 12:08:31 +0000 (12:08 +0000)]
[mips][FastISel] Allow computation of addresses from constant expressions.

Summary:
Try to compute addresses when the offset from a memory location is a constant
expression.

Based on a patch by Reed Kotler.

Test Plan:
Passes test-suite for -O0/O2 and mips 32 r1/r2

Reviewers: rkotler, dsanders

Subscribers: llvm-commits, aemerson, rfuhler

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

llvm-svn: 237117

9 years agoFix misleading parameter name for PPCallbacks::FileSkipped.
Nikola Smiljanic [Tue, 12 May 2015 11:48:21 +0000 (11:48 +0000)]
Fix misleading parameter name for PPCallbacks::FileSkipped.

Patch thanks to Vladimir Voskresensky.

llvm-svn: 237116

9 years agoFix misleading parameter name for PPCallbacks::FileSkipped.
Nikola Smiljanic [Tue, 12 May 2015 11:48:05 +0000 (11:48 +0000)]
Fix misleading parameter name for PPCallbacks::FileSkipped.

Patch thanks to Vladimir Voskresensky.

llvm-svn: 237115

9 years agoclang-format: Make member introduced in r237108 const.
Daniel Jasper [Tue, 12 May 2015 11:14:06 +0000 (11:14 +0000)]
clang-format: Make member introduced in r237108 const.

llvm-svn: 237114

9 years agoChange TargetParser enum names to avoid macro conflicts (clang)
Renato Golin [Tue, 12 May 2015 10:34:10 +0000 (10:34 +0000)]
Change TargetParser enum names to avoid macro conflicts (clang)

sys/time.h on Solaris (and possibly other systems) defines "SEC" as "1"
using a cpp macro.  The result is that this fails to compile.

Fixes https://llvm.org/PR23482

llvm-svn: 237113

9 years agoChange TargetParser enum names to avoid macro conflicts (llvm)
Renato Golin [Tue, 12 May 2015 10:33:58 +0000 (10:33 +0000)]
Change TargetParser enum names to avoid macro conflicts (llvm)

sys/time.h on Solaris (and possibly other systems) defines "SEC" as "1"
using a cpp macro.  The result is that this fails to compile.

Fixes https://llvm.org/PR23482

llvm-svn: 237112

9 years agoReturn the correct user register count for arm from NativeRegisterContext
Tamas Berghammer [Tue, 12 May 2015 10:27:45 +0000 (10:27 +0000)]
Return the correct user register count for arm from NativeRegisterContext

The defult implementation falls back to GetRegisterCount what
includes the debug registers also what shouldn't be displayed to
the user.

llvm-svn: 237111

9 years agoclang-format: Fix */& detection for lambdas in macros.
Daniel Jasper [Tue, 12 May 2015 10:20:32 +0000 (10:20 +0000)]
clang-format: Fix */& detection for lambdas in macros.

Before:
  #define MACRO() [](A * a) { return 1; }

After:
  #define MACRO() [](A *a) { return 1; }

llvm-svn: 237109

9 years agoclang-format: Fix hanging nested blocks in macros.
Daniel Jasper [Tue, 12 May 2015 10:16:02 +0000 (10:16 +0000)]
clang-format: Fix hanging nested blocks in macros.

Before:
  #define MACRO()                     \
    Debug(aaa, /* force line break */ \
          {                           \
      int i;                          \
      int j;                          \
          })

After:
  #define MACRO()                     \
    Debug(aaa, /* force line break */ \
          {                           \
            int i;                    \
            int j;                    \
          })

llvm-svn: 237108

9 years agoAVX-512: asm parser errors check
Elena Demikhovsky [Tue, 12 May 2015 09:47:23 +0000 (09:47 +0000)]
AVX-512: asm parser errors check
I reverted the error check that was removed in 236416.
I put the it in a separate file.

llvm-svn: 237107

9 years agoAVX-512: select operation for i1 vectors
Elena Demikhovsky [Tue, 12 May 2015 09:36:52 +0000 (09:36 +0000)]
AVX-512: select operation for i1 vectors
like: select i1 %cond, <16 x i1> %a, <16 x i1> %b.
I added pseudo-CMOV patterns to resolve the "select".
Added tests for KNL and SKX.

llvm-svn: 237106

9 years agoFix MiDataTestCase.test_lldbmi_data_disassemble test on Linux (bug 23489)
Ilia K [Tue, 12 May 2015 09:24:24 +0000 (09:24 +0000)]
Fix MiDataTestCase.test_lldbmi_data_disassemble test on Linux (bug 23489)

llvm-svn: 237105

9 years agoRefactor clang-format's formatter.
Manuel Klimek [Tue, 12 May 2015 09:23:57 +0000 (09:23 +0000)]
Refactor clang-format's formatter.

Summary:
a) Pull out a class LevelIndentTracker whose responsibility is to keep track
   of the indent of levels across multiple annotated lines.
b) Put all responsibility for merging lines into the LineJoiner; make the
   LineJoiner iterate over the lines so we never operate on a line that might
   be merged later; this makes the interface safer to use.
c) Move formatting of the end-of-file whitespace into formatFirstToken.

Fix bugs that became obvious after the refactoring:
1. We would not format lines with offsets correctly inside nested blocks if
   only the outer expression was affected:
   int x = s({ // clang-format only this line
     class X {
       public:
    // ^ this starts at the non-modified indnent level; previously we would
    //   not fix this, now we correctly outdent it.
       void f();
     };
   });
2. We would incorrectly align comments across lines that do not have comments
   for lines with nested blocks:
   int expression; // with comment
   int x = s({
     int y; // comment
     int z; // we would incorrectly align this comment with the comment on
            // 'expression'
   });

llvm-svn: 237104

9 years agoRemove handling of eStateStopped from NativeProcessLinux::Resume
Pavel Labath [Tue, 12 May 2015 09:03:18 +0000 (09:03 +0000)]
Remove handling of eStateStopped from NativeProcessLinux::Resume

Summary:
NPL::Resume attempted to handle eStateStopped as a resume action. However:
- GDBRemoteCommunicationServerLLGS (the only user of NPL) never sets this action
- it could set this action in response to a vCont:t packet, but LLDB never produces this packet
- gdb-remote protocol documentation says vCont:t packet is used only in non-stop mode, but LLDB
  does not support non-stop mode
- even if LLDB supported non-stop mode, this implementation of eStateStopped does something
  different from what the spec says it should (according to spec, it should stop the specified
  thread, but this seems to want to stop all threads).

Given the facts above, I believe we should remove this unused and untested code, as it probably
doesn't even work and removing it makes the rest of the code noticably simpler.

Reviewers: ovyalov, chaoren

Subscribers: lldb-commits

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

llvm-svn: 237103

9 years ago[OPENMP] Allow using of threadprivate variables as loop-control variables in lop...
Alexey Bataev [Tue, 12 May 2015 09:02:07 +0000 (09:02 +0000)]
[OPENMP] Allow using of threadprivate variables as loop-control variables in lop based directives.

llvm-svn: 237102

9 years ago[NativeProcessLinux] Remove event mutex and clean functions using it
Pavel Labath [Tue, 12 May 2015 08:35:33 +0000 (08:35 +0000)]
[NativeProcessLinux] Remove event mutex and clean functions using it

Summary:
Since the former-TSC events are now processed synchronously, there is no need for to protect them
with a separate mutex - all the actions are now guarded by the big m_threads_mutex.

With the mutex gone, the following functions, no longer have any purpose and were removed:
NotifyThreadCreate: replaced by direct calls to ThreadWasCreated
NotifyThreadStop: replaced by direct calls to ThreadDidStop
NotifyThreadDeath: folded into StopTrackingThread
ResetForExec: inlined as it consisted of a single line of code
RequestThreadResume(AsNeeded): replaced by direct calls to ResumeThread
StopThreads: removed, as it was never called

Test Plan: tests continue to pass

Reviewers: ovyalov, chaoren

Subscribers: lldb-commits

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

llvm-svn: 237101

9 years ago[OPENMP] Fixed support for 'schedule' clause with non-constant chunk size.
Alexey Bataev [Tue, 12 May 2015 08:35:28 +0000 (08:35 +0000)]
[OPENMP] Fixed support for 'schedule' clause with non-constant chunk size.

'schedule' clause for combined directives requires additional processing. Special helper variable is generated, that is captured in the outlined parallel region for 'parallel for' region. This captured variable is used to store chunk expression from the 'schedule' clause in this 'parallel for' region.

llvm-svn: 237100

9 years agoRename IslCodeGeneration to CodeGeneration
Tobias Grosser [Tue, 12 May 2015 07:45:52 +0000 (07:45 +0000)]
Rename IslCodeGeneration to CodeGeneration

Besides class, function and file names, we also change the command line option
from -polly-codegen-isl to just -polly-codegen. The isl postfix is a leftover
from the times when we still had the CLooG based -polly-codegen. Today it is
just redundant and we drop it.

llvm-svn: 237099

9 years agoSkip MiDataTestCase.test_lldbmi_data_disassemble test to get Linux build green
Ilia K [Tue, 12 May 2015 07:35:06 +0000 (07:35 +0000)]
Skip MiDataTestCase.test_lldbmi_data_disassemble test to get Linux build green

llvm-svn: 237098

9 years ago[X86] DAGCombine should not assume arbitrary vector types are simple
Michael Kuperstein [Tue, 12 May 2015 07:33:07 +0000 (07:33 +0000)]
[X86] DAGCombine should not assume arbitrary vector types are simple

The X86-specific DAGCombine for stores should not assume vector types are always simple.
This fixes PR23476.

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

llvm-svn: 237097

9 years agoImprove MiStartupOptionsTestCase.test_lldbmi_executable_option_file test (MI)
Ilia K [Tue, 12 May 2015 06:49:49 +0000 (06:49 +0000)]
Improve MiStartupOptionsTestCase.test_lldbmi_executable_option_file test (MI)

llvm-svn: 237096

9 years agoDriver: Fix a -Wshadow issue from r237091
Justin Bogner [Tue, 12 May 2015 06:30:48 +0000 (06:30 +0000)]
Driver: Fix a -Wshadow issue from r237091

The MachO toolchain has an isTargetIOSBased method, but it isn't
virtual so it isn't very meaningful to call it. After thinking about
this, I guess that putting this logic in the MachO class is a bit of a
layering violation anyway. Do this more like how we handle
AddLinkRuntimeLibArgs instead.

llvm-svn: 237095

9 years agoShow error message from failed evaluation when doing -var-create
Ilia K [Tue, 12 May 2015 06:15:16 +0000 (06:15 +0000)]
Show error message from failed evaluation when doing -var-create

Summary:
When -var-create fails, we will now show the error message from the failed evaluation if it is available.

Patch from chuckr@microsoft.com

Test Plan: I fixed the MiVarTestCase.test_lldbmi_eval test to expect the new error string. All MI tests passing on OS X.

Reviewers: abidh, ChuckR

Subscribers: greggm, lldb-commits, paulmaybee

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

llvm-svn: 237094

9 years agoRemove unnecessary forward declaration.
Craig Topper [Tue, 12 May 2015 06:09:57 +0000 (06:09 +0000)]
Remove unnecessary forward declaration.

llvm-svn: 237093

9 years agoEscape strings in disassembly comments.
Ilia K [Tue, 12 May 2015 05:55:23 +0000 (05:55 +0000)]
Escape strings in disassembly comments.

Summary: Patch from chuckr@microsoft.com

Reviewers: abidh, ChuckR

Subscribers: paulmaybee, lldb-commits

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

llvm-svn: 237092

9 years agoRe-apply "Driver: Make profiling flags work with -nostdlib on Darwin"
Justin Bogner [Tue, 12 May 2015 05:44:36 +0000 (05:44 +0000)]
Re-apply "Driver: Make profiling flags work with -nostdlib on Darwin"

This time without a stray "true" in an argument list.

This reverts r237077, restoring r237074.

llvm-svn: 237091

9 years agoRemove unnecessary variables by folding calls into for loop header. NFC.
Craig Topper [Tue, 12 May 2015 05:25:10 +0000 (05:25 +0000)]
Remove unnecessary variables by folding calls into for loop header. NFC.

llvm-svn: 237090

9 years agoTestPublicAPIHeaders.py - Changed expectedFailureDarwin to skipIfDarwin
Vince Harron [Tue, 12 May 2015 05:18:06 +0000 (05:18 +0000)]
TestPublicAPIHeaders.py - Changed expectedFailureDarwin to skipIfDarwin

expectedFailure doesn't work if the failure is in a teardown step.

llvm-svn: 237089

9 years agorevert r237081 -- bad idea (-lcrypt may not be present)
Kostya Serebryany [Tue, 12 May 2015 03:10:42 +0000 (03:10 +0000)]
revert r237081 -- bad idea (-lcrypt may not be present)

llvm-svn: 237086

9 years agoWorking on getting the OSX build green
Vince Harron [Tue, 12 May 2015 02:20:27 +0000 (02:20 +0000)]
Working on getting the OSX build green

Added missing SBLanguageRuntime.h to lldb.xcodeproj, set to Public (fixed compile error in TestPublicAPIHeaders)
Removed reference to (temporarily) missing gtest.xcodeproj
Fixed TestDeadStrip compile error
XFAIL TestPublicAPIHeaders - test passes but teardown command 'settings remove target.env-vars DYLD_LIBRARY_PATH' fails
XFAIL TestCModules - use of undeclared identifier 'MIN'
XFAIL TestModulesAutoImport - clang: error: unknown argument: '-gmodules'
XFAIL TestObjCNewSyntax - expr -- @((char*)"Hello world" + 6) cannot box a string value because NSString has not been declared

http://reviews.llvm.org/D9643

llvm-svn: 237085

9 years agoApply LLDB_API modifier to SBPlatform and SBPlatformShellCommand.
Oleksiy Vyalov [Tue, 12 May 2015 02:04:26 +0000 (02:04 +0000)]
Apply LLDB_API modifier to SBPlatform and SBPlatformShellCommand.

llvm-svn: 237084

9 years ago[lib/Fuzzer] remove the -dfsan=1 flag, just use -use_traces=1 (w/ or w/o dfsan)
Kostya Serebryany [Tue, 12 May 2015 01:58:34 +0000 (01:58 +0000)]
[lib/Fuzzer] remove the -dfsan=1 flag, just use -use_traces=1 (w/ or w/o dfsan)

llvm-svn: 237083

9 years ago[lib/Fuzzer] detach the pulse thread instad of joining it
Kostya Serebryany [Tue, 12 May 2015 01:43:20 +0000 (01:43 +0000)]
[lib/Fuzzer] detach the pulse thread instad of joining it

llvm-svn: 237082

9 years agoadd -lcrypto to clang and clang-format fuzzers (lib/Fuzzer will soon require it)
Kostya Serebryany [Tue, 12 May 2015 01:29:04 +0000 (01:29 +0000)]
add -lcrypto to clang and clang-format fuzzers (lib/Fuzzer will soon require it)

llvm-svn: 237081

9 years agoRemove the code that pulled soft float attributes out of the feature
Eric Christopher [Tue, 12 May 2015 01:26:21 +0000 (01:26 +0000)]
Remove the code that pulled soft float attributes out of the feature
strings and remove the setting of TargetOptions::UseSoftFloat to
match the code change in llvm r237079.

llvm-svn: 237080

9 years agoMigrate existing backends that care about software floating point
Eric Christopher [Tue, 12 May 2015 01:26:05 +0000 (01:26 +0000)]
Migrate existing backends that care about software floating point
to use the information in the module rather than TargetOptions.

We've had and clang has used the use-soft-float attribute for some
time now so have the backends set a subtarget feature based on
a particular function now that subtargets are created based on
functions and function attributes.

For the one middle end soft float check go ahead and create
an overloadable TargetLowering::useSoftFloat function that
just checks the TargetSubtargetInfo in all cases.

Also remove the command line option that hard codes whether or
not soft-float is set by using the attribute for all of the
target specific test cases - for the generic just go ahead and
add the attribute in the one case that showed up.

llvm-svn: 237079

9 years agoGet lldb-server building on android-9
Vince Harron [Tue, 12 May 2015 01:10:56 +0000 (01:10 +0000)]
Get lldb-server building on android-9

Build lldb-server with an android-9 sysroot.

llvm-svn: 237078

9 years agoRevert "Driver: Make profiling flags work with -nostdlib on Darwin"
Justin Bogner [Tue, 12 May 2015 01:04:33 +0000 (01:04 +0000)]
Revert "Driver: Make profiling flags work with -nostdlib on Darwin"

This revert r237074. These tests are failing all over the place.

llvm-svn: 237077

9 years agoChange session log filename pattern: test before arch
Vince Harron [Tue, 12 May 2015 00:50:54 +0000 (00:50 +0000)]
Change session log filename pattern: test before arch

This is a very minor change.

Just reshuffle the elements of the log filename so that the test name
comes before the arch/compiler

Before:
Failure-x86_64-clang-TestCModules.CModulesTestCase.test_expr_with_dwarf.log

After:
Failure-TestCModules.CModulesTestCase.test_expr_with_dwarf-x86_64-clang.log

This way, results are grouped by test name, not by arch. I think this
is much more useful.

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

llvm-svn: 237076

9 years agoRemove Triple Vendor check when creating FreeBSD Platform
Ed Maste [Tue, 12 May 2015 00:43:45 +0000 (00:43 +0000)]
Remove Triple Vendor check when creating FreeBSD Platform

This is equivalent to r237052 in PlatformLinux.cpp.

llvm-svn: 237075

9 years agoDriver: Make profiling flags work with -nostdlib on Darwin
Justin Bogner [Tue, 12 May 2015 00:31:33 +0000 (00:31 +0000)]
Driver: Make profiling flags work with -nostdlib on Darwin

Compiler-rt's Profiling library isn't part of the stdlib, so -nostdlib
shouldn't prevent it from being linked. This makes Darwin behave like
other toolchains, and link in the profile runtime irrespective of
-nostdlib, since the resulting program can't be run unless you link
this.

I've also added a test to show that other toolchains already behave
like this.

llvm-svn: 237074

9 years agoAllow empty assembly string literal with -fno-gnu-inline-asm
Steven Wu [Tue, 12 May 2015 00:16:37 +0000 (00:16 +0000)]
Allow empty assembly string literal with -fno-gnu-inline-asm

Empty assembly string will not introduce assembly code in the output
binary and it is often used as a trick in the header to disable
optimizations. It doesn't conflict with the purpose of the option so it
is allowed with -fno-gnu-inline-asm flag.

llvm-svn: 237073

9 years agoFixing memory leak
Andrew Kaylor [Tue, 12 May 2015 00:13:51 +0000 (00:13 +0000)]
Fixing memory leak

llvm-svn: 237072

9 years agoUpdate initialization of a class variable and comment.
Eric Christopher [Tue, 12 May 2015 00:04:20 +0000 (00:04 +0000)]
Update initialization of a class variable and comment.

llvm-svn: 237071

9 years agoRefactoring gc_relocate related code in CodeGenPrepare.cpp
Sanjoy Das [Mon, 11 May 2015 23:47:30 +0000 (23:47 +0000)]
Refactoring gc_relocate related code in CodeGenPrepare.cpp

Summary:
The original code inserted new instructions by following a
Create->Remove->ReInsert flow. This patch removes the unnecessary
Remove->ReInsert part by setting up the InsertPoint correctly at the
very beginning. This change does not introduce any functionality change.

Patch by Chen Li!

Reviewers: reames, AndyAyers, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

llvm-svn: 237070

9 years agoRename variables in gc_relocate related functions to follow LLVM's naming conventions.
Sanjoy Das [Mon, 11 May 2015 23:47:27 +0000 (23:47 +0000)]
Rename variables in gc_relocate related functions to follow LLVM's naming conventions.

Summary:
This patch is to rename some variables to CamelCase in gc_relocate
related functions. There is no functionality change.

Patch by Chen Li!

Reviewers: reames, AndyAyers, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

llvm-svn: 237069

9 years agoTypo fix: s/initialzier/initializer/ in a doc comment.
James Dennett [Mon, 11 May 2015 23:25:54 +0000 (23:25 +0000)]
Typo fix: s/initialzier/initializer/ in a doc comment.

No functional change.

llvm-svn: 237068

9 years ago[lib/Fuzzer] don't record traces when trace collection is off
Kostya Serebryany [Mon, 11 May 2015 23:25:28 +0000 (23:25 +0000)]
[lib/Fuzzer] don't record traces when trace collection is off

llvm-svn: 237067

9 years ago[MemCpyOpt] Look at any dependency -not just source- for memset+memcpy.
Ahmed Bougacha [Mon, 11 May 2015 23:09:46 +0000 (23:09 +0000)]
[MemCpyOpt] Look at any dependency -not just source- for memset+memcpy.

This fixes another miscompile introduced by r235232: when there was a
dependency on the memcpy destination other than the memset, we would
ignore it, because we only looked at the source dependency.

It was a mistake to use SrcDepInfo.  Instead, just use DepInfo.

llvm-svn: 237066

9 years agoSimplify a return expression and an access to an alloca's allocated type
David Blaikie [Mon, 11 May 2015 23:09:25 +0000 (23:09 +0000)]
Simplify a return expression and an access to an alloca's allocated type

llvm-svn: 237065

9 years agoPR20625: Instantiate static constexpr member function of a local struct in a function...
Richard Smith [Mon, 11 May 2015 23:09:06 +0000 (23:09 +0000)]
PR20625: Instantiate static constexpr member function of a local struct in a function template earlier.

This is necessary in order to allow the use of a constexpr member function, or
a member function with deduced return type, of a local class within a
surrounding instantiated function template specialization.

Patch by Michael Park!

This re-commits r236063, which was reverted in r236134, along with a fix for a
delayed template parsing bug that was exposed by this change.

llvm-svn: 237064

9 years ago[WinEH] Handle nested landing pads that return directly to the parent function.
Andrew Kaylor [Mon, 11 May 2015 23:06:02 +0000 (23:06 +0000)]
[WinEH] Handle nested landing pads that return directly to the parent function.

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

llvm-svn: 237063

9 years agoAdd more missing #includes, found by modules build.
Richard Smith [Mon, 11 May 2015 22:41:07 +0000 (22:41 +0000)]
Add more missing #includes, found by modules build.

llvm-svn: 237062

9 years agoAdd missing #include, found by modules build.
Richard Smith [Mon, 11 May 2015 22:32:06 +0000 (22:32 +0000)]
Add missing #include, found by modules build.

llvm-svn: 237061

9 years agoAdd missing #includes, found by modules build.
Richard Smith [Mon, 11 May 2015 22:31:40 +0000 (22:31 +0000)]
Add missing #includes, found by modules build.

llvm-svn: 237060

9 years agoReaddress r236990, use of static members on a non-static variable.
David Blaikie [Mon, 11 May 2015 22:20:48 +0000 (22:20 +0000)]
Readdress r236990, use of static members on a non-static variable.

The TargetRegistry is just a namespace-like class, instantiated in one
place to use a range-based for loop. Instead, expose access to the
registry via a range-based 'targets()' function instead. This makes most
uses a bit awkward/more verbose - but eventually we should just add a
range-based find_if function which will streamline these functions. I'm
happy to mkae them a bit awkward in the interim as encouragement to
improve the algorithms in time.

llvm-svn: 237059

9 years agoFix tablegen's PrintFatalError function to run registered file
James Y Knight [Mon, 11 May 2015 22:17:13 +0000 (22:17 +0000)]
Fix tablegen's PrintFatalError function to run registered file
cleanups.

Also, change code in tablegen which printed a message and then called
"exit(1)" to use PrintFatalError, instead.

This fixes instances where an empty output file was left behind after
a failed tablegen invocation, which would confuse subsequent ninja
runs into not attempting to rebuild.

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

llvm-svn: 237058

9 years agoMove sanitizer parser and group expander from Driver to Basic.
Peter Collingbourne [Mon, 11 May 2015 21:39:20 +0000 (21:39 +0000)]
Move sanitizer parser and group expander from Driver to Basic.

No functional change.

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

llvm-svn: 237056

9 years agoUnify sanitizer kind representation between the driver and the rest of the compiler.
Peter Collingbourne [Mon, 11 May 2015 21:39:14 +0000 (21:39 +0000)]
Unify sanitizer kind representation between the driver and the rest of the compiler.

No functional change.

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

llvm-svn: 237055

9 years ago[lib/Fuzzer] when running multiple fuzzing processes, print something every 10 minute...
Kostya Serebryany [Mon, 11 May 2015 21:31:51 +0000 (21:31 +0000)]
[lib/Fuzzer] when running multiple fuzzing processes, print something every 10 minutes to avoid buildbot timeouts

llvm-svn: 237054

9 years agoFix selecting the Platform in TargetList::CreateTargetInternal()
Ted Woodward [Mon, 11 May 2015 21:23:31 +0000 (21:23 +0000)]
Fix selecting the Platform in TargetList::CreateTargetInternal()

Summary:
TargetList::CreateTargetInternal() will only select the current Platform. A previous patch always sets platform_sp to the current Platform, so a check later to see if platform_sp was not defined always failed, and the current Platform was used. This patch removes that check, so if the current Platform is not compatible with the target architecture, CreateTargetInternal() will call Platform::GetPlatformForArchitecture() to select a compatible Platform.

Vince, remote linux tests (Ubuntu -> remote Ubuntu) pass the same with and without this patch.

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: jingham, lldb-commits

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

llvm-svn: 237053

9 years agoRemove Triple Vendor check when creating Linux Platform
Ted Woodward [Mon, 11 May 2015 21:21:21 +0000 (21:21 +0000)]
Remove Triple Vendor check when creating Linux Platform

Summary: The Linux Platform shouldn't care about the Vendor field in the Triple. Currently it allows a value of "PC", or "unknown" if LLDB was built on Linux. This patch removes that check, so the Vendor field isn't touched. This will allow the Linux Platform to be created when using a Triple of *-*-Linux.

Reviewers: vharron, clayborg, sas, tberghammer

Reviewed By: clayborg, sas, tberghammer

Subscribers: tberghammer, sas, lldb-commits

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

llvm-svn: 237052

9 years agoFix input validation issues in llvm-as/llvm-dis
Alexey Samsonov [Mon, 11 May 2015 21:20:20 +0000 (21:20 +0000)]
Fix input validation issues in llvm-as/llvm-dis

Summary:
1. llvm-as/llvm-dis tools do not check for input filename length.
2. llvm-dis does not verify the `Streamer` variable against `nullptr` properly, so the `M` variable could be uninitialized (e.g. if the input file does not exist) leading to null dref.

Patch by Lenar Safin!

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

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

llvm-svn: 237051

9 years ago[lib/Fuzzer] rename FuzzerDFSan.cpp to FuzzerTraceState.cpp; update comments. NFC...
Kostya Serebryany [Mon, 11 May 2015 21:16:27 +0000 (21:16 +0000)]
[lib/Fuzzer] rename FuzzerDFSan.cpp to FuzzerTraceState.cpp; update comments. NFC expected

llvm-svn: 237050

9 years ago[asan] Disable coverage-missing test failing on the bots.
Evgeniy Stepanov [Mon, 11 May 2015 21:16:18 +0000 (21:16 +0000)]
[asan] Disable coverage-missing test failing on the bots.

llvm-svn: 237049

9 years agoAllow AsmLabel with -fno-gnu-inline-asm
Steven Wu [Mon, 11 May 2015 21:14:09 +0000 (21:14 +0000)]
Allow AsmLabel with -fno-gnu-inline-asm

Summary:
AsmLabel is heavily used in system level and firmware to redirect
function and access platform specific labels. They are also extensively
used in system headers which makes this option unusable for many
users. Since AsmLabel doesn't introduce any assembly code into the
output binary, it shouldn't be considered as inline-asm.

Reviewers: bob.wilson, rnk

Reviewed By: rnk

Subscribers: cfe-commits

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

llvm-svn: 237048

9 years agoAdd Hexagon packet support to ThreadPlanStepRange
Ted Woodward [Mon, 11 May 2015 21:12:33 +0000 (21:12 +0000)]
Add Hexagon packet support to ThreadPlanStepRange

Summary:
Hexagon is a VLIW processor. It can execute multiple instructions at once, called a packet. Breakpoints need to be alone in a packet. This patch will make sure that temporary breakpoints used for stepping are set at the start of a packet, which will put the breakpoint in a packet by itself.

Patch by Deepak Panickal of CodePlay and Ted Woodward of Qualcomm.

Reviewers: deepak2427, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 237047

9 years agopropagate IR-level fast-math-flags to DAG nodes; 2nd try; NFC
Sanjay Patel [Mon, 11 May 2015 21:07:09 +0000 (21:07 +0000)]
propagate IR-level fast-math-flags to DAG nodes; 2nd try; NFC

This is a less ambitious version of:
http://reviews.llvm.org/rL236546

because that was reverted in:
http://reviews.llvm.org/rL236600

because it caused memory corruption that wasn't related to FMF
but was actually due to making nodes with 2 operands derive from a
plain SDNode rather than a BinarySDNode.

This patch adds the minimum plumbing necessary to use IR-level
fast-math-flags (FMF) in the backend without actually using
them for anything yet. This is a follow-on to:
http://reviews.llvm.org/rL235997

...which split the existing nsw / nuw / exact flags and FMF
into their own struct.

llvm-svn: 237046

9 years ago[UBSan] Add missing header that defines SANITIZER_CAN_USE_PREINIT_ARRAY
Alexey Samsonov [Mon, 11 May 2015 21:06:49 +0000 (21:06 +0000)]
[UBSan] Add missing header that defines SANITIZER_CAN_USE_PREINIT_ARRAY

Otherwise this compile definition was undefined, and .preinit_array
was never used on the platforms that support it.

llvm-svn: 237045

9 years ago[LoopIdiomRecognize] Transform backedge-taken count check into an assertion.
Davide Italiano [Mon, 11 May 2015 21:02:34 +0000 (21:02 +0000)]
[LoopIdiomRecognize] Transform backedge-taken count check into an assertion.

runOnCountable() allowed the caller to call on a loop without a
predictable backedge-taken count. Change the code so that only loops
with computable backdge-count can call this function, in order to catch
abuses.

llvm-svn: 237044

9 years ago[lib/Fuzzer] add a trace-based mutatation logic. Same idea as with DFSan-based mutato...
Kostya Serebryany [Mon, 11 May 2015 20:51:19 +0000 (20:51 +0000)]
[lib/Fuzzer] add a trace-based mutatation logic. Same idea as with DFSan-based mutator, but instead of relying on taint  tracking, try to find the data directly in the input. More (logic and comments) to go.

llvm-svn: 237043

9 years agoFixing build warnings
Andrew Kaylor [Mon, 11 May 2015 20:45:11 +0000 (20:45 +0000)]
Fixing build warnings

llvm-svn: 237042

9 years agoDoc talks about Platform_RunCommand while we actually use Platform_shell.
Chaoren Lin [Mon, 11 May 2015 19:48:37 +0000 (19:48 +0000)]
Doc talks about Platform_RunCommand while we actually use Platform_shell.

llvm-svn: 237016

9 years ago[WinEH] Update exception numbering to give handlers their own base state.
Andrew Kaylor [Mon, 11 May 2015 19:41:19 +0000 (19:41 +0000)]
[WinEH] Update exception numbering to give handlers their own base state.

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

llvm-svn: 237014

9 years agogroup getNode() variants by purpose and add comments; NFC
Sanjay Patel [Mon, 11 May 2015 19:34:10 +0000 (19:34 +0000)]
group getNode() variants by purpose and add comments; NFC

llvm-svn: 237013

9 years ago["watch set" tests] Use default test case executable names.
Siva Chandra [Mon, 11 May 2015 18:49:59 +0000 (18:49 +0000)]
["watch set" tests] Use default test case executable names.

Summary: This change similar to r236783.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

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

llvm-svn: 237010

9 years ago[RewriteStatepointsForGC] Fix a bug on creating gc_relocate for pointer to vector...
Sanjoy Das [Mon, 11 May 2015 18:49:34 +0000 (18:49 +0000)]
[RewriteStatepointsForGC] Fix a bug on creating gc_relocate for pointer to vector of pointers

Summary:
In RewriteStatepointsForGC pass, we create a gc_relocate intrinsic for
each relocated pointer, and the gc_relocate has the same type with the
pointer. During the creation of gc_relocate intrinsic, llvm requires to
mangle its type. However, llvm does not support mangling of all possible
types. RewriteStatepointsForGC will hit an assertion failure when it
tries to create a gc_relocate for pointer to vector of pointers because
mangling for vector of pointers is not supported.

This patch changes the way RewriteStatepointsForGC pass creates
gc_relocate. For each relocated pointer, we erase the type of pointers
and create an unified gc_relocate of type i8 addrspace(1)*. Then a
bitcast is inserted to convert the gc_relocate to the correct type. In
this way, gc_relocate does not need to deal with different types of
pointers and the unsupported type mangling is no longer a problem. This
change would also ease further merge when LLVM erases types of pointers
and introduces an unified pointer type.

Some minor changes are also introduced to gc_relocate related part in
InstCombineCalls, CodeGenPrepare, and Verifier accordingly.

Patch by Chen Li!

Reviewers: reames, AndyAyers, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

llvm-svn: 237009

9 years agoLiveRangeCalc: Improve error messages on malformed IR
Matthias Braun [Mon, 11 May 2015 18:47:47 +0000 (18:47 +0000)]
LiveRangeCalc: Improve error messages on malformed IR

llvm-svn: 237008

9 years ago[cuda] Fixed test case failure on s390x
Artem Belevich [Mon, 11 May 2015 18:35:58 +0000 (18:35 +0000)]
[cuda] Fixed test case failure on s390x

llvm-svn: 237007

9 years agoos.path.join does not always work for paths on remote platforms.
Chaoren Lin [Mon, 11 May 2015 17:53:39 +0000 (17:53 +0000)]
os.path.join does not always work for paths on remote platforms.

Summary:
Since we don't yet have remote windows debugging, it should be safe to assume
that the remote target uses unix path separators.

Reviewers: ovyalov, zturner, clayborg, vharron

Reviewed By: vharron

Subscribers: lldb-commits

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

llvm-svn: 237006

9 years agoCodeGen: Make MachineInstr::untieRegOperand() a public function
Tom Stellard [Mon, 11 May 2015 17:40:54 +0000 (17:40 +0000)]
CodeGen: Make MachineInstr::untieRegOperand() a public function

This makes it easier to update in place instructions with tied operands.

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

llvm-svn: 237005

9 years ago[X86] Updates to X86 backend for f16 promotion
Pirama Arumuga Nainar [Mon, 11 May 2015 17:14:39 +0000 (17:14 +0000)]
[X86] Updates to X86 backend for f16 promotion

Summary:
r235215 adds support for f16 to be considered as a load/store type and
promote f16 operations to f32.

This patch has miscellaneous fixes for the X86 backend so all f16
operations are handled:
1. Set loadextaction for f16 vectors to expand.
2. Handle FP_EXTEND in a switch statement when handling v2f32
3. Do not fold (FP_TO_SINT (load f16)) into FP_TO_INT*_IN_MEM or
(store (SINT_TO_FP )) to a FILD.

Tests included.

Reviewers: ab, srhines, delena

Subscribers: llvm-commits

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

llvm-svn: 237004

9 years agoRevert "Allow -target= and --target options"
Richard Barton [Mon, 11 May 2015 17:05:05 +0000 (17:05 +0000)]
Revert "Allow -target= and --target options"

After mailing list discussion on 11-13 March we would prefer to stick to a
single spelling of the long option.

This reverts commit 30035fe1a7c759c89ee62eb46efce6b3790fcc08.

llvm-svn: 237003

9 years agounwind: permit building against libstdc++
Saleem Abdulrasool [Mon, 11 May 2015 16:35:13 +0000 (16:35 +0000)]
unwind: permit building against libstdc++

Include algorithm early as otherwise you get a number of particularly unhelpful
messages about failed static assertions.  This fixes compilation on Linux with
gcc.

llvm-svn: 237002

9 years ago[Sparc] Add support for 'sparcel' to clang.
Douglas Katzman [Mon, 11 May 2015 15:21:44 +0000 (15:21 +0000)]
[Sparc] Add support for 'sparcel' to clang.

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

llvm-svn: 237001

9 years agoclang-format: Support aligning ObjC string literals.
Daniel Jasper [Mon, 11 May 2015 15:15:48 +0000 (15:15 +0000)]
clang-format: Support aligning ObjC string literals.

Before:
  NSString s = @"aaaa"
      @"bbbb";

After:
  NSString s = @"aaaa"
               @"bbbb";

llvm-svn: 237000

9 years ago[Msan] Fix the if_indextoname.cc test to pass on FreeBSD
Viktor Kutuzov [Mon, 11 May 2015 14:46:16 +0000 (14:46 +0000)]
[Msan] Fix the if_indextoname.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9456

llvm-svn: 236999

9 years agoRip min/max pattern matching out of InstCombine and into
James Molloy [Mon, 11 May 2015 14:42:20 +0000 (14:42 +0000)]
Rip min/max pattern matching out of InstCombine and into
 ValueTracking.

This matching functionality is useful in more than just InstCombine, so
make it available in ValueTracking.

NFC.

llvm-svn: 236998

9 years agoNew test for llvm.org/pr23478
Tamas Berghammer [Mon, 11 May 2015 14:42:09 +0000 (14:42 +0000)]
New test for llvm.org/pr23478

When there is two brekapoint on two consecutive instruction then
the second breakpoint is ignored by lldb. This test check for the
correct behaviour in this scenario.

Differential revision: http://reviews.llvm.org/D9661

llvm-svn: 236997

9 years agoDisable __has_cpp_attribute when not compiling in C++ mode. As this feature test...
Aaron Ballman [Mon, 11 May 2015 14:09:50 +0000 (14:09 +0000)]
Disable __has_cpp_attribute when not compiling in C++ mode. As this feature test macro only supports C++ style attributes, it doesn't apply to code compiled as C code, and can lead to diagnostics when given a scoped attribute.

This addresses PR23435.

llvm-svn: 236996

9 years agoclang-format: Appease the buildbots by including climits.
Daniel Jasper [Mon, 11 May 2015 13:52:13 +0000 (13:52 +0000)]
clang-format: Appease the buildbots by including climits.

llvm-svn: 236995

9 years agoRevert "Adjust formatting to latest clang-format change"
Tobias Grosser [Mon, 11 May 2015 13:43:04 +0000 (13:43 +0000)]
Revert "Adjust formatting to latest clang-format change"

This reverts commit 236875. Daniel fixed the clang-format bug that introduced
the changed formatting.

llvm-svn: 236994

9 years agoXFAIL a test that fails on FreeBSD 11 (local and buildbot)
Ed Maste [Mon, 11 May 2015 13:38:59 +0000 (13:38 +0000)]
XFAIL a test that fails on FreeBSD 11 (local and buildbot)

For some reason this happens only when running the full test suite
(e.g., via ninja check-lldb), but not when running the
TestStaticVariables.py tests in isolation. XFAIL for now while
investigating, in an attempt to bring the bot to green and reduce noise.

llvm.org/pr20550

llvm-svn: 236993

9 years agoclang-format: Improve column layout.
Daniel Jasper [Mon, 11 May 2015 13:35:40 +0000 (13:35 +0000)]
clang-format: Improve column layout.

Specifically, calculate the deviation between the shortest and longest
element (which is used to prevent excessive whitespace) per column, not
overall. This automatically handles the corner cases of a single column
and a single row so that the actualy implementation becomes simpler.

Before:
  vector<int> x = {1,
                   aaaaaaaaaaaaaaaaaaaaaa,
                   2,
                   bbbbbbbbbbbbbbbbbbbbbb,
                   3,
                   cccccccccccccccccccccc};

After:
  vector<int> x = {1, aaaaaaaaaaaaaaaaaaaaaa,
                   2, bbbbbbbbbbbbbbbbbbbbbb,
                   3, cccccccccccccccccccccc};

llvm-svn: 236992

9 years agoAmends r236990, because I failed at hitting "save" before commit.
Aaron Ballman [Mon, 11 May 2015 13:11:38 +0000 (13:11 +0000)]
Amends r236990, because I failed at hitting "save" before commit.

llvm-svn: 236991

9 years agoReplacing a range-based for loop with an old-style for loop. This code was previously...
Aaron Ballman [Mon, 11 May 2015 13:10:17 +0000 (13:10 +0000)]
Replacing a range-based for loop with an old-style for loop. This code was previously causing a warning with MSVC about a compiler-generated local variable because TargetRegistry::begin() and end() are static member functions. NFC.

llvm-svn: 236990