platform/upstream/llvm.git
9 years agobpf: fix build
Alexei Starovoitov [Sat, 28 Feb 2015 18:03:04 +0000 (18:03 +0000)]
bpf: fix build

complete the plumbing of passing TargetRegisterInfo through
computeRegisterProperties started by r230583

llvm-svn: 230858

9 years agoUpdate obsolete comment
Johannes Doerfert [Sat, 28 Feb 2015 17:10:06 +0000 (17:10 +0000)]
Update obsolete comment

llvm-svn: 230857

9 years agoTRE: Just erase dead BBs and tweak the iteration loop not to increment the deleted...
Benjamin Kramer [Sat, 28 Feb 2015 16:47:27 +0000 (16:47 +0000)]
TRE: Just erase dead BBs and tweak the iteration loop not to increment the deleted BB iterator.

Leaving empty blocks around just opens up a can of bugs like PR22704. Deleting
them early also slightly simplifies code.

Thanks to Sanjay for the IR test case.

llvm-svn: 230856

9 years agoSilence variable set but not used warning in CodeGenRegisters.cpp, NFC.
Yaron Keren [Sat, 28 Feb 2015 15:54:04 +0000 (15:54 +0000)]
Silence variable set but not used warning in CodeGenRegisters.cpp, NFC.

llvm-svn: 230854

9 years agoSilence three more variable set but not used warnings, NFC.
Yaron Keren [Sat, 28 Feb 2015 15:29:17 +0000 (15:29 +0000)]
Silence three more variable set but not used warnings, NFC.

llvm-svn: 230853

9 years agoFormat non-affine subregions news item
Johannes Doerfert [Sat, 28 Feb 2015 14:48:15 +0000 (14:48 +0000)]
Format non-affine subregions news item

llvm-svn: 230852

9 years agoAdd non-affine subregions to the news
Johannes Doerfert [Sat, 28 Feb 2015 14:46:26 +0000 (14:46 +0000)]
Add non-affine subregions to the news

llvm-svn: 230851

9 years ago[OCaml] Generate documentation again with autoconf buildsystem.
Peter Zotov [Sat, 28 Feb 2015 13:48:23 +0000 (13:48 +0000)]
[OCaml] Generate documentation again with autoconf buildsystem.

Patch by Evangelos Foutras:

r220899 started using ocamlfind to build the OCaml bindings but
docs/Makefile still contains references to the OCAMLDOC macro which
is no longer being defined. The result is that OCaml documentation
isn't generated/installed.

llvm-svn: 230850

9 years agoConvert push_back loops into append calls.
Benjamin Kramer [Sat, 28 Feb 2015 13:20:15 +0000 (13:20 +0000)]
Convert push_back loops into append calls.

No functionality change intended.

llvm-svn: 230849

9 years agoSilence variable set but not used warning, NFC.
Yaron Keren [Sat, 28 Feb 2015 13:11:24 +0000 (13:11 +0000)]
Silence variable set but not used warning, NFC.

llvm-svn: 230848

9 years agoFix OS X build failure with Command Line Tools and without full Xcode installation
Kuba Brecka [Sat, 28 Feb 2015 12:25:10 +0000 (12:25 +0000)]
Fix OS X build failure with Command Line Tools and without full Xcode installation

On OS X, if you don't have a full Xcode installation, but just the Command Line Tools package, xcrun and xcodebuild don't return a valid SDK root path. In these cases, let's use "/" as the SDK root (which is where the headers and libraries are installed).

Reviewed at http://reviews.llvm.org/D7641

llvm-svn: 230847

9 years agoArrayRefize memory operand folding. NFC.
Benjamin Kramer [Sat, 28 Feb 2015 12:04:00 +0000 (12:04 +0000)]
ArrayRefize memory operand folding. NFC.

llvm-svn: 230846

9 years agoReplace std::copy with a back inserter with vector append where feasible
Benjamin Kramer [Sat, 28 Feb 2015 10:11:12 +0000 (10:11 +0000)]
Replace std::copy with a back inserter with vector append where feasible

All of the cases were just appending from random access iterators to a
vector. Using insert/append can grow the vector to the perfect size
directly and moves the growing out of the loop. No intended functionalty
change.

llvm-svn: 230845

9 years agoRemove option.ll as part of the Forward Control Flow Integrity
Eric Christopher [Sat, 28 Feb 2015 10:04:18 +0000 (10:04 +0000)]
Remove option.ll as part of the Forward Control Flow Integrity
removal.

llvm-svn: 230844

9 years agoAdd change accidentally missed from r230840.
Richard Smith [Sat, 28 Feb 2015 09:58:41 +0000 (09:58 +0000)]
Add change accidentally missed from r230840.

llvm-svn: 230843

9 years agoSymbolizer refactoring: SymbolizerTool and better interface
Kuba Brecka [Sat, 28 Feb 2015 09:39:05 +0000 (09:39 +0000)]
Symbolizer refactoring: SymbolizerTool and better interface

Reviewed at: http://reviews.llvm.org/D7936

llvm-svn: 230842

9 years agoAdd PS4's autolink syntax to autolink.m's CHECK lines.
Filipe Cabecinhas [Sat, 28 Feb 2015 07:35:07 +0000 (07:35 +0000)]
Add PS4's autolink syntax to autolink.m's CHECK lines.

llvm-svn: 230841

9 years ago[modules] Avoid adding a redecl chain to the 'pending out of date' list as the
Richard Smith [Sat, 28 Feb 2015 05:57:02 +0000 (05:57 +0000)]
[modules] Avoid adding a redecl chain to the 'pending out of date' list as the
very first step in updating it.

llvm-svn: 230840

9 years agoGive better diagnostics when -fmodule-file= finds a bad file: if the file is
Richard Smith [Sat, 28 Feb 2015 03:09:52 +0000 (03:09 +0000)]
Give better diagnostics when -fmodule-file= finds a bad file: if the file is
found indirectly, explain how we got there, and distinguish between 'file not
found' and 'file found but invalid'.

llvm-svn: 230839

9 years ago[MIPS] Add missing header for syscall
Petar Jovanovic [Sat, 28 Feb 2015 02:32:55 +0000 (02:32 +0000)]
[MIPS] Add missing header for syscall

The syscall function itself is declared in <unistd.h>
Compiling compiler-rt with -Werror-implicit-function-declaration will
cause a build failure. This change fixes it.

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

llvm-svn: 230838

9 years agoUnwind: make it build on Darwin again
Saleem Abdulrasool [Sat, 28 Feb 2015 02:23:54 +0000 (02:23 +0000)]
Unwind: make it build on Darwin again

The support for the LSB eh_frame_hdr extension was overzealous in trying to
include headers.  Be more careful to permit building on Darwin.

llvm-svn: 230837

9 years ago[RewriteStatepointsForGC] Reduce indentation via early continue [NFC]
Philip Reames [Sat, 28 Feb 2015 01:57:44 +0000 (01:57 +0000)]
[RewriteStatepointsForGC] Reduce indentation via early continue [NFC]

llvm-svn: 230836

9 years ago[RewriteStatepointsForGC] Fix another order of iteration bug
Philip Reames [Sat, 28 Feb 2015 01:52:09 +0000 (01:52 +0000)]
[RewriteStatepointsForGC] Fix another order of iteration bug

It turns out the naming of inserted phis and selects is sensative to the order in which two sets are iterated.  We need to nail this down to avoid non-deterministic output and possible test failures.

The modified test is the one I first noticed something odd in.  The change is making it more strict to report the error.  With the test change, but without the code change, the test fails roughly 1 in 5.  With the code change, I've run ~30 runs without error.

Long term, the right fix here is to adjust the naming scheme.  I'm checking in this hack to avoid any possible non-determinism in the tests over the weekend.  HJust because I only noticed one case doesn't mean it's actually the only case.  I hope to get to the right change Monday.

std->llvm data structure changes bugfix change #3

llvm-svn: 230835

9 years ago[modules] Deduplicate when merging lists of template specializations from imported...
Richard Smith [Sat, 28 Feb 2015 01:45:19 +0000 (01:45 +0000)]
[modules] Deduplicate when merging lists of template specializations from imported modules.

llvm-svn: 230834

9 years ago[ASan] debug_stacks.cc was passing on ARM by accident, disable this test there for...
Alexey Samsonov [Sat, 28 Feb 2015 01:35:46 +0000 (01:35 +0000)]
[ASan] debug_stacks.cc was passing on ARM by accident, disable this test there for now.

llvm-svn: 230833

9 years agoTemporarily XFAIL TestLaunchWithShellExpand to get the build green
Vince Harron [Sat, 28 Feb 2015 01:10:57 +0000 (01:10 +0000)]
Temporarily XFAIL TestLaunchWithShellExpand to get the build green

llvm-svn: 230832

9 years agoUse -fstandalone-debug for few tests to get around a Clang optimization
Vince Harron [Sat, 28 Feb 2015 01:07:50 +0000 (01:07 +0000)]
Use -fstandalone-debug for few tests to get around a Clang optimization

clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD targets.
Other targets do not, which causes several tests to fail.  This flag
enables FullDebugInfo for all targets.

Fixes the following tests:

TestCallStdStringFunction.py
TestDataFormatterSkipSummary.py
TestDataFormatterStdIterator.py
TestDataFormatterStdList.py
TestDataFormatterStdString.py
TestSBValuePersist.py
TestStringPrinter.py
TestTypeCompletion.py

llvm-svn: 230831

9 years agoRework our handling of key functions. We used to track a complete list of all
Richard Smith [Sat, 28 Feb 2015 01:01:56 +0000 (01:01 +0000)]
Rework our handling of key functions. We used to track a complete list of all
dynamic classes in the translation unit and check whether each one's key
function is defined when we got to the end of the TU (and when we got to the
end of each module). This is really terrible for modules performance, since it
causes unnecessary deserialization of every dynamic class in every compilation.

We now use a much simpler (and, in a modules build, vastly more efficient)
system: when we see an out-of-line definition of a virtual function, we check
whether that function was in fact its class's key function. (If so, we need to
emit the vtable.)

llvm-svn: 230830

9 years ago[RewriteStatepointsForGC] Reduce indentation via early continue [NFC]
Philip Reames [Sat, 28 Feb 2015 00:54:41 +0000 (00:54 +0000)]
[RewriteStatepointsForGC] Reduce indentation via early continue [NFC]

llvm-svn: 230829

9 years agoFixed pthread linking errors in test binaries
Vince Harron [Sat, 28 Feb 2015 00:51:06 +0000 (00:51 +0000)]
Fixed pthread linking errors in test binaries

Fixes these tests:

TestBreakAfterJoin.py
TestCreateDuringStep.py
TestExitDuringBreak.py
TestMultipleBreakpoints.py

llvm-svn: 230828

9 years ago[RewriteStatepointsForGC] Fix iterator invalidation bug
Philip Reames [Sat, 28 Feb 2015 00:47:50 +0000 (00:47 +0000)]
[RewriteStatepointsForGC] Fix iterator invalidation bug

Inserting into a DenseMap you're iterating over is not well defined.  This is unfortunate since this is well defined on a std::map.

"cleanup per llvm code style standards" bug #2

llvm-svn: 230827

9 years ago[dsymutil] Fully qualify llvm::make_unique<>.
Frederic Riss [Sat, 28 Feb 2015 00:42:37 +0000 (00:42 +0000)]
[dsymutil] Fully qualify llvm::make_unique<>.

llvm-svn: 230826

9 years ago[dsymutil] Add the DwarfStreamer class.
Frederic Riss [Sat, 28 Feb 2015 00:29:11 +0000 (00:29 +0000)]
[dsymutil] Add the DwarfStreamer class.

This class is responsible for getting the linked data to the
disk in the appropriate form. Today it it an empty shell that
just instantiates an MC layer.

As we do not put anything in the resulting file yet, we just
check it has the right architecture (and check that -o does
the right thing).

To be able to create all the components, this commit adds a
few dependencies to llvm-dsymutil, namely all-targets, MC and
AsmPrinter.

Also add a -no-output option, so that tests that do not need
the binary result can continue to run even if they do not have
the required target linked in.

llvm-svn: 230824

9 years ago[dsymutil] Add a LinkOptions struct to pass to the DwarfLinker. NFC.
Frederic Riss [Sat, 28 Feb 2015 00:29:07 +0000 (00:29 +0000)]
[dsymutil] Add a LinkOptions struct to pass to the DwarfLinker. NFC.

The only option we have to pass down currently is verbosity, but there
are more to come.

llvm-svn: 230823

9 years ago[dsymutil] clang-format a file
Frederic Riss [Sat, 28 Feb 2015 00:29:05 +0000 (00:29 +0000)]
[dsymutil] clang-format a file

llvm-svn: 230822

9 years ago[dsymutil] Add -o option to select ouptut filename
Frederic Riss [Sat, 28 Feb 2015 00:29:03 +0000 (00:29 +0000)]
[dsymutil] Add -o option to select ouptut filename

We do not create the output file yet, so no means to test.

llvm-svn: 230821

9 years ago[dsymutil] Create warn() global helper...
Frederic Riss [Sat, 28 Feb 2015 00:29:01 +0000 (00:29 +0000)]
[dsymutil] Create warn() global helper...

...and reimplement DwarfLinker::reportWarning in terms of it. Other
compenents than the DwarfLinker will need to report warnings, and I'm
about to add a similar "error()" helper at the same global level so
make that consistent.

llvm-svn: 230820

9 years ago[dsymutil] Make trivial accessor const.
Frederic Riss [Sat, 28 Feb 2015 00:28:56 +0000 (00:28 +0000)]
[dsymutil] Make trivial accessor const.

llvm-svn: 230819

9 years ago[RewriteStatepointsForGC] Add tests for the base pointer identification algorithm
Philip Reames [Sat, 28 Feb 2015 00:20:48 +0000 (00:20 +0000)]
[RewriteStatepointsForGC] Add tests for the base pointer identification algorithm

These tests cover the 'base object' identification and rewritting portion of RewriteStatepointsForGC.  These aren't completely exhaustive, but they've proven to be reasonable effective over time at finding regressions.

In the process of porting these tests over, I found my first "cleanup per llvm code style standards" bug.  We were relying on the order of iteration when testing the base pointers found for a derived pointer.  When we switched from std::set to DenseSet, this stopped being a safe assumption.  I'm suspecting I'm going to find more of those.  In particular, I'm now really wondering about the main iteration loop for this algorithm.  I need to go take a closer look at the assumptions there.

I'm not really happy with the fact these are testing what is essentially debug output (i.e. enabled via command line flags).  Suggestions for how to structure this better are very welcome.

llvm-svn: 230818

9 years agoCasting pid to ::pid_t when invoking syscall.
Chaoren Lin [Sat, 28 Feb 2015 00:20:16 +0000 (00:20 +0000)]
Casting pid to ::pid_t when invoking syscall.

Summary:
syscalls involving pid/tid on 32 bit binaries are failing with
"Invalid argument" because the uint64_t arguments are too wide.

Reviewers: clayborg, ovyalov, sivachandra

Subscribers: lldb-commits

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

llvm-svn: 230817

9 years agoDebugInfo: hoist definition into global context when needed
Saleem Abdulrasool [Sat, 28 Feb 2015 00:13:13 +0000 (00:13 +0000)]
DebugInfo: hoist definition into global context when needed

When generating debug info for a static inline member which is initialized for
the DLLExport storage class, hoist the definition into a non-composite type
context. Otherwise, we would trigger an assertion when generating the DIE for
the associated global value as the debug context has a type association. This
addresses PR22669.

Thanks to David Blakie for help in coming up with a solution to this!

llvm-svn: 230816

9 years agoDo s/_context/_ctx/ to Resolver.cpp.
Rui Ueyama [Fri, 27 Feb 2015 23:40:00 +0000 (23:40 +0000)]
Do s/_context/_ctx/ to Resolver.cpp.

llvm-svn: 230814

9 years agoRemove a varaible that's used only once. NFC.
Rui Ueyama [Fri, 27 Feb 2015 23:36:05 +0000 (23:36 +0000)]
Remove a varaible that's used only once. NFC.

llvm-svn: 230813

9 years agoDiscourage in-source autoconf builds (as we already do for the cmake build)
Jonathan Roelofs [Fri, 27 Feb 2015 23:35:47 +0000 (23:35 +0000)]
Discourage in-source autoconf builds (as we already do for the cmake build)

http://reviews.llvm.org/D7961

llvm-svn: 230812

9 years agoRegenerated test case from pr 230801 for change in LLVM IR syntax
Bill Schmidt [Fri, 27 Feb 2015 23:29:57 +0000 (23:29 +0000)]
Regenerated test case from pr 230801 for change in LLVM IR syntax

llvm-svn: 230811

9 years agoUpdate SystemZ/Large test generators to handle new gep IR syntax
David Blaikie [Fri, 27 Feb 2015 23:29:39 +0000 (23:29 +0000)]
Update SystemZ/Large test generators to handle new gep IR syntax

llvm-svn: 230810

9 years agoUpdate SystemZ/Large test generators to handle new load IR syntax
David Blaikie [Fri, 27 Feb 2015 23:29:33 +0000 (23:29 +0000)]
Update SystemZ/Large test generators to handle new load IR syntax

llvm-svn: 230809

9 years agoCall File::beforeLink hook even if the file is in an archive.
Rui Ueyama [Fri, 27 Feb 2015 23:15:11 +0000 (23:15 +0000)]
Call File::beforeLink hook even if the file is in an archive.

Previously we didn't call the hook on a file in an archive, which
let the PE/COFF port fail to link files in archives. It was a
simple mistake. Added a call to the hook and also added a test to
catch that error.

const_cast is an unfortunate hack. Files in the resolver are usually
const, but they are not actually const objects, since they are
mutated if either a file is taken from an archive (an archive file
does never return the same file twice) or the beforeLink hook is
called. Maybe we should just remove const from there -- because they
are not const.

llvm-svn: 230808

9 years ago[new docs] Performance Tips for Frontend Authors
Philip Reames [Fri, 27 Feb 2015 23:14:50 +0000 (23:14 +0000)]
[new docs] Performance Tips for Frontend Authors

As mentioned on llvm-dev, this is a new documentation page intended to collect tips for frontend authors on how to generate IR that LLVM is able to optimize well. These types of things come up repeated in review threads and it would be good to have a place to save them.

I added a small handful to start us off, but I mostly want to get the framework in place. Once the docs are here, we can add to them incrementally.  If you know of something appropriate for this page, please add it!

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

llvm-svn: 230807

9 years agoMachineDominators: Move applySplitCriticalEdges into the cpp file.
Benjamin Kramer [Fri, 27 Feb 2015 23:13:13 +0000 (23:13 +0000)]
MachineDominators: Move applySplitCriticalEdges into the cpp file.

It's too big for inlining anyways. Also clean it up slightly. No functionality
change intended.

llvm-svn: 230806

9 years ago[modules] When writing out a list of specializations for a template, if we have
Richard Smith [Fri, 27 Feb 2015 23:05:10 +0000 (23:05 +0000)]
[modules] When writing out a list of specializations for a template, if we have
undeserialized specializations (because we merged an imported declaration of
the same template since we last added one), don't bother reading in the
specializations themselves just so we can write out their IDs again.

llvm-svn: 230805

9 years agollvm-vtabledump: Update field with a better name
David Majnemer [Fri, 27 Feb 2015 22:35:25 +0000 (22:35 +0000)]
llvm-vtabledump: Update field with a better name

llvm-svn: 230804

9 years agoRevert test case until it can be fixed
Bill Schmidt [Fri, 27 Feb 2015 22:31:14 +0000 (22:31 +0000)]
Revert test case until it can be fixed

llvm-svn: 230803

9 years agoAdd .eh_frame_hdr search to Linux unwinder.
Dan Albert [Fri, 27 Feb 2015 22:21:07 +0000 (22:21 +0000)]
Add .eh_frame_hdr search to Linux unwinder.

This improves the performance of unwinding on DWARF based targets. The
32-bit x86 support for scanning the full eh_frame
(CFI_Parser::findFDE) apparently does not work (at least not on
Linux). Since the eh_frame_hdr code delegates to that, this still
doesn't work for x86 Linux, but it has been tested on x86_64 Linux and
aarch64 Android.

llvm-svn: 230802

9 years ago[PowerPC] Fix PR22711 - Misaligned .toc section
Bill Schmidt [Fri, 27 Feb 2015 22:14:10 +0000 (22:14 +0000)]
[PowerPC] Fix PR22711 - Misaligned .toc section

Straightforward patch to emit an alignment directive when emitting a
TOC entry.  The test case was generated from the test in PR22711 that
demonstrated a misaligned .toc section.  The object code is run
through llvm-readobj to verify that the correct alignment has been
applied to the .toc section.

Thanks to Ulrich Weigand for running down where the fix was needed.

llvm-svn: 230801

9 years ago[Fix] Two tests that broke during the last changes
Johannes Doerfert [Fri, 27 Feb 2015 21:58:26 +0000 (21:58 +0000)]
[Fix] Two tests that broke during the last changes

llvm-svn: 230800

9 years agoConvert TestWatchLocation to use C++11 library instead of pthread.
Chaoren Lin [Fri, 27 Feb 2015 21:45:51 +0000 (21:45 +0000)]
Convert TestWatchLocation to use C++11 library instead of pthread.

Reviewers: clayborg, zturner, ki.stfu, abidh

Subscribers: lldb-commits

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

llvm-svn: 230799

9 years agoReduce double set lookups.
Benjamin Kramer [Fri, 27 Feb 2015 21:43:14 +0000 (21:43 +0000)]
Reduce double set lookups.

llvm-svn: 230798

9 years agoFix test I missed
David Blaikie [Fri, 27 Feb 2015 21:31:00 +0000 (21:31 +0000)]
Fix test I missed

This was & is failing at ToT, but now it's failing for the original
reason, not because the IR can't be parsed.

llvm-svn: 230797

9 years agoUpdate Polly tests to handle explicitly typed load changes in LLVM.
David Blaikie [Fri, 27 Feb 2015 21:22:50 +0000 (21:22 +0000)]
Update Polly tests to handle explicitly typed load changes in LLVM.

llvm-svn: 230796

9 years agoUpdate Clang tests to handle explicitly typed load changes in LLVM.
David Blaikie [Fri, 27 Feb 2015 21:19:58 +0000 (21:19 +0000)]
Update Clang tests to handle explicitly typed load changes in LLVM.

llvm-svn: 230795

9 years ago[opaque pointer type] Add textual IR support for explicit type parameter to load...
David Blaikie [Fri, 27 Feb 2015 21:17:42 +0000 (21:17 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter to load instruction

Essentially the same as the GEP change in r230786.

A similar migration script can be used to update test cases, though a few more
test case improvements/changes were required this time around: (r229269-r229278)

import fileinput
import sys
import re

pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)")

for line in sys.stdin:
  sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line))

Reviewers: rafael, dexonsmith, grosser

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

llvm-svn: 230794

9 years agoTarget/X86: Never use the redzone for Win64 ABI functions.
Charles Davis [Fri, 27 Feb 2015 21:11:16 +0000 (21:11 +0000)]
Target/X86: Never use the redzone for Win64 ABI functions.

Summary:
Until now, we did this (among other things) based on whether or not the
target was Windows. This is clearly wrong, not just for Win64 ABI functions
on non-Windows, but for System V ABI functions on Windows, too. In this
change, we make this decision based on the ABI the calling convention
specifies instead.

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 230793

9 years agoUpdate one test I missed when updating for the opaque pointer gep changes to LLVM.
David Blaikie [Fri, 27 Feb 2015 20:43:19 +0000 (20:43 +0000)]
Update one test I missed when updating for the opaque pointer gep changes to LLVM.

llvm-svn: 230792

9 years agoPECOFF: Move a call of WinLinkDriver::parse from FileCOFF::doParse to FileCOFF::befor...
Rui Ueyama [Fri, 27 Feb 2015 20:39:20 +0000 (20:39 +0000)]
PECOFF: Move a call of WinLinkDriver::parse from FileCOFF::doParse to FileCOFF::beforeLink

In doParse, we shouldn't do anything that has side effects. That function may be
called speculatively and possibly in parallel.

We called WinLinkDriver::parse from doParse to parse a command line in a .drectve
section. The parse function updates a linking context object, so it has many side
effects. It was not safe to call that function from doParse. beforeLink is a
function for a File object to do something that has side effects. Moving a call
of WinLinkDriver::parse to there.

llvm-svn: 230791

9 years agoDo some preparation even with scalar and phi modeling enabled
Johannes Doerfert [Fri, 27 Feb 2015 20:38:51 +0000 (20:38 +0000)]
Do some preparation even with scalar and phi modeling enabled

llvm-svn: 230790

9 years ago[modules] Avoid the possibility of a redeclaration chain not being marked 'up
Richard Smith [Fri, 27 Feb 2015 20:14:19 +0000 (20:14 +0000)]
[modules] Avoid the possibility of a redeclaration chain not being marked 'up
to date' after it gets updated.

llvm-svn: 230789

9 years ago[PowerPC] Use vector types for memcpy and friends (sometimes)
Hal Finkel [Fri, 27 Feb 2015 19:58:28 +0000 (19:58 +0000)]
[PowerPC] Use vector types for memcpy and friends (sometimes)

When using Altivec, we can use vector loads and stores for aligned memcpy and
friends. Starting with the P7 and VXS, we have reasonable unaligned vector
stores. Starting with the P8, we have fast unaligned loads too.

For QPX, we use vector loads are stores, but only for aligned memory accesses.

llvm-svn: 230788

9 years agoFix FileSpec::GetPath to return null-terminated strings
Ilia K [Fri, 27 Feb 2015 19:43:08 +0000 (19:43 +0000)]
Fix FileSpec::GetPath to return null-terminated strings

Summary:
Before this fix the FileSpec::GetPath() returned string which might be without '\0' at the end.
It could have happened if the size of buffer for path was less than actual path.

Test case:
```
FileSpec test("/path/to/file", false);
char buf[]="!!!!!!";
test.GetPath(buf, 3);
```

Before fix:
```
   233          FileSpec test("/path/to/file", false);
   234          char buf[]="!!!!!!";
   235          test.GetPath(buf, 3);
   236
-> 237          if (core_file)
   238          {
   239              if (!core_file.Exists())
   240              {
(lldb) print buf
(char [7]) $0 = "/pa!!!"
```

After fix:
```
   233          FileSpec test("/path/to/file", false);
   234          char buf[]="!!!!!!";
   235          test.GetPath(buf, 3);
   236
-> 237          if (core_file)
   238          {
   239              if (!core_file.Exists())
   240              {
(lldb) print buf
(char [7]) $0 = "/p"
```

Reviewers: zturner, abidh, clayborg

Reviewed By: abidh, clayborg

Subscribers: tberghammer, vharron, lldb-commits, clayborg, zturner, abidh

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

llvm-svn: 230787

9 years ago[opaque pointer type] Add textual IR support for explicit type parameter to getelemen...
David Blaikie [Fri, 27 Feb 2015 19:29:02 +0000 (19:29 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction

One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.

This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.

* This doesn't modify gep operators, only instructions (operators will be
  handled separately)

* Textual IR changes only. Bitcode (including upgrade) and changing the
  in-memory representation will be in separate changes.

* geps of vectors are transformed as:
    getelementptr <4 x float*> %x, ...
  ->getelementptr float, <4 x float*> %x, ...
  Then, once the opaque pointer type is introduced, this will ultimately look
  like:
    getelementptr float, <4 x ptr> %x
  with the unambiguous interpretation that it is a vector of pointers to float.

* address spaces remain on the pointer, not the type:
    getelementptr float addrspace(1)* %x
  ->getelementptr float, float addrspace(1)* %x
  Then, eventually:
    getelementptr float, ptr addrspace(1) %x

Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.

update.py:
import fileinput
import sys
import re

ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile(       r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")

def conv(match, line):
  if not match:
    return line
  line = match.groups()[0]
  if len(match.groups()[5]) == 0:
    line += match.groups()[2]
  line += match.groups()[3]
  line += ", "
  line += match.groups()[1]
  line += "\n"
  return line

for line in sys.stdin:
  if line.find("getelementptr ") == line.find("getelementptr inbounds"):
    if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
      line = conv(re.match(ibrep, line), line)
  elif line.find("getelementptr ") != line.find("getelementptr ("):
    line = conv(re.match(normrep, line), line)
  sys.stdout.write(line)

apply.sh:
for name in "$@"
do
  python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
  rm -f "$name.tmp"
done

The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh

After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).

The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.

Reviewers: rafael, dexonsmith, grosser

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

llvm-svn: 230786

9 years agoUpdate Polly tests to handle explicitly typed gep changes in LLVM
David Blaikie [Fri, 27 Feb 2015 19:20:19 +0000 (19:20 +0000)]
Update Polly tests to handle explicitly typed gep changes in LLVM

llvm-svn: 230784

9 years agoUpdate Clang tests to handle explicitly typed gep changes in LLVM.
David Blaikie [Fri, 27 Feb 2015 19:18:17 +0000 (19:18 +0000)]
Update Clang tests to handle explicitly typed gep changes in LLVM.

llvm-svn: 230783

9 years agoSkip LaunchInTerminalTestCase test on remote systems
Ilia K [Fri, 27 Feb 2015 19:14:12 +0000 (19:14 +0000)]
Skip LaunchInTerminalTestCase test on remote systems

Summary:
This ability was added by @jasonmolenda in [[ http://reviews.llvm.org/rL225748 | r225748 ]] but it was commented out because he hadn't test it.
I tested it on OS X and now we can enable it legally.

This change is made by @chying request.

Reviewers: jasonmolenda, chying, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, chying, jasonmolenda, clayborg

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

llvm-svn: 230782

9 years agoRefer users looking for the release notes to 3.6.
Benjamin Kramer [Fri, 27 Feb 2015 19:06:26 +0000 (19:06 +0000)]
Refer users looking for the release notes to 3.6.

llvm-svn: 230781

9 years agoRemove the Forward Control Flow Integrity pass and its dependencies.
Eric Christopher [Fri, 27 Feb 2015 19:03:38 +0000 (19:03 +0000)]
Remove the Forward Control Flow Integrity pass and its dependencies.

This work is currently being rethought along different lines and
if this work is needed it can be resurrected out of svn. Remove it
for now as no current work in ongoing on it and it's unused. Verified
with the authors before removal.

llvm-svn: 230780

9 years agoObject: Test for reading kext bundles
Justin Bogner [Fri, 27 Feb 2015 18:58:23 +0000 (18:58 +0000)]
Object: Test for reading kext bundles

In the review for r230567, it was pointed out we should really test
the lib/Object part of that change. This does so using llvm-readobj.

llvm-svn: 230779

9 years agoDelete LLVM_DELETED_FUNCTION from coding standards
Reid Kleckner [Fri, 27 Feb 2015 18:34:16 +0000 (18:34 +0000)]
Delete LLVM_DELETED_FUNCTION from coding standards

It didn't seem worth leaving behind a guideline to use '= delete' to
make a class uncopyable. That's a well known C++ design pattern.

Reported on the mailing list and in PR22724.

llvm-svn: 230776

9 years agoChange the fast-isel-abort option from bool to int to enable "levels"
Mehdi Amini [Fri, 27 Feb 2015 18:32:11 +0000 (18:32 +0000)]
Change the fast-isel-abort option from bool to int to enable "levels"

Summary:
Currently fast-isel-abort will only abort for regular instructions,
and just warn for function calls, terminators, function arguments.
There is already fast-isel-abort-args but nothing for calls and
terminators.

This change turns the fast-isel-abort options into an integer option,
so that multiple levels of strictness can be defined.
This will help no being surprised when the "abort" option indeed does
not abort, and enables the possibility to write test that verifies
that no intrinsics are forgotten by fast-isel.

Reviewers: resistor, echristo

Subscribers: jfb, llvm-commits

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

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

9 years ago[FIX] Teach RegionGenerator to respect and update dominance
Johannes Doerfert [Fri, 27 Feb 2015 18:29:04 +0000 (18:29 +0000)]
[FIX] Teach RegionGenerator to respect and update dominance

  When we generate code for a whole region we have to respect dominance
  and update it too.
  The first is achieved with multiple "BBMap"s. Each copied block in the
  region gets its own map. It is initialized only with values mapped in
  the immediate dominator block, if this block is in the region and was
  therefor already copied. This way no values defined in a block that
  doesn't dominate the current one will be used.
  To update dominance information we check if the immediate dominator of
  the original block we want to copy is in the region. If so we set the
  immediate dominator of the current block to the copy of the immediate
  dominator of the original block.

llvm-svn: 230774

9 years agoMinor follow-ups to r229720 suggested on llvmdev
Reid Kleckner [Fri, 27 Feb 2015 18:22:46 +0000 (18:22 +0000)]
Minor follow-ups to r229720 suggested on llvmdev

"svn" patch by Sedat Dilek plus trimming whitespace added in r229720.

llvm-svn: 230773

9 years agoCentralize handling of the eh_begin and eh_end labels.
Rafael Espindola [Fri, 27 Feb 2015 18:18:39 +0000 (18:18 +0000)]
Centralize handling of the eh_begin and eh_end labels.

This removes a bit of duplicated code and more importantly, remembers the
labels so that they don't need to be looked up by name.

This in turn allows for any name to be used and avoids a crash if the name
we wanted was already taken.

llvm-svn: 230772

9 years agoremove function names from comments; NFC
Sanjay Patel [Fri, 27 Feb 2015 18:07:41 +0000 (18:07 +0000)]
remove function names from comments; NFC

llvm-svn: 230771

9 years agoPECOFF: Use StringRef::find_first_of instead of a hand-written loop.
Rui Ueyama [Fri, 27 Feb 2015 18:06:41 +0000 (18:06 +0000)]
PECOFF: Use StringRef::find_first_of instead of a hand-written loop.

llvm-svn: 230770

9 years agoSwitch a std::map to a DenseMap in CodeGenRegisters.
Owen Anderson [Fri, 27 Feb 2015 17:57:01 +0000 (17:57 +0000)]
Switch a std::map to a DenseMap in CodeGenRegisters.

The keys of the map are unique by pointer address, so there's no need
to use the llvm::less comparator. This allows us to use DenseMap
instead, which reduces tblgen time by 20% on my stress test.

llvm-svn: 230769

9 years agoAdd 'let' to the help message.
Samuel Benzaquen [Fri, 27 Feb 2015 17:53:23 +0000 (17:53 +0000)]
Add 'let' to the help message.

Summary: Add 'let' to the help message.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 230768

9 years agoAdd verifier to the IslCodeGeneration
Johannes Doerfert [Fri, 27 Feb 2015 17:37:05 +0000 (17:37 +0000)]
Add verifier to the IslCodeGeneration

  After a function was created we will verify it for Debug builds. If
  errors are found and debug-type equals "polly-codegen-isl" the SCoP,
  the isl AST, the function as well as the errors will be printed.

llvm-svn: 230767

9 years agoremove function names from comments; NFC
Sanjay Patel [Fri, 27 Feb 2015 17:27:15 +0000 (17:27 +0000)]
remove function names from comments; NFC

llvm-svn: 230766

9 years ago[clang-tidy] Various improvements in misc-use-override
Alexander Kornienko [Fri, 27 Feb 2015 16:50:32 +0000 (16:50 +0000)]
[clang-tidy] Various improvements in misc-use-override

  * Better error message when more than one of 'virtual', 'override' and 'final'
    is present ("X is/are redundant since the function is already declared Y").
  * Convert the messages to the style used in Clang diagnostics: lower case
    initial letter, no trailing period.
  * Don't run the check for files compiled in pre-C++11 mode
    (http://llvm.org/PR22638).

llvm-svn: 230765

9 years agoReland __leave tests (r230717 and r230720, reverted in r230740).
Nico Weber [Fri, 27 Feb 2015 16:40:43 +0000 (16:40 +0000)]
Reland __leave tests (r230717 and r230720, reverted in r230740).

The only change is that line 266 changed from
    // CHECK:  br label %[[except]]
to
    // CHECK:  br label %[[except:[^ ]*]]

llvm-svn: 230764

9 years agoAdd __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind instructions.
Renato Golin [Fri, 27 Feb 2015 16:35:48 +0000 (16:35 +0000)]
Add __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind instructions.

Equally to NetBSD, Bitrig will be using .eh_frame unwinding on ARM.

Patch by Patrick Wildt.

llvm-svn: 230763

9 years agoEqually to NetBSD, Bitrig/ARM uses the Itanium-ABI.
Renato Golin [Fri, 27 Feb 2015 16:35:27 +0000 (16:35 +0000)]
Equally to NetBSD, Bitrig/ARM uses the Itanium-ABI.

Patch by Patrick Wildt.

llvm-svn: 230762

9 years agoAMDGCN: Define cl_khr_fp64 when compiling OpenCL programs
Tom Stellard [Fri, 27 Feb 2015 15:10:19 +0000 (15:10 +0000)]
AMDGCN: Define cl_khr_fp64 when compiling OpenCL programs

llvm-svn: 230761

9 years ago[mips][microMIPS] Change register class for GP register
Zoran Jovanovic [Fri, 27 Feb 2015 15:03:50 +0000 (15:03 +0000)]
[mips][microMIPS] Change register class for GP register
Differential Revision: http://reviews.llvm.org/D7934

llvm-svn: 230760

9 years agoR600/SI: Add missing mubuf instructions
Tom Stellard [Fri, 27 Feb 2015 14:59:46 +0000 (14:59 +0000)]
R600/SI: Add missing mubuf instructions

llvm-svn: 230759

9 years agoR600/SI: Consistently put soffset before the offset operand for mubuf instructions
Tom Stellard [Fri, 27 Feb 2015 14:59:44 +0000 (14:59 +0000)]
R600/SI: Consistently put soffset before the offset operand for mubuf instructions

This matches the assembly syntax.

llvm-svn: 230758

9 years agoR600/SI: Add slc, glc, and tfe to non-atomic _ADDR64 instructions
Tom Stellard [Fri, 27 Feb 2015 14:59:41 +0000 (14:59 +0000)]
R600/SI: Add slc, glc, and tfe to non-atomic _ADDR64 instructions

llvm-svn: 230757

9 years agoPass correct -mtriple for krait-cpu-div-attribute.ll
Petar Jovanovic [Fri, 27 Feb 2015 14:46:41 +0000 (14:46 +0000)]
Pass correct -mtriple for krait-cpu-div-attribute.ll

Not passing mtriple for one of the tests caused a regression failure
on MIPS buildbot. The issue was introduced by r230651.

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

llvm-svn: 230756

9 years ago[ASan/Win] Update test expectations after r230724
Timur Iskhodzhanov [Fri, 27 Feb 2015 14:29:53 +0000 (14:29 +0000)]
[ASan/Win] Update test expectations after r230724

llvm-svn: 230755

9 years agoSilence an MSVC warning about not all control paths returning a value; NFC.
Aaron Ballman [Fri, 27 Feb 2015 13:55:58 +0000 (13:55 +0000)]
Silence an MSVC warning about not all control paths returning a value; NFC.

llvm-svn: 230754

9 years ago[x86] Run most of the rest of the shuffle combining over non-128-bit
Chandler Carruth [Fri, 27 Feb 2015 12:13:14 +0000 (12:13 +0000)]
[x86] Run most of the rest of the shuffle combining over non-128-bit
vectors. This lets us fix the rest of the v16 lowering problems when
pshufb is clearly better.

We might still be able to improve some of the lowerings by enabling the
other combine-based rewriting to fire for non-128-bit vectors, but this
at least should remove any regressions from using the fancy v16i16
lowering strategy.

llvm-svn: 230753