platform/upstream/llvm.git
9 years ago[AST] Remove StmtRange in favor of an iterator_range.
Benjamin Kramer [Sat, 18 Jul 2015 17:09:36 +0000 (17:09 +0000)]
[AST] Remove StmtRange in favor of an iterator_range.

StmtRange was just a convenient wrapper for two StmtIterators before
we had real range support. This removes some of the implicit conversions
StmtRange had leading to slightly more verbose code but also should make
more obvious what's going on. No functional change intended.

llvm-svn: 242615

9 years ago[X86][SSE] Added additional fp/int tests.
Simon Pilgrim [Sat, 18 Jul 2015 17:05:39 +0000 (17:05 +0000)]
[X86][SSE] Added additional fp/int tests.

Demonstrates some shortfalls in subvector(cvt(x)) compared to cvt(subvector(x)) patterns - especially on AVX/AVX2 targets.

llvm-svn: 242614

9 years agoRefreshed tests.
Simon Pilgrim [Sat, 18 Jul 2015 16:53:51 +0000 (16:53 +0000)]
Refreshed tests.

llvm-svn: 242613

9 years ago[libcxx] Get is_*_destructible tests passing in C++03.
Eric Fiselier [Sat, 18 Jul 2015 16:43:58 +0000 (16:43 +0000)]
[libcxx] Get is_*_destructible tests passing in C++03.

Summary: This patch adds proper guards to the is_destructible tests depending on the standard version so that they pass in c++03.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

llvm-svn: 242612

9 years agoclang-format: Take nested lines into account when detection C++03
Daniel Jasper [Sat, 18 Jul 2015 16:35:30 +0000 (16:35 +0000)]
clang-format: Take nested lines into account when detection C++03
compatibility and variable alignment.

llvm-svn: 242611

9 years agoRefreshed tests and reordered in descending integer size.
Simon Pilgrim [Sat, 18 Jul 2015 16:14:56 +0000 (16:14 +0000)]
Refreshed tests and reordered in descending integer size.

llvm-svn: 242610

9 years agoTidyup shufflevector calls - don't repeat inputs if you can avoid it.
Simon Pilgrim [Sat, 18 Jul 2015 15:56:33 +0000 (15:56 +0000)]
Tidyup shufflevector calls - don't repeat inputs if you can avoid it.

llvm-svn: 242609

9 years ago[AST] Cleanup ExprIterator.
Benjamin Kramer [Sat, 18 Jul 2015 14:35:53 +0000 (14:35 +0000)]
[AST] Cleanup ExprIterator.

- Make it a proper random access iterator with a little help from iterator_adaptor_base
- Clean up users of magic dereferencing. The iterator should behave like an Expr **.
- Make it an implementation detail of Stmt. This allows inlining of the assertions.

llvm-svn: 242608

9 years ago[clang-modernize] Don't rely on iterator auto-dereferencing.
Benjamin Kramer [Sat, 18 Jul 2015 14:35:41 +0000 (14:35 +0000)]
[clang-modernize] Don't rely on iterator auto-dereferencing.

llvm-svn: 242607

9 years agoSilence the driver warnings, if we see "-w" on the Driver.
Filipe Cabecinhas [Sat, 18 Jul 2015 06:35:24 +0000 (06:35 +0000)]
Silence the driver warnings, if we see "-w" on the Driver.

Summary:
We can enable warnings after that -w, so the patch might not be 100%
correct.

The problem that triggered this is: we have some amount of tests that
expect 0 warnings (including unit tests for -w), but -w ends up not fully
silencing everything.

Reviewers: echristo, chandlerc

Subscribers: cfe-commits

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

llvm-svn: 242606

9 years ago[PM/AA] Remove the addEscapingUse update API that won't be easy to
Chandler Carruth [Sat, 18 Jul 2015 03:26:46 +0000 (03:26 +0000)]
[PM/AA] Remove the addEscapingUse update API that won't be easy to
directly model in the new PM.

This also was an incredibly brittle and expensive update API that was
never fully utilized by all the passes that claimed to preserve AA, nor
could it reasonably have been extended to all of them. Any number of
places add uses of values. If we ever wanted to reliably instrument
this, we would want a callback hook much like we have with ValueHandles,
but doing this for every use addition seems *extremely* expensive in
terms of compile time.

The only user of this update mechanism is GlobalsModRef. The idea of
using this to keep it up to date doesn't really work anyways as its
analysis requires a symmetric analysis of two different memory
locations. It would be very hard to make updates be sufficiently
rigorous to *guarantee* symmetric analysis in this way, and it pretty
certainly isn't true today.

However, folks have been using GMR with this update for a long time and
seem to not be hitting the issues. The reported issue that the update
hook fixes isn't even a problem any more as other changes to
GetUnderlyingObject worked around it, and that issue stemmed from *many*
years ago. As a consequence, a prior patch provided a flag to control
the unsafe behavior of GMR, and this patch removes the update mechanism
that has questionable compile-time tradeoffs and is causing problems
with moving to the new pass manager. Note the lack of test updates --
not one test in tree actually requires this update, even for a contrived
case.

All of this was extensively discussed on the dev list, this patch will
just enact what that discussion decides on. I'm sending it for review in
part to show what I'm planning, and in part to show the *amazing* amount
of work this avoids. Every call to the AA here is something like three
to six indirect function calls, which in the non-LTO pipeline never do
any work! =[

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

llvm-svn: 242605

9 years ago[cmake] Support enabling -Werror in the OpenMP runtime CMake build and
Chandler Carruth [Sat, 18 Jul 2015 03:14:02 +0000 (03:14 +0000)]
[cmake] Support enabling -Werror in the OpenMP runtime CMake build and
clean up the build.

This disables all of the Clang warnings that fire for me when building
libomp.so on Linux with a recent Clang binary. Lots of these should
probably be fixed, but I want to at least get the build warning-clean
and make it easy to keep that way.

I also switched a bunch of the warnings that are used both for C and C++
compiles to check the flag with C compilation test.

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

llvm-svn: 242604

9 years agoDriver/ToolChain/AMDGPU: Attempt to fix buildbots after r242601
Tom Stellard [Sat, 18 Jul 2015 02:11:07 +0000 (02:11 +0000)]
Driver/ToolChain/AMDGPU: Attempt to fix buildbots after r242601

llvm-svn: 242602

9 years agoDriver: Add AMDGPU toolchain
Tom Stellard [Sat, 18 Jul 2015 01:49:05 +0000 (01:49 +0000)]
Driver: Add AMDGPU toolchain

Summary:
This is a minimal toolchain, which sets the integrated assembler as default,
and uses lld for linking.

Reviewers: arsenm, mcrosier

Subscribers: cfe-commits

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

llvm-svn: 242601

9 years ago[Sema] Emit correct warning when copy-elision is not possible.
Davide Italiano [Sat, 18 Jul 2015 01:15:19 +0000 (01:15 +0000)]
[Sema] Emit correct warning when copy-elision is not possible.

If we're returning a function parameter, copy elision isn't possible,
so we now warn for redundant move.

PR: 23819
Differential Revision:  http://reviews.llvm.org/D11305

llvm-svn: 242600

9 years agoAdd evil hack to workaround the missing libdl.a in the Android toolchain.
Chaoren Lin [Sat, 18 Jul 2015 01:09:43 +0000 (01:09 +0000)]
Add evil hack to workaround the missing libdl.a in the Android toolchain.

Reviewers: vharron, ovyalov

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 242599

9 years agoApply Android -pie switch to buildDefault as well.
Chaoren Lin [Sat, 18 Jul 2015 00:37:55 +0000 (00:37 +0000)]
Apply Android -pie switch to buildDefault as well.

Reviewers: ovyalov

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 242598

9 years ago[libFuzzer] require the files and directories passed to the fuzzer to exist
Kostya Serebryany [Sat, 18 Jul 2015 00:03:37 +0000 (00:03 +0000)]
[libFuzzer] require the files and directories passed to the fuzzer to exist

llvm-svn: 242596

9 years ago[asan] Fix shadow mapping on Android/AArch64.
Evgeniy Stepanov [Fri, 17 Jul 2015 23:51:18 +0000 (23:51 +0000)]
[asan] Fix shadow mapping on Android/AArch64.

Instrumentation and the runtime library were in disagreement about
ASan shadow offset on Android/AArch64.

This fixes a large number of existing tests on Android/AArch64.

llvm-svn: 242595

9 years ago[Sanitizer] Teach ReadFileToBuffer to distinguish empty file from inaccessible file.
Alexey Samsonov [Fri, 17 Jul 2015 23:50:08 +0000 (23:50 +0000)]
[Sanitizer] Teach ReadFileToBuffer to distinguish empty file from inaccessible file.

Summary:
This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=399
(sanitizers crash with empty suppression files).

Reviewers: kcc

Subscribers: llvm-commits

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

llvm-svn: 242594

9 years agoMore packet performance improvements.
Greg Clayton [Fri, 17 Jul 2015 23:42:28 +0000 (23:42 +0000)]
More packet performance improvements.

Changed the "jthreads" key/value in the stop reply packets to be "jstopinfo". This JSON only contains threads with valid stop reasons and allows us not to have to ask about other threads via qThreadStopInfo when we are stepping. The "jstopinfo" only gets sent if there are more than one thread since the stop reply packet contains all the info needed for a single thread.

Added a Process::WillPublicStop() in case process subclasses want to do any extra gathering for public stops. For ProcessGDBRemote, we end up sending a jThreadsInfo packet to gather all expedited registers, expedited memory and MacOSX queue information. We only do this for public stops to minimize the packets we send when we have multiple private stops. Multiple private stops happen when a source level single step, step into or step out run the process multiple times while implementing the stepping, and none of these private stops make it out to the UI via notifications because they are private stops.

llvm-svn: 242593

9 years ago[MS ABI] Explicit specialization of static data members are weak
David Majnemer [Fri, 17 Jul 2015 23:36:49 +0000 (23:36 +0000)]
[MS ABI] Explicit specialization of static data members are weak

Normally, explicit specializations are treated like strong external
definitions.  However, MSVC treats explicit specializations of static
data members as weak.  MSVC 2013's <regex> implementation has such an
explicit specialization which leads to clang emitting a strong
definition in each translation unit which includes it.  Tweak clang's
linkage calculation to give such entities GVA_StrongODR linkage instead.

This fixes PR24165.

llvm-svn: 242592

9 years agoInstrProf: Promote this assert to a report_fatal_error
Justin Bogner [Fri, 17 Jul 2015 23:31:21 +0000 (23:31 +0000)]
InstrProf: Promote this assert to a report_fatal_error

If this assert does fire, the no-asserts behaviour is an infinite
loop. It's better to crash in this case so we get a crash report and
stop wasting the user's cpu cycles.

llvm-svn: 242591

9 years agoadded test file
Naomi Musgrave [Fri, 17 Jul 2015 23:28:02 +0000 (23:28 +0000)]
added test file

llvm-svn: 242590

9 years agore-added changes due to svn config setting issues
Naomi Musgrave [Fri, 17 Jul 2015 23:28:00 +0000 (23:28 +0000)]
re-added changes due to svn config setting issues

llvm-svn: 242589

9 years agoARM: Enable MachineScheduler and disable PostRAScheduler for swift.
Matthias Braun [Fri, 17 Jul 2015 23:18:30 +0000 (23:18 +0000)]
ARM: Enable MachineScheduler and disable PostRAScheduler for swift.

Reapply r242500 now that the swift schedmodel includes LDRLIT.

This is mostly done to disable the PostRAScheduler which optimizes for
instruction latencies which isn't a good fit for out-of-order
architectures. This also allows to leave out the itinerary table in
swift in favor of the SchedModel ones.

This change leads to performance improvements/regressions by as much as
10% in some benchmarks, in fact we loose 0.4% performance over the
llvm-testsuite for reasons that appear to be unknown or out of the
compilers control. rdar://20803802 documents the investigation of
these effects.

While it is probably a good idea to perform the same switch for the
other ARM out-of-order CPUs, I limited this change to swift as I cannot
perform the benchmark verification on the other CPUs.

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

llvm-svn: 242588

9 years agoARM: Add scheduling information for LDRLIT instructions to swift scheduling model
Matthias Braun [Fri, 17 Jul 2015 23:18:26 +0000 (23:18 +0000)]
ARM: Add scheduling information for LDRLIT instructions to swift scheduling model

These pseudo instructions are only lowered after register allocation and
are therefore still present when the machine scheduler runs.
Add a run: line to a testcase that uses the uncommon flags necessary to
actually produce a LDRLIT instruction on swift.

llvm-svn: 242587

9 years agoHandle dumping many more packet types including the A packet, qC, QSetDisableASLR...
Greg Clayton [Fri, 17 Jul 2015 23:08:14 +0000 (23:08 +0000)]
Handle dumping many more packet types including the A packet, qC, QSetDisableASLR, qLaunchSuccess and QLaunchArch.

llvm-svn: 242586

9 years ago[RAGreedy] Add an experimental deferred spilling feature.
Quentin Colombet [Fri, 17 Jul 2015 23:04:06 +0000 (23:04 +0000)]
[RAGreedy] Add an experimental deferred spilling feature.

The idea of deferred spilling is to delay the insertion of spill code until the
very end of the allocation. A "candidate" to spill variable might not required
to be spilled because of other evictions that happened after this decision was
taken. The spirit is similar to the optimistic coloring strategy implemented in
Preston and Briggs graph coloring algorithm.

For now, this feature is highly experimental. Although correct, it would require
much more modification to properly model the effect of spilling.

Anyway, this early patch helps prototyping this feature.

Note: The test case cannot unfortunately be reduced and is probably fragile.
llvm-svn: 242585

9 years agoMIR Parser: Allow the dollar characters in all of the identifier tokens.
Alex Lorenz [Fri, 17 Jul 2015 22:48:04 +0000 (22:48 +0000)]
MIR Parser: Allow the dollar characters in all of the identifier tokens.

This commit modifies the machine instruction lexer so that it now accepts the
'$' characters in identifier tokens.

This change makes the syntax for unquoted global value tokens consistent with
the syntax for the global idenfitier tokens in the LLVM's assembly language.

llvm-svn: 242584

9 years agoRemove a static helper function and use the StringPrinter API exclusively to format...
Enrico Granata [Fri, 17 Jul 2015 22:39:35 +0000 (22:39 +0000)]
Remove a static helper function and use the StringPrinter API exclusively to format NSStrings

llvm-svn: 242583

9 years ago[asan] Fix sanitizer_allocator_test on AArch64.
Evgeniy Stepanov [Fri, 17 Jul 2015 22:29:05 +0000 (22:29 +0000)]
[asan] Fix sanitizer_allocator_test on AArch64.

llvm-svn: 242582

9 years agoCleanup tests that fail in C++1z and with Clang 3.8
Eric Fiselier [Fri, 17 Jul 2015 22:27:43 +0000 (22:27 +0000)]
Cleanup tests that fail in C++1z and with Clang 3.8

llvm-svn: 242581

9 years agoDetect if necessary to build inferior with -pie for Android.
Chaoren Lin [Fri, 17 Jul 2015 22:13:29 +0000 (22:13 +0000)]
Detect if necessary to build inferior with -pie for Android.

Summary:
- Add target_is_android check (with cached results).
- Make android_device_api also cache results.
- Also removes the need to pass --env OS=Android when testing against Android.

Reviewers: sivachandra, tberghammer, clayborg, danalbert

Subscribers: chaoren, tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 242580

9 years agoAsmParser: Add a function to parse a standalone constant value.
Alex Lorenz [Fri, 17 Jul 2015 22:07:03 +0000 (22:07 +0000)]
AsmParser: Add a function to parse a standalone constant value.

This commit extends the interface provided by the AsmParser library by adding a
function that allows the user to parse a standalone contant value.

This change is useful for MIR serialization, as it will allow the MIR Parser to
parse the constant values in a machine constant pool.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 242579

9 years agoHopefully fix android i386 build after r242554.
James Y Knight [Fri, 17 Jul 2015 21:58:11 +0000 (21:58 +0000)]
Hopefully fix android i386 build after r242554.

That platform has alignof(uint64_t) == 4, but, since LLVM_ALIGNAS(...)
cannot take anything but literal integers due to MSVC limitations, the
literal '8' used there didn't match. Switch ScopeStackAlignment to
just use 8, as well.

llvm-svn: 242578

9 years ago[Makefiles] Re-add OSX specific code that got lost in lldbHost consolidation
Keno Fischer [Fri, 17 Jul 2015 21:47:35 +0000 (21:47 +0000)]
[Makefiles] Re-add OSX specific code that got lost in lldbHost consolidation

llvm-svn: 242577

9 years agoCheck if altsep exists before replace.
Chaoren Lin [Fri, 17 Jul 2015 21:40:11 +0000 (21:40 +0000)]
Check if altsep exists before replace.

llvm-svn: 242576

9 years agoHandle altsep ('/' on Windows) in compiler path for log files.
Chaoren Lin [Fri, 17 Jul 2015 21:37:26 +0000 (21:37 +0000)]
Handle altsep ('/' on Windows) in compiler path for log files.

Reviewers: chying

Subscribers: lldb-commits

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

llvm-svn: 242575

9 years agobasic: default to MSVC on Windows
Saleem Abdulrasool [Fri, 17 Jul 2015 21:26:41 +0000 (21:26 +0000)]
basic: default to MSVC on Windows

The "armv7-windows", "i686-windows", and "x86_64-windows" targets should be
equivalent to the MSVC environment.  This was previously discussed when the
triples for Windows werw canonicalised.  Im not sure how this was overlooked.
This fixes the emission of non-COFF formats on Windows.

Thanks to ki9a for reporting this issue over IRC!

llvm-svn: 242574

9 years agoMake this test case be somewhat less verbose when not asked to
Enrico Granata [Fri, 17 Jul 2015 21:11:46 +0000 (21:11 +0000)]
Make this test case be somewhat less verbose when not asked to

llvm-svn: 242573

9 years agoTeach the "extend char types" (char16_t, char32_t and wchar_t) formatters that a...
Enrico Granata [Fri, 17 Jul 2015 20:54:52 +0000 (20:54 +0000)]
Teach the "extend char types" (char16_t, char32_t and wchar_t) formatters that a *single character* whose value is 0 is actually a valid thing to print out

llvm-svn: 242572

9 years agoFix test case in r242565
Steven Wu [Fri, 17 Jul 2015 20:49:01 +0000 (20:49 +0000)]
Fix test case in r242565

llvm-svn: 242571

9 years agoImplement FileSystem::GetPermissions for Windows. Differential Revision: http://revie...
Adrian McCarthy [Fri, 17 Jul 2015 20:23:03 +0000 (20:23 +0000)]
Implement FileSystem::GetPermissions for Windows. Differential Revision: reviews.llvm.org/D11303

llvm-svn: 242568

9 years agoStop treating extension keywords as 'interesting'; we don't allow the extension
Richard Smith [Fri, 17 Jul 2015 20:19:56 +0000 (20:19 +0000)]
Stop treating extension keywords as 'interesting'; we don't allow the extension
flag to change between serialization and deserialization, so it does not
require the identifier to be serialized.

llvm-svn: 242567

9 years agoAdded support for dumping 'x', 'X', 'qSymbol' packets. Also dump any XML retrieved...
Greg Clayton [Fri, 17 Jul 2015 20:16:50 +0000 (20:16 +0000)]
Added support for dumping 'x', 'X', 'qSymbol' packets. Also dump any XML retrieved from a qXfer packets.

llvm-svn: 242566

9 years agoFix -save-temp when using objc-arc, sanitizer and profiling
Steven Wu [Fri, 17 Jul 2015 20:09:56 +0000 (20:09 +0000)]
Fix -save-temp when using objc-arc, sanitizer and profiling

Currently, -save-temp will cause ObjCARC optimization to be dropped,
sanitizer pass to run early in the pipeline, and profiling
instrumentation to run twice.
Fix the issue by properly disable all passes in the optimization
pipeline when generating bitcode output and parse some of the Language
Options even when the input is bitcode so the passes can be setup
correctly.

llvm-svn: 242565

9 years agoRefactor to remove repetition, no functionality change.
Richard Smith [Fri, 17 Jul 2015 20:09:43 +0000 (20:09 +0000)]
Refactor to remove repetition, no functionality change.

llvm-svn: 242564

9 years agoRemove redundant bouncing between StringRef and a pair of 'const char *'.
Richard Smith [Fri, 17 Jul 2015 19:51:03 +0000 (19:51 +0000)]
Remove redundant bouncing between StringRef and a pair of 'const char *'.

llvm-svn: 242562

9 years ago[asan] Add a comment explaining why non-instrumented allocas are moved.
Kuba Brecka [Fri, 17 Jul 2015 19:20:21 +0000 (19:20 +0000)]
[asan] Add a comment explaining why non-instrumented allocas are moved.

Addition to r242510.

llvm-svn: 242561

9 years agofreeaddrinfo(NULL) segfaults on Android.
Chaoren Lin [Fri, 17 Jul 2015 19:12:33 +0000 (19:12 +0000)]
freeaddrinfo(NULL) segfaults on Android.

Reviewers: tberghammer

Subscribers: tberghammer, danalbert, lldb-commits

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

llvm-svn: 242560

9 years agoTeach the NSString data formatter to handle embedded NULs in short ASCII strings
Enrico Granata [Fri, 17 Jul 2015 19:06:39 +0000 (19:06 +0000)]
Teach the NSString data formatter to handle embedded NULs in short ASCII strings

llvm-svn: 242559

9 years agoMergeFuncs: Transfer the function parameter attributes to the call site
Arnold Schwaighofer [Fri, 17 Jul 2015 18:59:08 +0000 (18:59 +0000)]
MergeFuncs: Transfer the function parameter attributes to the call site

rdar://21516488

llvm-svn: 242558

9 years agoStart adding documentation for llvm-lib.
Rafael Espindola [Fri, 17 Jul 2015 18:49:26 +0000 (18:49 +0000)]
Start adding documentation for llvm-lib.

llvm-svn: 242557

9 years agoImprove the NSString data formatter so that explicitly-lengthed Unicode strings print...
Enrico Granata [Fri, 17 Jul 2015 18:22:51 +0000 (18:22 +0000)]
Improve the NSString data formatter so that explicitly-lengthed Unicode strings print embedded NULs correctly

llvm-svn: 242555

9 years agoFix alignment issues in Clang.
James Y Knight [Fri, 17 Jul 2015 18:21:37 +0000 (18:21 +0000)]
Fix alignment issues in Clang.

Some const-correctness changes snuck in here too, since they were in the
area of code I was modifying.

This seems to make Clang actually work without Bus Error on
32bit-sparc.

Follow-up patches will factor out a trailing-object helper class, to
make classes using the idiom of appending objects to other objects
easier to understand, and to ensure (with static_assert) that required
alignment guarantees continue to hold.

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

llvm-svn: 242554

9 years agoRevert "ARM: Enable MachineScheduler and disable PostRAScheduler for swift."
Adam Nemet [Fri, 17 Jul 2015 18:14:19 +0000 (18:14 +0000)]
Revert "ARM: Enable MachineScheduler and disable PostRAScheduler for swift."

This reverts commit r242500.

It broke some internal tests and Matthias asked me to revert it while he
is investigating.

llvm-svn: 242553

9 years agoSplit the portion of the data-formatter-objc test case that deals with NSString into...
Enrico Granata [Fri, 17 Jul 2015 17:54:39 +0000 (17:54 +0000)]
Split the portion of the data-formatter-objc test case that deals with NSString into its own separate test case

llvm-svn: 242552

9 years agoUse llvm_unreachable() instead of report_fatal_error() if the machine model is incomplete
Matthias Braun [Fri, 17 Jul 2015 17:50:11 +0000 (17:50 +0000)]
Use llvm_unreachable() instead of report_fatal_error() if the machine model is incomplete

This error is for developers only so it makes sense to abort and get a
backtrace.

llvm-svn: 242551

9 years ago[OCaml] Do not use -warn-error in tests.
Peter Zotov [Fri, 17 Jul 2015 17:33:23 +0000 (17:33 +0000)]
[OCaml] Do not use -warn-error in tests.

This -warn-error flag invariably gets into release tarballs
and breaks builds on distributions that run tests as a part
of release process. The OCaml binding tests are especially
critical, since they often expose lingering toolchain bugs,
and so it is replaced with -w +A (equivalent to -Wall).

llvm-svn: 242550

9 years ago[ARM] Use [SU]ABSDIFF nodes instead of intrinsics for VABD/VABA
James Molloy [Fri, 17 Jul 2015 17:10:55 +0000 (17:10 +0000)]
[ARM] Use [SU]ABSDIFF nodes instead of intrinsics for VABD/VABA

No functional change, but it preps codegen for the future when SABSDIFF
will start getting generated in anger.

llvm-svn: 242546

9 years ago[AArch64] Use [SU]ABSDIFF nodes instead of intrinsics for ABD/ABA
James Molloy [Fri, 17 Jul 2015 17:10:45 +0000 (17:10 +0000)]
[AArch64] Use [SU]ABSDIFF nodes instead of intrinsics for ABD/ABA

No functional change, but it preps codegen for the future when SABSDIFF
will start getting generated in anger.

llvm-svn: 242545

9 years agoAdd libunwind to the release scripts
Hans Wennborg [Fri, 17 Jul 2015 16:49:59 +0000 (16:49 +0000)]
Add libunwind to the release scripts

llvm-svn: 242543

9 years agoUse inbounds GEPs for memcpy and memset lowering
Eli Bendersky [Fri, 17 Jul 2015 16:42:33 +0000 (16:42 +0000)]
Use inbounds GEPs for memcpy and memset lowering

Follow-up on discussion in http://reviews.llvm.org/D11220

llvm-svn: 242542

9 years agoBump libc++ version # to 3.8
Marshall Clow [Fri, 17 Jul 2015 16:36:44 +0000 (16:36 +0000)]
Bump libc++ version # to 3.8

llvm-svn: 242541

9 years agoAdd missing chkstk.S files from r242539
Reid Kleckner [Fri, 17 Jul 2015 16:31:59 +0000 (16:31 +0000)]
Add missing chkstk.S files from r242539

llvm-svn: 242540

9 years agocompiler-rt: add support for mingw-w64 in builtins
Reid Kleckner [Fri, 17 Jul 2015 16:23:05 +0000 (16:23 +0000)]
compiler-rt: add support for mingw-w64 in builtins

The is so that we can avoid using libgcc and use compiler-rt with
mingw-w64.

Related driver patch
http://reviews.llvm.org/D11077

I have tested this with mingw-w64 and everything seems to be in order.
I also sent this patch to the mingw-w64 mailing list for them to look at.

Patch by Martell Malone.

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

llvm-svn: 242539

9 years ago[msan] Fix open_memstream handling.
Evgeniy Stepanov [Fri, 17 Jul 2015 16:10:37 +0000 (16:10 +0000)]
[msan] Fix open_memstream handling.

For open_memstream() files, buffer pointer is only valid immediately after
fflush() or fclose(). Fix the fclose() interceptor to unpoison after the
REAL(fclose) call, not before it.

llvm-svn: 242535

9 years ago[ASTMatchers] Use provided target NodeKind instead of inferring it from the matchers.
Samuel Benzaquen [Fri, 17 Jul 2015 16:05:27 +0000 (16:05 +0000)]
[ASTMatchers] Use provided target NodeKind instead of inferring it from the matchers.

Individual matchers might not be convertible to each other's kind, but
they might still all be convertible to the target kind.
All the callers already know the target kind, so just pass it down.

llvm-svn: 242534

9 years agoAdd support for producing thin archives in llvm-lib.
Rafael Espindola [Fri, 17 Jul 2015 16:01:11 +0000 (16:01 +0000)]
Add support for producing thin archives in llvm-lib.

I will send an entry in docs/CommandGuide for review today.

llvm-svn: 242533

9 years agoStandalone cmake build improvements (bug #23889)
Pavel Labath [Fri, 17 Jul 2015 15:50:48 +0000 (15:50 +0000)]
Standalone cmake build improvements (bug #23889)

patch by Eugene Zelenko.

llvm-svn: 242529

9 years agoEdited the CPUNames table of TargetParser
Alexandros Lamprineas [Fri, 17 Jul 2015 15:49:32 +0000 (15:49 +0000)]
Edited the CPUNames table of TargetParser
- Changed the default FPU of cortex-m4.
- Removed "cortex-m4f" entry. Currently not supported.

Change-Id: I73121e358aa9e7ba68eb001c2143df390ff2352a
Phabricator: http://reviews.llvm.org/D11100
llvm-svn: 242528

9 years agoFix liblldb linking on RHEL 6 (bug #24140)
Pavel Labath [Fri, 17 Jul 2015 15:26:27 +0000 (15:26 +0000)]
Fix liblldb linking on RHEL 6 (bug #24140)

Patch by Eugene Zelenko.

llvm-svn: 242525

9 years agoGPURuntimeDebugPrinter: Printer pointer values (except if they are strings)
Tobias Grosser [Fri, 17 Jul 2015 13:57:57 +0000 (13:57 +0000)]
GPURuntimeDebugPrinter: Printer pointer values (except if they are strings)

Only pointer values in constant address space are assumed to be strings. For
all other pointers their address is printed.

llvm-svn: 242524

9 years agoR600: Add macro defs for all supported OpenCL extensions
Tom Stellard [Fri, 17 Jul 2015 13:16:52 +0000 (13:16 +0000)]
R600: Add macro defs for all supported OpenCL extensions

llvm-svn: 242523

9 years ago[Mips] Set mips64r6 as default CPU for MIPS64 Android
Petar Jovanovic [Fri, 17 Jul 2015 12:57:30 +0000 (12:57 +0000)]
[Mips] Set mips64r6 as default CPU for MIPS64 Android

Change default CPU for MIPS64 Android. Now it is mips64r6.

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

llvm-svn: 242522

9 years agoChanged "pragma" -> "#pragma" in a comment, NFC.
Andrey Bokhanko [Fri, 17 Jul 2015 12:25:21 +0000 (12:25 +0000)]
Changed "pragma" -> "#pragma" in a comment, NFC.

llvm-svn: 242521

9 years agoMake global aliases have symbol size equal to their type
John Brawn [Fri, 17 Jul 2015 12:12:03 +0000 (12:12 +0000)]
Make global aliases have symbol size equal to their type

This is mainly for the benefit of GlobalMerge, so that an alias into a
MergedGlobals variable has the same size as the original non-merged
variable.

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

llvm-svn: 242520

9 years agoImprove conditional opcode handling in emulation based unwinding
Tamas Berghammer [Fri, 17 Jul 2015 11:44:14 +0000 (11:44 +0000)]
Improve conditional opcode handling in emulation based unwinding

Don't chane the CFI information when a conditional instruction
is emulated (eg.: popeq {r0, pc}) because the CFI for the next
instruction should be the same as the CFI for the current instruction.

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

llvm-svn: 242519

9 years agotest-release.sh: Add ability to do a test build using the trunk or branches.
Daniel Sanders [Fri, 17 Jul 2015 10:40:40 +0000 (10:40 +0000)]
test-release.sh: Add ability to do a test build using the trunk or branches.

Summary:
Adds '--svn-path BRANCH' that causes the script to export the specified path
from each project. Otherwise the tag specified by -release, -rc, etc. will be
used. The version portion of the package name will be 'test-$path' (any forward
slashes in the branch name are replaced with underscores), for example:
  -svn-path trunk => clang+llvm-test-trunk-mips-linux-gnu.tar.xz
  -svn-path branches/release_35 => clang+llvm-test-branches_release_35-mips-linux-gnu.tar.xz

This is primarily useful for bringing new release packages up to standard
without needing to create and maintain a tag for the purpose.

Reviewers: tstellarAMD, hans

Subscribers: llvm-commits

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

llvm-svn: 242518

9 years ago[LLGS] Limit jThreadsInfo to only the most important registers for now
Pavel Labath [Fri, 17 Jul 2015 10:27:42 +0000 (10:27 +0000)]
[LLGS] Limit jThreadsInfo to only the most important registers for now

Summary:
It seems that reading of register data is the biggest bottleneck in LLGS at the moment. Sending
four registers instead of the full GPR set increases the jThreadsInfo processing time about
6-fold. Until we figure out where is this time going, this commit limits the amount of data we
send to provide a more fluid debugging experience.

Reviewers: tberghammer, ovyalov

Subscribers: lldb-commits

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

llvm-svn: 242517

9 years agoFix android build after r242514
Tamas Berghammer [Fri, 17 Jul 2015 10:16:11 +0000 (10:16 +0000)]
Fix android build after r242514

On android std::to_string isn't supported. Replace it with
llvm::utostr.

llvm-svn: 242516

9 years ago[MainLoop] Fix assertion failure
Pavel Labath [Fri, 17 Jul 2015 10:08:38 +0000 (10:08 +0000)]
[MainLoop] Fix assertion failure

Upon connection termination the waitable handle of an IOObject gets reset to an invalid handle.
This caused a problem since we used the object->GetWaitableHandle as a key to the set of
registered events. The fix is to use something more immutable as a key: we make a copy of the
original waitable handle, instead of holding onto the IOObject.

llvm-svn: 242515

9 years ago-Refactored ARMTargetInfo in order to use the API of TargetParser
Alexandros Lamprineas [Fri, 17 Jul 2015 09:08:37 +0000 (09:08 +0000)]
-Refactored ARMTargetInfo in order to use the API of TargetParser
 for extracting target specific information.
-Patches commit r241343: case 'armv7l' was unhandled in
 ARMTargetInfo::getCPUAttr(), and thus it was returning invalid
 characters for macro definition.

Change-Id: I1a0972e5ff5529cd17376c6562047bab8b4da32c
Phabricator: http://reviews.llvm.org/D10839
llvm-svn: 242514

9 years ago[llgo] cmd/gllgo: handle/ignore more flags
Andrew Wilkins [Fri, 17 Jul 2015 08:15:01 +0000 (08:15 +0000)]
[llgo] cmd/gllgo: handle/ignore more flags

Summary:
This diff is to support Debian packaging,
which sets various hardening-rleated flags
in CFLAGS. They don't make sense for Go,
so we just ignore them.

Reviewers: pcc

Subscribers: llvm-commits, axw

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

llvm-svn: 242513

9 years ago[PM/AA] Disable the core unsafe aspect of GlobalsModRef in the face of
Chandler Carruth [Fri, 17 Jul 2015 06:58:24 +0000 (06:58 +0000)]
[PM/AA] Disable the core unsafe aspect of GlobalsModRef in the face of
basic changes to the IR such as folding pointers through PHIs, Selects,
integer casts, store/load pairs, or outlining.

This leaves the feature available behind a flag. This flag's default
could be flipped if necessary, but the real-world performance impact of
this particular feature of GMR may not be sufficiently significant for
many folks to want to run the risk.

Currently, the risk here is somewhat mitigated by half-hearted attempts
to update GlobalsModRef when the rest of the optimizer changes
something. However, I am currently trying to remove that update
mechanism as it makes migrating the AA infrastructure to a form that can
be readily shared between new and old pass managers very challenging.
Without this update mechanism, it is possible that this still unlikely
failure mode will start to trip people, and so I wanted to try to
proactively avoid that.

There is a lengthy discussion on the mailing list about why the core
approach here is flawed, and likely would need to look totally different
to be both reasonably effective and resilient to basic IR changes
occuring. This patch is essentially the first of two which will enact
the result of that discussion. The next patch will remove the current
update mechanism.

Thanks to lots of folks that helped look at this from different angles.
Especial thanks to Michael Zolotukhin for doing some very prelimanary
benchmarking of LTO without GlobalsModRef to get a rough idea of the
impact we could be facing here. So far, it looks very small, but there
are some concerns lingering from other benchmarking. The default here
may get flipped if performance results end up pointing at this as a more
significant issue.

Also thanks to Pete and Gerolf for reviewing!

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

llvm-svn: 242512

9 years ago[OCaml] Use a nicer style for documentation than OCaml default.
Peter Zotov [Fri, 17 Jul 2015 06:37:59 +0000 (06:37 +0000)]
[OCaml] Use a nicer style for documentation than OCaml default.

In particular, it's much easier to read, as it doesn't expand all
the way on wide-screen displays.

CSS committed under LLVM license with explicit permission from
Daniel Bünzli <daniel.buenzli@erratique.ch>.

llvm-svn: 242511

9 years ago[asan] Fix invalid debug info for promotable allocas
Kuba Brecka [Fri, 17 Jul 2015 06:29:57 +0000 (06:29 +0000)]
[asan] Fix invalid debug info for promotable allocas

Since r230724 ("Skip promotable allocas to improve performance at -O0"), there is a regression in the generated debug info for those non-instrumented variables. When inspecting such a variable's value in LLDB, you often get garbage instead of the actual value. ASan instrumentation is inserted before the creation of the non-instrumented alloca. The only allocas that are considered standard stack variables are the ones declared in the first basic-block, but the initial instrumentation setup in the function breaks that invariant.

This patch makes sure uninstrumented allocas stay in the first BB.

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

llvm-svn: 242510

9 years ago[llvm-cxxdump] Don't rely on global state
Davide Italiano [Fri, 17 Jul 2015 06:18:36 +0000 (06:18 +0000)]
[llvm-cxxdump] Don't rely on global state

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

llvm-svn: 242509

9 years ago[CodeGen, X86] Classify vectors <= 32 bits as INTEGER
David Majnemer [Fri, 17 Jul 2015 05:49:13 +0000 (05:49 +0000)]
[CodeGen, X86] Classify vectors <= 32 bits as INTEGER

We shouldn't crash despite the AMD64 ABI not giving clear guidance as to
how to pass around vector types <= 32 bits.  Instead, classify such
vectors as INTEGER to be compatible with GCC.

This fixes PR24162.

llvm-svn: 242508

9 years agoTests for "Disabling of "redefine_extname" pragma for C++ code"
Alexey Bataev [Fri, 17 Jul 2015 04:21:51 +0000 (04:21 +0000)]
Tests for "Disabling of "redefine_extname" pragma for C++ code"

In response to Richard Smith's comment (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150622/131782.html), this patch disables "redefine_extname" pragma for C++ code. Also, I added a test that this pragma doesn't apply to static declarations.
Differential Revision: http://reviews.llvm.org/D10805

llvm-svn: 242507

9 years agoclang: s/PCHContainerOps/PCHContainerRdr/ in \param(s), introduced in r242499. [...
NAKAMURA Takumi [Fri, 17 Jul 2015 04:16:02 +0000 (04:16 +0000)]
clang: s/PCHContainerOps/PCHContainerRdr/ in \param(s), introduced in r242499. [-Wdocumentation]

llvm-svn: 242506

9 years agoFix clang-fuzzer build after r242499.
Adrian Prantl [Fri, 17 Jul 2015 04:07:47 +0000 (04:07 +0000)]
Fix clang-fuzzer build after r242499.

llvm-svn: 242505

9 years agoDriver: Determine file names for crash reports more reliably
Justin Bogner [Fri, 17 Jul 2015 03:35:54 +0000 (03:35 +0000)]
Driver: Determine file names for crash reports more reliably

Guessing which file name to replace based on the -main-file-name
argument to -cc1 is flawed. Instead, keep track of which arguments are
inputs to each command.

llvm-svn: 242504

9 years agoAArch64: add comment missed out from earlier patch.
Tim Northover [Fri, 17 Jul 2015 03:31:50 +0000 (03:31 +0000)]
AArch64: add comment missed out from earlier patch.

Helps explain some of the background behind this bit of code.

llvm-svn: 242503

9 years agoTeach the std::wstring data formatter how to properly display strings with embedded...
Enrico Granata [Fri, 17 Jul 2015 01:56:25 +0000 (01:56 +0000)]
Teach the std::wstring data formatter how to properly display strings with embedded NUL bytes

llvm-svn: 242501

9 years agoARM: Enable MachineScheduler and disable PostRAScheduler for swift.
Matthias Braun [Fri, 17 Jul 2015 01:44:31 +0000 (01:44 +0000)]
ARM: Enable MachineScheduler and disable PostRAScheduler for swift.

This is mostly done to disable the PostRAScheduler which optimizes for
instruction latencies which isn't a good fit for out-of-order
architectures. This also allows to leave out the itinerary table in
swift in favor of the SchedModel ones.

This change leads to performance improvements/regressions by as much as
10% in some benchmarks, in fact we loose 0.4% performance over the
llvm-testsuite for reasons that appear to be unknown or out of the
compilers control. rdar://20803802 documents the investigation of
these effects.

While it is probably a good idea to perform the same switch for the
other ARM out-of-order CPUs, I limited this change to swift as I cannot
perform the benchmark verification on the other CPUs.

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

llvm-svn: 242500

9 years agoMake the clang module container format selectable from the command line.
Adrian Prantl [Fri, 17 Jul 2015 01:19:54 +0000 (01:19 +0000)]
Make the clang module container format selectable from the command line.
- introduces a new cc1 option -fmodule-format=[raw,obj]
  with 'raw' being the default
- supports arbitrary module container formats that libclang is agnostic to
- adds the format to the module hash to avoid collisions
- splits the old PCHContainerOperations into PCHContainerWriter and
  a PCHContainerReader.

Thanks to Richard Smith for reviewing this patch!

llvm-svn: 242499

9 years agoOnly do fmul (fadd x, x), c combine if the fadd only has one use
Matt Arsenault [Fri, 17 Jul 2015 01:14:35 +0000 (01:14 +0000)]
Only do fmul (fadd x, x), c combine if the fadd only has one use

This was increasing the instruction count if the fadd has multiple uses.

llvm-svn: 242498

9 years agoAdd StringPrinter support for printing a std::string with embedded NUL bytes
Enrico Granata [Fri, 17 Jul 2015 01:03:59 +0000 (01:03 +0000)]
Add StringPrinter support for printing a std::string with embedded NUL bytes

llvm-svn: 242496