platform/upstream/llvm.git
9 years ago[Orc] Move delta-handling for trampoline sizes into the resolver block.
Lang Hames [Tue, 24 Mar 2015 04:27:02 +0000 (04:27 +0000)]
[Orc] Move delta-handling for trampoline sizes into the resolver block.

This is the first step towards adding a target-independent callback
handler API.

llvm-svn: 233049

9 years ago[Orc] Whitespace fix. NFC.
Lang Hames [Tue, 24 Mar 2015 04:07:28 +0000 (04:07 +0000)]
[Orc] Whitespace fix. NFC.

llvm-svn: 233048

9 years ago[Orc] Use std::string to capture name by value.
Lang Hames [Tue, 24 Mar 2015 04:07:01 +0000 (04:07 +0000)]
[Orc] Use std::string to capture name by value.

This just updates the code to reflect the comment, but this bug actually hit the
out-of-tree lazy demo. I'm working on a patch to add the lazy-demo's
functionality to lli so that we can test this in-tree soon.

llvm-svn: 233047

9 years ago[modules] More removal of unnecessary deserialization of lexical decls.
Richard Smith [Tue, 24 Mar 2015 02:49:55 +0000 (02:49 +0000)]
[modules] More removal of unnecessary deserialization of lexical decls.

Even if we have no external visible declarations, we may still have external
lexical decls that lookup() would import to fill its lookup table. It's simpler
and faster to always take the no-deserialization path through noload_lookup.

llvm-svn: 233046

9 years agoWhen looking for lexical decls from an external source, check all contexts
Richard Smith [Tue, 24 Mar 2015 02:44:20 +0000 (02:44 +0000)]
When looking for lexical decls from an external source, check all contexts
rather than just the primary context. This is technically correct but results
in no functionality change (in Clang nor LLDB) because all users of this
functionality only use it on single-context DCs.

llvm-svn: 233045

9 years ago[TSan] Disable -Wno-maybe-uninitialized in yet another place.
Alexey Samsonov [Tue, 24 Mar 2015 00:38:43 +0000 (00:38 +0000)]
[TSan] Disable -Wno-maybe-uninitialized in yet another place.

llvm-svn: 233044

9 years agoCleanup: no need to pass DefinitionKind into ParseCXXInlineMethodDef
Eli Bendersky [Mon, 23 Mar 2015 23:49:41 +0000 (23:49 +0000)]
Cleanup: no need to pass DefinitionKind into ParseCXXInlineMethodDef

All ParseCXXInlineMethodDef does with it is assign it on the ParsingDeclarator.
Since that is passed in as well, the (single) caller may as well set the
DefinitionKind, thus simplifying the code.

No change in functionality.

llvm-svn: 233043

9 years ago[TSan] Fixup for r233038: restrict the -Wno-maybe-uninitialized flag to GCC only.
Alexey Samsonov [Mon, 23 Mar 2015 23:44:38 +0000 (23:44 +0000)]
[TSan] Fixup for r233038: restrict the -Wno-maybe-uninitialized flag to GCC only.

llvm-svn: 233042

9 years agoFix format compilation warning in PlatformAndroidRemoteGDBServer.cpp.
Oleksiy Vyalov [Mon, 23 Mar 2015 23:39:58 +0000 (23:39 +0000)]
Fix format compilation warning in PlatformAndroidRemoteGDBServer.cpp.

llvm-svn: 233041

9 years ago[ASan] Remove XFAIL from now passing test.
Alexey Samsonov [Mon, 23 Mar 2015 23:37:39 +0000 (23:37 +0000)]
[ASan] Remove XFAIL from now passing test.

llvm-svn: 233040

9 years ago[TSan] Disable noisy GCC warning.
Alexey Samsonov [Mon, 23 Mar 2015 23:29:39 +0000 (23:29 +0000)]
[TSan] Disable noisy GCC warning.

llvm-svn: 233038

9 years ago[sanitizer] instead of comparing pointers to module_names while initializing coverage...
Kostya Serebryany [Mon, 23 Mar 2015 23:19:13 +0000 (23:19 +0000)]
[sanitizer] instead of comparing pointers to module_names while initializing coverage do a proper strcmp and strdup. NFC

llvm-svn: 233037

9 years ago[UBSan] Use shared library for UBSan on OS X (compiler-rt part).
Alexey Samsonov [Mon, 23 Mar 2015 23:14:16 +0000 (23:14 +0000)]
[UBSan] Use shared library for UBSan on OS X (compiler-rt part).

Summary:
Switch to shared library for UBSan. Add support for building
UBSan on OSX and iossim by cargo-culting ASan build rules.

Test Plan: regression test suite

Reviewers: zaks.anna, kubabrecka

Subscribers: llvm-commits

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

llvm-svn: 233036

9 years ago[UBSan] Use shared library for UBSan on OS X (Clang part).
Alexey Samsonov [Mon, 23 Mar 2015 23:14:05 +0000 (23:14 +0000)]
[UBSan] Use shared library for UBSan on OS X (Clang part).

Summary:
UBSan is now used in the same way as ASan, and is supported on
OSX and on iOS simulator. At the moment ASan and UBSan can't be used
together due to PR21112, but I hope to resolve it soon by
embedding UBSan into ASan.

Test Plan: regression test suite.

Reviewers: zaks.anna, kubabrecka

Subscribers: cfe-commits

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

llvm-svn: 233035

9 years agoTurn off 'quit' confirmation in lldb-mi
Ilia K [Mon, 23 Mar 2015 22:45:13 +0000 (22:45 +0000)]
Turn off 'quit' confirmation in lldb-mi

Summary:
# Turn off interpreter.prompt-on-quit on startup (MI)
# Add CommandInterpreter::SetPromptOnQuit
# Add SBCommandInterpreter::GetPromptOnQuit/SetPromptOnQuit

All tests pass on OS X.

Test Plan:
```
-file-exec-and-symbols ~/p/hello
-break-insert -f main
-exec-run
-interpreter-exec console quit
```

Reviewers: abidh, clayborg

Reviewed By: abidh, clayborg

Subscribers: lldb-commits, clayborg, abidh

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

llvm-svn: 233034

9 years ago[SelectionDAG] Fixed issue with uitofp vector constant folding being treated as sitofp
Simon Pilgrim [Mon, 23 Mar 2015 22:44:55 +0000 (22:44 +0000)]
[SelectionDAG] Fixed issue with uitofp vector constant folding being treated as sitofp

While the uitofp scalar constant folding treats an integer as an unsigned value (from lang ref):

%X = sitofp i8 -1 to double ; yields double:-1.0
%Y = uitofp i8 -1 to double ; yields double:255.0

The vector constant folding was always using sitofp:

%X = sitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double -1.0, double -1.0>
%Y = uitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double -1.0, double -1.0>

This patch fixes this so that the correct opcode is used for sitofp and uitofp.

%X = sitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double -1.0, double -1.0>
%Y = uitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double 255.0, double 255.0>

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

llvm-svn: 233033

9 years agoFix clang-tidy to not assume wrong source locations for defaulted members.
Eli Bendersky [Mon, 23 Mar 2015 22:14:08 +0000 (22:14 +0000)]
Fix clang-tidy to not assume wrong source locations for defaulted members.

Followup to http://reviews.llvm.org/D8465, which would break a test in
clang-tidy. clang-tidy previously assumes that source locations of
defaulted/deleted members are (incorrectly) not including the '= ...' part.

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

llvm-svn: 233032

9 years agoRemove dead prototype DebugInfoFinder::processExpression(), NFC
Duncan P. N. Exon Smith [Mon, 23 Mar 2015 22:10:27 +0000 (22:10 +0000)]
Remove dead prototype DebugInfoFinder::processExpression(), NFC

llvm-svn: 233031

9 years agoDebugInfo: Overload get() in DIDescriptor subclasses
Duncan P. N. Exon Smith [Mon, 23 Mar 2015 21:54:07 +0000 (21:54 +0000)]
DebugInfo: Overload get() in DIDescriptor subclasses

Continue to simplify the `DIDescriptor` subclasses, so that they behave
more like raw pointers.  Remove `getRaw()`, replace it with an
overloaded `get()`, and overload the arrow and cast operators.  Two
testcases started to crash on the arrow operators with this change
because of `scope:` references that weren't real scopes.  I fixed them.
Soon I'll add verifier checks for them too.

This also adds explicit dereference operators.  Previously, the builtin
dereference against `operator MDNode *()` would have worked, but now the
builtins are ambiguous.

llvm-svn: 233030

9 years agoFix missing interfaces to scripts/Python/interface after r229110, r231858 and r232891
Ilia K [Mon, 23 Mar 2015 21:50:21 +0000 (21:50 +0000)]
Fix missing interfaces to scripts/Python/interface after r229110, r231858 and r232891

This includes:
# SBCommandInterpreter::EventIsCommandInterpreterEvent
# SBModule::GetSymbolFileSpec/GetObjectFileHeaderAddress
# SBTarget::EventIsTargetEvent/GetTargetFromEvent/GetNumModulesFromEvent/GetModuleAtIndexFromEvent/GetLaunchInfo/SetLaunchInfo

llvm-svn: 233029

9 years agoRecord correct source range for defaulted/deleted members.
Eli Bendersky [Mon, 23 Mar 2015 21:43:28 +0000 (21:43 +0000)]
Record correct source range for defaulted/deleted members.

Fixes https://llvm.org/bugs/show_bug.cgi?id=20744

struct A {

A() = default;
};

Previously the source range of the declaration of A ended at the ')'. It should
include the '= default' part as well. The same for '= delete'.

Note: this will break one of the clang-tidy fixers, which is going to be
addessed in a follow-up patch.

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

llvm-svn: 233028

9 years agoRefactor how passes get a symbol at the end of a section.
Rafael Espindola [Mon, 23 Mar 2015 21:22:04 +0000 (21:22 +0000)]
Refactor how passes get a symbol at the end of a section.

There is now a canonical symbol at the end of a section that different
passes can request.

This also allows us to assert that we don't switch back to a section whose
end symbol has already been printed.

llvm-svn: 233026

9 years agoCleanup else-after-return and add an early-return to llvm-nm
David Blaikie [Mon, 23 Mar 2015 21:17:43 +0000 (21:17 +0000)]
Cleanup else-after-return and add an early-return to llvm-nm

The loop and error handling in checkMachOAndArchFlags didn't make sense
to me (a loop that only ever executes once? An error path that uses the
element the loop stopped at (which must always be a buffer overrun if
I'm reading that right?)... I'm confused) but I've made a guess at what
was intended.

Based on a patch by Richard Thomson to simplify boolean expressions.

llvm-svn: 233025

9 years ago[AArch64, ARM] Enable GlobalMerge with -O3 rather than -O1.
Ahmed Bougacha [Mon, 23 Mar 2015 21:17:36 +0000 (21:17 +0000)]
[AArch64, ARM] Enable GlobalMerge with -O3 rather than -O1.

The pass used to be enabled by default with CodeGenOpt::Less (-O1).
This is too aggressive, considering the pass indiscriminately merges
all globals together.

Currently, performance doesn't always improve, and, on code that uses
few globals (e.g., the odd file- or function- static), more often than
not is degraded by the optimization.  Lengthy discussion can be found
on llvmdev (AArch64-focused;  ARM has similar problems):
  http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-February/082800.html
Also, it makes tooling and debuggers less useful when dealing with
globals and data sections.

GlobalMerge needs to better identify those cases that benefit, and this
will be done separately.  In the meantime, move the pass to run with
-O3 rather than -O1, on both ARM and AArch64.

llvm-svn: 233024

9 years agoMS ABI: lambda call operators are instance methods and should use thiscall
Reid Kleckner [Mon, 23 Mar 2015 21:16:49 +0000 (21:16 +0000)]
MS ABI: lambda call operators are instance methods and should use thiscall

Fixes an issue reported by Daniel Berenyi on cfe-dev.

llvm-svn: 233023

9 years agoFix Target::Launch in case of synchronous execution
Ilia K [Mon, 23 Mar 2015 21:16:25 +0000 (21:16 +0000)]
Fix Target::Launch in case of synchronous execution

Summary: This patch fixes Target::Launch in case of synchronous execution.

Test Plan:
# Create file with source commands:
```
$ cat start_script
target create ~/p/hello
process launch -s
continue
```

# Run lldb and execute "command source -c 0 -s 0 start_script":
```
$ bin/lldb
(lldb) command source -c 0 -s 0 start_script
Executing commands in '/Users/IliaK/p/llvm/build_ninja/start_script'.
(lldb) target create ~/p/hello
Current executable set to '~/p/hello' (x86_64).
(lldb) process launch -s
Process 92028 stopped
* thread #1: tid = 0x26731, 0x00007fff5fc01000 dyld`_dyld_start, stop reason = signal SIGSTOP
    frame #0: 0x00007fff5fc01000 dyld`_dyld_start
dyld`_dyld_start:
->  0x7fff5fc01000 <+0>: popq   %rdi
    0x7fff5fc01001 <+1>: pushq  $0x0
    0x7fff5fc01003 <+3>: movq   %rsp, %rbp
    0x7fff5fc01006 <+6>: andq   $-0x10, %rsp
(lldb) Process 92028 launched: '/Users/IliaK/p/hello' (x86_64)
(lldb) continue
'
` - it's \ni=1
j=2
x=3
y=4
argc: /Users/IliaK/p/hello
argc: (null)
Process 92028 resuming
Process 92028 exited with status = 0 (0x00000000)

(lldb)
```

was:
```
$ bin/lldb
(lldb) command source -c 0 -s 0 start_script
Executing commands in '/Users/IliaK/p/llvm/build_ninja/start_script'.
(lldb) target create ~/p/hello
Current executable set to '~/p/hello' (x86_64).
(lldb) process launch -s
Process 92100 launched: '/Users/IliaK/p/hello' (x86_64)
(lldb) continue
error: Process must be launched.
Process 92100 stopped
* thread #1: tid = 0x2699a, 0x00007fff5fc01000 dyld`_dyld_start, stop reason = signal SIGSTOP
    frame #0: 0x00007fff5fc01000 dyld`_dyld_start
dyld`_dyld_start:
->  0x7fff5fc01000 <+0>: popq   %rdi
    0x7fff5fc01001 <+1>: pushq  $0x0
    0x7fff5fc01003 <+3>: movq   %rsp, %rbp
    0x7fff5fc01006 <+6>: andq   $-0x10, %rsp
(lldb)
```

Reviewers: jingham, clayborg

Reviewed By: clayborg

Subscribers: labath, lldb-commits, clayborg, jingham

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

llvm-svn: 233022

9 years agoMove ADB communications to AdbClient class - to make it accessible by other components.
Oleksiy Vyalov [Mon, 23 Mar 2015 21:03:02 +0000 (21:03 +0000)]
Move ADB communications to AdbClient class - to make it accessible by other components.

http://reviews.llvm.org/D8535

llvm-svn: 233021

9 years agoRefactor: Simplify boolean expressions in R600 target
David Blaikie [Mon, 23 Mar 2015 20:56:44 +0000 (20:56 +0000)]
Refactor: Simplify boolean expressions in R600 target

Simplify boolean expressions with `true` and `false` using `clang-tidy`

Patch by Richard Thomson.

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

llvm-svn: 233020

9 years ago[SDK modernizer PATCH]. Fixes a bug whereby a call to super
Fariborz Jahanian [Mon, 23 Mar 2015 20:52:26 +0000 (20:52 +0000)]
[SDK modernizer PATCH]. Fixes a bug whereby a call to super
was not converted to property-dot syntax by removing an unused
code. rdar://19140267

llvm-svn: 233019

9 years agoAdd target-async option in -gdb-set command (MI)
Ilia K [Mon, 23 Mar 2015 20:49:51 +0000 (20:49 +0000)]
Add target-async option in -gdb-set command (MI)

llvm-svn: 233018

9 years agoFix/Add comments in CMICmdCmdGdbSet (MI)
Ilia K [Mon, 23 Mar 2015 20:46:10 +0000 (20:46 +0000)]
Fix/Add comments in CMICmdCmdGdbSet (MI)

llvm-svn: 233017

9 years ago[cmake] Clang's install should install clang/Config/config.h
Chris Bieneman [Mon, 23 Mar 2015 20:43:21 +0000 (20:43 +0000)]
[cmake] Clang's install should install clang/Config/config.h

llvm-svn: 233016

9 years agoAdds a warning for unrecognized argument to #pragma comment() on PS4.
Yunzhong Gao [Mon, 23 Mar 2015 20:41:42 +0000 (20:41 +0000)]
Adds a warning for unrecognized argument to #pragma comment() on PS4.

PS4 target recognizes the #pragma comment() syntax as in -fms-extensions, but
only handles the case of #pragma comment(lib). This patch adds a warning if any
other arguments are encountered.

This patch also refactors the code in ParsePragma.cpp a little bit to make it
more obvious that some codes are being shared between -fms-extensions and PS4.

llvm-svn: 233015

9 years agoUpdate variable name and reuse existing variable. NFC.
Rafael Espindola [Mon, 23 Mar 2015 20:25:31 +0000 (20:25 +0000)]
Update variable name and reuse existing variable. NFC.

llvm-svn: 233014

9 years ago[AArch64] Add FileCheck that was missing from test in r232967.
Chad Rosier [Mon, 23 Mar 2015 20:25:15 +0000 (20:25 +0000)]
[AArch64] Add FileCheck that was missing from test in r232967.

llvm-svn: 233013

9 years agoFix incorrect error handling of call to mbrtowc. This is PR#13759. Leaving the bug...
Marshall Clow [Mon, 23 Mar 2015 20:07:17 +0000 (20:07 +0000)]
Fix incorrect error handling of call to mbrtowc. This is PR#13759. Leaving the bug open because (1) I'm not sure that we're correct here, only better than before, and (2) no tests

llvm-svn: 233012

9 years ago[UBSan] Introduce "ubsan_standalone" library (compiler-rt part).
Alexey Samsonov [Mon, 23 Mar 2015 20:05:53 +0000 (20:05 +0000)]
[UBSan] Introduce "ubsan_standalone" library (compiler-rt part).

Get rid of "libclang_rt.san" library that used to contain
sanitizer_common pieces required by UBSan if it's used in a standalone
mode. Instead, build two variants of UBSan runtime: "ubsan" and
"ubsan_standalone" (same for "ubsan_cxx" and "ubsan_standalone_cxx").

Later "ubsan" and "ubsan_cxx" libraries will go away, as they will
embedded it into corresponding ASan runtimes.

llvm-svn: 233011

9 years ago[UBSan] Introduce "ubsan_standalone" library (Clang part).
Alexey Samsonov [Mon, 23 Mar 2015 20:05:42 +0000 (20:05 +0000)]
[UBSan] Introduce "ubsan_standalone" library (Clang part).

Get rid of "libclang_rt.san" library that used to contain
sanitizer_common pieces required by UBSan if it's used in a standalone
mode. Instead, build two variants of UBSan runtime: "ubsan" and
"ubsan_standalone" (same for "ubsan_cxx" and "ubsan_standalone_cxx").

Later "ubsan" and "ubsan_cxx" libraries will go away, as they will
embedded it into corresponding ASan runtimes.

llvm-svn: 233010

9 years agoRe-land: Generate targets for each lit suite.
Chris Bieneman [Mon, 23 Mar 2015 20:04:00 +0000 (20:04 +0000)]
Re-land: Generate targets for each lit suite.

Summary:
This change makes CMake scan for lit suites and generate a target for each lit test suite. The targets follow the format check-<project>-<suite path>.

For example:
check-llvm-unit - Runs the LLVM unit tests
check-llvm-codegen-arm - Runs the ARM codeine tests

Note: These targets are not generated during multi-configuration generators (i.e. Xcode and Visual Studio) because target clutter impacts UI usability.

* Also fixed a minor issue that Duncan pointed out to me I was passing the suite to lit twice

Reviewers: chandlerc

Subscribers: aemerson, llvm-commits

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

llvm-svn: 233009

9 years agoRaising minimum required CMake version to 2.8.12.2.
Chris Bieneman [Mon, 23 Mar 2015 20:03:57 +0000 (20:03 +0000)]
Raising minimum required CMake version to 2.8.12.2.

This commit is in reference to the llvm-dev thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083672.html

llvm-svn: 233008

9 years ago[modules] Fix an iterator invalidation bug found by the modules selfhost bot.
Richard Smith [Mon, 23 Mar 2015 19:54:56 +0000 (19:54 +0000)]
[modules] Fix an iterator invalidation bug found by the modules selfhost bot.

llvm-svn: 233007

9 years agoMake Oveflow tracking more legible (CR feedback from Richard Smith on r232999)
David Blaikie [Mon, 23 Mar 2015 19:54:44 +0000 (19:54 +0000)]
Make Oveflow tracking more legible (CR feedback from Richard Smith on r232999)

llvm-svn: 233006

9 years agoRefactor: Simplify boolean expressions in llvm IR
David Blaikie [Mon, 23 Mar 2015 19:51:23 +0000 (19:51 +0000)]
Refactor: Simplify boolean expressions in llvm IR

Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson with a few other simplifications to fix
else-after-returns in the surrounding code.

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

llvm-svn: 233005

9 years agoRefactor: Simplify boolean expressions in llvm Support
David Blaikie [Mon, 23 Mar 2015 19:45:40 +0000 (19:45 +0000)]
Refactor: Simplify boolean expressions in llvm Support

Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson - I dropped the parens and != 0 test, for
consistency with other patches/tests like this, but I'm open to the
notion that we should add the explicit non-zero test in all these sort
of cases (non-bool assigned to a bool).

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

llvm-svn: 233004

9 years ago[Sanitizers] Fix internal_ftruncate() to work on FreeBSD
Viktor Kutuzov [Mon, 23 Mar 2015 19:44:35 +0000 (19:44 +0000)]
[Sanitizers] Fix internal_ftruncate() to work on FreeBSD
Differential Revision: http://reviews.llvm.org/D8551

llvm-svn: 233003

9 years agoRefactor: Simplify boolean expressions in x86 target
David Blaikie [Mon, 23 Mar 2015 19:42:36 +0000 (19:42 +0000)]
Refactor: Simplify boolean expressions in x86 target

Simplify boolean expressions with `true` and `false` with `clang-tidy`

Patch by Richard Thomson.

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

llvm-svn: 233002

9 years ago[Tsan] Fix the mmap_large.cc test to build on FreeBSD
Viktor Kutuzov [Mon, 23 Mar 2015 19:40:59 +0000 (19:40 +0000)]
[Tsan] Fix the mmap_large.cc test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D8545

llvm-svn: 233001

9 years agoRefactor: Simplify boolean expression in modularize
David Blaikie [Mon, 23 Mar 2015 19:40:59 +0000 (19:40 +0000)]
Refactor: Simplify boolean expression in modularize

Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson.

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

llvm-svn: 233000

9 years agoRefactor: Simplify boolean expresssions in lib/Lex
David Blaikie [Mon, 23 Mar 2015 19:39:19 +0000 (19:39 +0000)]
Refactor: Simplify boolean expresssions in lib/Lex

Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson.

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

llvm-svn: 232999

9 years agoRe-sort includes with sort-includes.py and insert raw_ostream.h where it's used.
Benjamin Kramer [Mon, 23 Mar 2015 19:32:43 +0000 (19:32 +0000)]
Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used.

llvm-svn: 232998

9 years agoFix and update comments and a small reformatting.
Eric Christopher [Mon, 23 Mar 2015 19:26:05 +0000 (19:26 +0000)]
Fix and update comments and a small reformatting.

llvm-svn: 232997

9 years agoRefactor: Simplify boolean expressions in libclang
Dmitri Gribenko [Mon, 23 Mar 2015 19:23:50 +0000 (19:23 +0000)]
Refactor: Simplify boolean expressions in libclang

Simplify boolean expresions using true and false with clang-tidy.

Patch by Richard.

llvm-svn: 232996

9 years ago[ctorutils] Update and sort includes. NFC.
Benjamin Kramer [Mon, 23 Mar 2015 19:06:17 +0000 (19:06 +0000)]
[ctorutils] Update and sort includes. NFC.

llvm-svn: 232995

9 years ago[winehprepare] Update and sort includes. NFC.
Benjamin Kramer [Mon, 23 Mar 2015 18:57:17 +0000 (18:57 +0000)]
[winehprepare] Update and sort includes. NFC.

llvm-svn: 232994

9 years agoAnother set of missing raw_ostream.h. Still no functional change.
Benjamin Kramer [Mon, 23 Mar 2015 18:45:56 +0000 (18:45 +0000)]
Another set of missing raw_ostream.h. Still no functional change.

llvm-svn: 232993

9 years agoR600/SI: Merge tables for commuting
Matt Arsenault [Mon, 23 Mar 2015 18:45:41 +0000 (18:45 +0000)]
R600/SI: Merge tables for commuting

Don't use a separate table for compares anymore,
and use the same VOP2_REV class.

llvm-svn: 232992

9 years agoR600/SI: Only use one range of isCommutable for compares
Matt Arsenault [Mon, 23 Mar 2015 18:45:38 +0000 (18:45 +0000)]
R600/SI: Only use one range of isCommutable for compares

Also don't count the class instructions as isCompare anymore.

llvm-svn: 232991

9 years agoR600/SI: Remove redundant unsetting of hasSideEffects
Matt Arsenault [Mon, 23 Mar 2015 18:45:36 +0000 (18:45 +0000)]
R600/SI: Remove redundant unsetting of hasSideEffects

These are already set in the base class for the instruction.

llvm-svn: 232990

9 years agoR600/SI: Move hasSideEffects setting into VOPCX classes
Matt Arsenault [Mon, 23 Mar 2015 18:45:35 +0000 (18:45 +0000)]
R600/SI: Move hasSideEffects setting into VOPCX classes

llvm-svn: 232989

9 years agoR600/SI: Allow commuting compares
Matt Arsenault [Mon, 23 Mar 2015 18:45:30 +0000 (18:45 +0000)]
R600/SI: Allow commuting compares

This enables very common cases to switch to the
smaller encoding.

All of the standard LLVM canonicalizations of comparisons
are the opposite of what we want. Compares with constants
are moved to the RHS, but the first operand can be an inline
immediate, literal constant, or SGPR using the 32-bit VOPC
encoding.

There are additional bad canonicalizations that should
also be fixed, such as canonicalizing ge x, k to gt x, (k + 1)
if this makes k no longer an inline immediate value.

llvm-svn: 232988

9 years agoR600/SI: Use right class for cmpsx f64 instructions
Matt Arsenault [Mon, 23 Mar 2015 18:45:23 +0000 (18:45 +0000)]
R600/SI: Use right class for cmpsx f64 instructions

Use VOPCX_F64 to not need the let Defs = [EXEC]

llvm-svn: 232987

9 years agoR600/SI: Remove cond operand to VOPCX classes
Matt Arsenault [Mon, 23 Mar 2015 18:45:20 +0000 (18:45 +0000)]
R600/SI: Remove cond operand to VOPCX classes

It isn't used, and these will probably never be directly selected.

llvm-svn: 232986

9 years ago[ELF] Remove extraneous semicolon in DefaultLayout
Rafael Auler [Mon, 23 Mar 2015 18:39:37 +0000 (18:39 +0000)]
[ELF] Remove extraneous semicolon in DefaultLayout

llvm-svn: 232985

9 years agoRefactor: simplify boolean expressions in llvm-objdump
David Blaikie [Mon, 23 Mar 2015 18:39:02 +0000 (18:39 +0000)]
Refactor: simplify boolean expressions in llvm-objdump

Simplify boolean expressions involving `true` and `false` with `clang-tidy`.

Actually upon inspection a bunch of these boolean variables could be
factored away entirely anyway - using find_if and then testing the
result before using it. This also helps reduce indentation in the code
anyway - and a bunch of other related simplification fell out nearby so
I just committed all of that.

Patch by Richard Thomson (legalize@xmission.com)

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

llvm-svn: 232984

9 years agoInitialize ObjC runtime at the right location.
Stephane Sezer [Mon, 23 Mar 2015 18:36:54 +0000 (18:36 +0000)]
Initialize ObjC runtime at the right location.

Summary:
Saw this while reading some code in DynamicLoader classes. Looks like this has
been a FIXME since 2011 at least.

Test Plan: Run unit tests.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 232983

9 years agoAdd missing ELFObjectWriter::reset() override, like other MC classes.
Yaron Keren [Mon, 23 Mar 2015 18:35:01 +0000 (18:35 +0000)]
Add missing ELFObjectWriter::reset() override, like other MC classes.

See detailed discussion at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140915/235418.html

and r217907, r217948:

 http://llvm.org/viewvc/llvm-project?view=revision&revision=217907
 http://llvm.org/viewvc/llvm-project?view=revision&revision=217948

llvm-svn: 232982

9 years agoMore missing includes only visible to MSVC.
Benjamin Kramer [Mon, 23 Mar 2015 18:23:08 +0000 (18:23 +0000)]
More missing includes only visible to MSVC.

NFC.

llvm-svn: 232981

9 years agoAdd missing include that MSVC complains about.
Benjamin Kramer [Mon, 23 Mar 2015 18:19:41 +0000 (18:19 +0000)]
Add missing include that MSVC complains about.

Also reorder includes a bit, NFC.

llvm-svn: 232980

9 years agoAdd a missing null pointer check in CommandObjectThread.cpp.
Stephane Sezer [Mon, 23 Mar 2015 18:15:07 +0000 (18:15 +0000)]
Add a missing null pointer check in CommandObjectThread.cpp.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 232979

9 years agoImplement fast_distance builtin
Tom Stellard [Mon, 23 Mar 2015 18:10:04 +0000 (18:10 +0000)]
Implement fast_distance builtin

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 232978

9 years agoImplement fast_length builtin
Tom Stellard [Mon, 23 Mar 2015 18:10:02 +0000 (18:10 +0000)]
Implement fast_length builtin

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 232977

9 years agoPurge unused includes throughout libSupport.
Benjamin Kramer [Mon, 23 Mar 2015 18:07:13 +0000 (18:07 +0000)]
Purge unused includes throughout libSupport.

NFC.

llvm-svn: 232976

9 years agoExplicitly include raw_ostream.h instead of relying on transitive inclusion.
Benjamin Kramer [Mon, 23 Mar 2015 18:05:43 +0000 (18:05 +0000)]
Explicitly include raw_ostream.h instead of relying on transitive inclusion.

NFC.

llvm-svn: 232975

9 years agoRely on Makefile.rules in lldb/test/driver/batch_mode.
Zachary Turner [Mon, 23 Mar 2015 18:00:07 +0000 (18:00 +0000)]
Rely on Makefile.rules in lldb/test/driver/batch_mode.

This was hardcoding some make rules instead of relying on
Makefile.rules, which was causing some of the logic to be
incorrect for Windows.

Patch by: Adrian McCarthy
Differential Revision: http://reviews.llvm.org/D8363

llvm-svn: 232974

9 years agoRemove non-standard Environment header section
Ed Maste [Mon, 23 Mar 2015 17:57:42 +0000 (17:57 +0000)]
Remove non-standard Environment header section

llvm-svn: 232973

9 years ago[sanitizer] Fix file access modes in SanitizerCommon.InternalMmapWithOffset and Sanit...
Alexander Potapenko [Mon, 23 Mar 2015 17:55:19 +0000 (17:55 +0000)]
[sanitizer] Fix file access modes in SanitizerCommon.InternalMmapWithOffset and SanitizerCommon.FileOps

llvm-svn: 232972

9 years ago[CodeGen] Properly support the half FP type with non-native operations.
Ahmed Bougacha [Mon, 23 Mar 2015 17:54:16 +0000 (17:54 +0000)]
[CodeGen] Properly support the half FP type with non-native operations.

On AArch64, the -fallow-half-args-and-returns option is the default.
With it, the half type is considered legal (rather than the i16 used
normally for __fp16), but no operation is, except conversions and
load/stores and such.

The previous behavior was tantamount to saying LangOpts.NativeHalfType
was implied by LangOpts.HalfArgsAndReturns, which isn't true.
Instead, teach the various parts of CodeGen that already know about
half (using the intrinsics or not) about this weird in-between case,
where the "half" type is legal, but operations on it aren't.

This is a smaller intermediate step to the end-goal of removing the
intrinsic, always using "half", and letting the backend legalize.

Builds on r232968.
rdar://20045970, rdar://17468714
Differential Revision: http://reviews.llvm.org/D8367

llvm-svn: 232971

9 years agoUse .so library extension by default if platform is not Windows or Darwin
Ed Maste [Mon, 23 Mar 2015 17:52:38 +0000 (17:52 +0000)]
Use .so library extension by default if platform is not Windows or Darwin

llvm-svn: 232970

9 years agoFix whitespace in finishSwigWrapperClasses.py
Ed Maste [Mon, 23 Mar 2015 17:52:10 +0000 (17:52 +0000)]
Fix whitespace in finishSwigWrapperClasses.py

- replace hard tabs with 4-space indents
- delete EOL whitespace

llvm-svn: 232969

9 years ago[CodeGen] Convert double -> __fp16 in one step.
Ahmed Bougacha [Mon, 23 Mar 2015 17:48:07 +0000 (17:48 +0000)]
[CodeGen] Convert double -> __fp16 in one step.

Fix the CodeGen so that for types bigger than float, instead of
converting to fp16 via the sequence "InTy -> float -> fp16", we
perform conversions in just one step.  This avoids the double
rounding which potentially changes results from a natural
IEEE-754 operation.

rdar://17594379, rdar://17468714
Differential Revision: http://reviews.llvm.org/D4602
Part of: http://reviews.llvm.org/D8367

llvm-svn: 232968

9 years ago[AArch64] Enable rematerialization of float 0 values.
Chad Rosier [Mon, 23 Mar 2015 17:19:34 +0000 (17:19 +0000)]
[AArch64] Enable rematerialization of float 0 values.

Patch by Geoff Berry<gberry@codeaurora.org>.

llvm-svn: 232967

9 years agoDo not assert on POSIXDYLD double-eAdd.
Stephane Sezer [Mon, 23 Mar 2015 17:05:41 +0000 (17:05 +0000)]
Do not assert on POSIXDYLD double-eAdd.

Summary:
This has been discovered while experimenting with the gecko linker on android.
In general, assert()'ing on "user input" is a bad idea.

Test Plan: Run unit tests.

Reviewers: clayborg, tfiala

Subscribers: lldb-commits

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

llvm-svn: 232966

9 years agoImplement half_sqrt builtin v2
Tom Stellard [Mon, 23 Mar 2015 17:01:37 +0000 (17:01 +0000)]
Implement half_sqrt builtin v2

This is a generic implementation which just calls sqrt.  Targets should
override this if they want a faster implementation.

v2:
  - Alphabetize SOURCES

llvm-svn: 232965

9 years agoImplement distance builtin v2
Tom Stellard [Mon, 23 Mar 2015 17:01:35 +0000 (17:01 +0000)]
Implement distance builtin v2

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

v2:
  - Remove unnecessary copyright.

llvm-svn: 232964

9 years agoFix implementation of length builtin v2
Tom Stellard [Mon, 23 Mar 2015 17:01:33 +0000 (17:01 +0000)]
Fix implementation of length builtin v2

v2:
  - Move common code into a macro
  - Use the same constant for all vector types.

llvm-svn: 232963

9 years agoRevert "[ARM] Add more pattern matching for f16 <-> f64 conversions"
Bradley Smith [Mon, 23 Mar 2015 16:52:52 +0000 (16:52 +0000)]
Revert "[ARM] Add more pattern matching for f16 <-> f64 conversions"

This change is incorrect since it converts double rounding into single rounding,
which can produce different results. Instead this optimization will be done by
modifying Clang's codegen to not produce double rounding in the first place.

This reverts commit r232954.

llvm-svn: 232962

9 years agoSimplify boolean expressions with true and false using clang-tidy
Eli Bendersky [Mon, 23 Mar 2015 16:26:23 +0000 (16:26 +0000)]
Simplify boolean expressions with true and false using clang-tidy

Patch by Richard (legalize@xmission.com)

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

llvm-svn: 232961

9 years agoAdd __clc_ prefix to functions in sincos_helpers.cl
Tom Stellard [Mon, 23 Mar 2015 16:20:24 +0000 (16:20 +0000)]
Add __clc_ prefix to functions in sincos_helpers.cl

This will help avoid naming conflicts with functions defined in
kernels linking with libclc.

llvm-svn: 232960

9 years agoShorten executable name in WatchpointLLDBCommandTestCase
Tamas Berghammer [Mon, 23 Mar 2015 16:17:47 +0000 (16:17 +0000)]
Shorten executable name in WatchpointLLDBCommandTestCase

It is required because the name of the executable exceeded the maximum
allowed file name on android.

llvm-svn: 232959

9 years ago[ARM] Remove target-specific ITOFP/FPTOI nodes
James Molloy [Mon, 23 Mar 2015 16:15:16 +0000 (16:15 +0000)]
[ARM] Remove target-specific ITOFP/FPTOI nodes

Anton tried this 5 years ago but it was reverted due to extra VMOVs
being emitted. This can be easily fixed with a liberal application
of patterns - matching loads/stores and extractelts.

llvm-svn: 232958

9 years agoR600/SI: Fix crash in SIInstrInfo::areLoadsFromSameBasePtr()
Tom Stellard [Mon, 23 Mar 2015 16:06:01 +0000 (16:06 +0000)]
R600/SI: Fix crash in SIInstrInfo::areLoadsFromSameBasePtr()

This function assumed that SMRD instructions always have immediate
offsets, which is not always the case.

llvm-svn: 232957

9 years agoOpenMPClause.h: Fix typo in \param. [-Wdocumentation]
NAKAMURA Takumi [Mon, 23 Mar 2015 16:05:50 +0000 (16:05 +0000)]
OpenMPClause.h: Fix typo in \param. [-Wdocumentation]

llvm-svn: 232956

9 years ago[Hexagon] Simplify boolean expression
Colin LeMahieu [Mon, 23 Mar 2015 16:01:03 +0000 (16:01 +0000)]
[Hexagon] Simplify boolean expression

Patch by Richard
http://reviews.llvm.org/D8523

llvm-svn: 232955

9 years ago[ARM] Add more pattern matching for f16 <-> f64 conversions
Bradley Smith [Mon, 23 Mar 2015 15:59:54 +0000 (15:59 +0000)]
[ARM] Add more pattern matching for f16 <-> f64 conversions

Specifically when the conversion is done in two steps, f16 -> f32 -> f64.

For example:

%1 = tail call float @llvm.convert.from.fp16.f32(i16 %0)
%conv = fpext float %1 to double

to:

vcvtb.f64.f16

llvm-svn: 232954

9 years agoFix the CMake shared build.
Benjamin Kramer [Mon, 23 Mar 2015 15:55:00 +0000 (15:55 +0000)]
Fix the CMake shared build.

The ELF backends now depend on lld::script::Sema, which is in libReaderWriter.
Link it explicitly.

llvm-svn: 232953

9 years agoRemove virtual and add override to all virtual functions in Process/gdb-remote.
Tamas Berghammer [Mon, 23 Mar 2015 15:50:03 +0000 (15:50 +0000)]
Remove virtual and add override to all virtual functions in Process/gdb-remote.

llvm-svn: 232952

9 years agoFix ObjCDataFormatterTestCase.test_nsdate_* tests (ver. 2)
Ilia K [Mon, 23 Mar 2015 14:22:27 +0000 (14:22 +0000)]
Fix ObjCDataFormatterTestCase.test_nsdate_* tests (ver. 2)

This commit reverts r232946 because it caused an another error with absolute time.

llvm-svn: 232951

9 years agoConvert CRLF to LF in CODE_OWNERS.txt
Ilia K [Mon, 23 Mar 2015 14:00:54 +0000 (14:00 +0000)]
Convert CRLF to LF in CODE_OWNERS.txt

llvm-svn: 232950

9 years ago[gcov] Move formatBranchInfo into an anonymous namespace.
Benjamin Kramer [Mon, 23 Mar 2015 13:59:13 +0000 (13:59 +0000)]
[gcov] Move formatBranchInfo into an anonymous namespace.

NFC.

llvm-svn: 232949

9 years agoMake helpers static. clang-tools edition.
Benjamin Kramer [Mon, 23 Mar 2015 12:49:15 +0000 (12:49 +0000)]
Make helpers static. clang-tools edition.

Also purge dead code found by it. NFC.

llvm-svn: 232948