platform/upstream/llvm.git
10 years agoMachO: rename _outputFileType to avoid shadowing parent field.
Tim Northover [Fri, 20 Jun 2014 15:59:00 +0000 (15:59 +0000)]
MachO: rename _outputFileType to avoid shadowing parent field.

llvm-svn: 211367

10 years agoMove test so that it is skipped if the ARM target is not enabled.
Rafael Espindola [Fri, 20 Jun 2014 15:30:38 +0000 (15:30 +0000)]
Move test so that it is skipped if the ARM target is not enabled.

llvm-svn: 211366

10 years agoDisable Modules/dependency-dump-dependent-module.m on win32 for now.
NAKAMURA Takumi [Fri, 20 Jun 2014 15:04:25 +0000 (15:04 +0000)]
Disable Modules/dependency-dump-dependent-module.m on win32 for now.

FIXME: This fails on win32 due to ERROR_FILENAME_EXCED_RANGE if the working directory is too deep.

We should make Win32/Path.inc capable of long pathnames with '\\?\'.

llvm-svn: 211363

10 years agoThe ability to use vector initializer lists is a GNU vector extension
James Molloy [Fri, 20 Jun 2014 14:35:13 +0000 (14:35 +0000)]
The ability to use vector initializer lists is a GNU vector extension
and is unrelated to the NEON intrinsics in arm_neon.h. On little
endian machines it works fine, however on big endian machines it
exhibits surprising behaviour:

    uint32x2_t x = {42, 64};
    return vget_lane_u32(x, 0); // Will return 64.

Because of this, explicitly call out that it is unsupported on big
endian machines.

This patch will emit the following warning in big-endian mode:

    test.c:3:15: warning: vector initializers are a GNU extension and are not compatible with NEON intrinsics [-Wgnu]
    int32x4_t x = {0, 1, 2, 3};
                  ^
    test.c:3:15: note: consider using vld1q_s32() to initialize a vector from memory, or vcombine_s32(vcreate_s32(), vcreate_s32()) to initialize from integer constants
    1 warning generated.

llvm-svn: 211362

10 years agoAdd file missed in r211360 commit
Ulrich Weigand [Fri, 20 Jun 2014 14:32:39 +0000 (14:32 +0000)]
Add file missed in r211360 commit

llvm-svn: 211361

10 years ago[PowerPC] Fix ELF interpreter name for powerpc64le-linux
Ulrich Weigand [Fri, 20 Jun 2014 14:19:02 +0000 (14:19 +0000)]
[PowerPC] Fix ELF interpreter name for powerpc64le-linux

On PowerPC LE the system uses the /lib64/ld64.so.2 dynamic linker name
instead of /lib64/ld64.so.1 (to indicate the ELFv2 ABI version).

This fixes the clang driver to pass the appropriate -dynamic-linker
setting, and adds some more tests to linux-ld.c.

llvm-svn: 211360

10 years ago[PowerPC] Add MultiarchIncludeDirs for powerpc64le
Ulrich Weigand [Fri, 20 Jun 2014 13:41:24 +0000 (13:41 +0000)]
[PowerPC] Add MultiarchIncludeDirs for powerpc64le

There was already partial support for multi-arch on powerpc64le,
but the MultiarchIncludeDirs setting was missing.  This patch
adds the appropriate definition, and also extends the
linux-header-search.cpp test case to verify an Ubuntu 14.04
powerpc64le tree.

llvm-svn: 211359

10 years agoAllow a target to create a null streamer.
Rafael Espindola [Fri, 20 Jun 2014 13:11:28 +0000 (13:11 +0000)]
Allow a target to create a null streamer.

Targets can assume that a target streamer is present, so they have to be able
to construct a null streamer in order to set the target streamer in it to.

Fixes a crash when using the null streamer with arm.

llvm-svn: 211358

10 years agoFix PR20081: Parsing templates in the presence of -x cuda -std=c++11
Eli Bendersky [Fri, 20 Jun 2014 13:09:59 +0000 (13:09 +0000)]
Fix PR20081: Parsing templates in the presence of -x cuda -std=c++11

http://reviews.llvm.org/D4222

llvm-svn: 211357

10 years agoCode in LoopStrengthReduce.cpp depends on SmallBitVector::size() being size_t
Yaron Keren [Fri, 20 Jun 2014 12:57:44 +0000 (12:57 +0000)]
Code in LoopStrengthReduce.cpp depends on SmallBitVector::size() being size_t
and not unsigned.

llvm-svn: 211356

10 years ago[Mips] Make rel-copy.test test case independent from external input files.
Simon Atanasyan [Fri, 20 Jun 2014 12:54:06 +0000 (12:54 +0000)]
[Mips] Make rel-copy.test test case independent from external input files.

llvm-svn: 211355

10 years agoAdd module flags metadata to record the settings for enum and wchar width
Oliver Stannard [Fri, 20 Jun 2014 12:43:07 +0000 (12:43 +0000)]
Add module flags metadata to record the settings for enum and wchar width

Add module flags metadata to record the settings for enum and wchar width,
to allow correct ARM build attribute generation

llvm-svn: 211354

10 years agoReverting size_type for the containers from size_type to unsigned.
Yaron Keren [Fri, 20 Jun 2014 12:20:56 +0000 (12:20 +0000)]
Reverting size_type for the containers from size_type to unsigned.
Various places in LLVM assume that container size and count are unsigned
and do not use the container size_type. Therefore they break compilation
(or possibly executation) for LP64 systems where size_t is 64 bit while
unsigned is still 32 bit.

If we'll ever that many items in the container size_type could be made
size_t for a specific containers after reviweing its other uses.

llvm-svn: 211353

10 years ago[OPENMP] Initial support for 'nowait' clause.
Alexey Bataev [Fri, 20 Jun 2014 11:19:47 +0000 (11:19 +0000)]
[OPENMP] Initial support for 'nowait' clause.

llvm-svn: 211352

10 years agoAttempting to fix the 64 bit bots.
Yaron Keren [Fri, 20 Jun 2014 10:52:57 +0000 (10:52 +0000)]
Attempting to fix the 64 bit bots.

llvm-svn: 211351

10 years agoThe count() function for STL datatypes returns unsigned, even where it's
Yaron Keren [Fri, 20 Jun 2014 10:26:56 +0000 (10:26 +0000)]
The count() function for STL datatypes returns unsigned, even where it's
only 1/0 result like std::set. Some of the LLVM ADT already return unsigned
count(), while others still return bool count().

In continuation to r197879, this patch modifies DenseMap, DenseSet,
ScopedHashTable, ValueMap:: count() to return size_type instead of bool,
1 instead of true and 0 instead of false.

size_type is typedef-ed locally within each class to size_t.

http://reviews.llvm.org/D4018

Reviewed by dblaikie.

llvm-svn: 211350

10 years agoEmit the ARM build attributes ABI_PCS_wchar_t and ABI_enum_size.
Oliver Stannard [Fri, 20 Jun 2014 10:08:11 +0000 (10:08 +0000)]
Emit the ARM build attributes ABI_PCS_wchar_t and ABI_enum_size.

Emit the ARM build attributes ABI_PCS_wchar_t and ABI_enum_size based on
module flags metadata.

llvm-svn: 211349

10 years agoOMPScheduleClause::OMPScheduleClause(): Fix possible typos, s/\brief/\param/g. [...
NAKAMURA Takumi [Fri, 20 Jun 2014 09:52:04 +0000 (09:52 +0000)]
OMPScheduleClause::OMPScheduleClause(): Fix possible typos, s/\brief/\param/g. [-Wdocumentation]

llvm-svn: 211348

10 years ago[OPENMP] Initial support for 'ordered' clause.
Alexey Bataev [Fri, 20 Jun 2014 09:44:06 +0000 (09:44 +0000)]
[OPENMP] Initial support for 'ordered' clause.

llvm-svn: 211347

10 years agops][mips64r6] Added LSA/DLSA instructions
Zoran Jovanovic [Fri, 20 Jun 2014 09:28:09 +0000 (09:28 +0000)]
ps][mips64r6] Added LSA/DLSA instructions
Differential Revision: http://reviews.llvm.org/D3897

llvm-svn: 211346

10 years agoclang-tidy: [misc-use-override] Correctly handle defaulted destructors.
Daniel Jasper [Fri, 20 Jun 2014 09:12:46 +0000 (09:12 +0000)]
clang-tidy: [misc-use-override] Correctly handle defaulted destructors.

Also, minor implementation and test fixes.

llvm-svn: 211345

10 years agoFix/Improve SourceRange of explicitly defaulted members
Daniel Jasper [Fri, 20 Jun 2014 08:44:22 +0000 (08:44 +0000)]
Fix/Improve SourceRange of explicitly defaulted members

When adding the implicit compound statement (required for Codegen?), the
end location was previously overridden by the start location, probably
based on the assumptions:

* The location of the compound statement should be the member's location
* The compound statement if present is the last element of a FunctionDecl

This patch changes the location of the compound statement to the
member's end location.

Code review: http://reviews.llvm.org/D4175

llvm-svn: 211344

10 years ago[asan] when reporting an ODR violation, also print the stack traces where the globals...
Kostya Serebryany [Fri, 20 Jun 2014 08:24:12 +0000 (08:24 +0000)]
[asan] when reporting an ODR violation, also print the stack traces where the globals have been registered (thus show the name of shared library or exe to which the global belongs). The reports become a bit too verbose but I do not see any *simple* way to make them more compact. This should be especially helpful when the ODR happens because the same .cc file is used twice in the project in differend DSOs

llvm-svn: 211343

10 years ago[OPENMP] Initial support for 'schedule' clause.
Alexey Bataev [Fri, 20 Jun 2014 07:16:17 +0000 (07:16 +0000)]
[OPENMP] Initial support for 'schedule' clause.

llvm-svn: 211342

10 years agoR600: Trivial subtarget feature cleanups.
Matt Arsenault [Fri, 20 Jun 2014 06:50:05 +0000 (06:50 +0000)]
R600: Trivial subtarget feature cleanups.

Remove an unused AMDIL leftover, correct extra periods
appearing in the help menu.

llvm-svn: 211341

10 years agoArgList: use MakeArgList overloads in subclasses and clean up some calls.
Justin Bogner [Fri, 20 Jun 2014 04:36:29 +0000 (04:36 +0000)]
ArgList: use MakeArgList overloads in subclasses and clean up some calls.

llvm-svn: 211340

10 years agoAdd Support to Recognize and Vectorize NON SIMD instructions in SLPVectorizer.
Karthik Bhat [Fri, 20 Jun 2014 04:32:48 +0000 (04:32 +0000)]
Add Support to Recognize and Vectorize NON SIMD instructions in SLPVectorizer.

This patch adds support to recognize patterns such as fadd,fsub,fadd,fsub.../add,sub,add,sub... and
vectorizes them as vector shuffles if they are profitable.
These patterns of vector shuffle can later be converted to instructions such as addsubpd etc on X86.
Thanks to Arnold and Hal for the reviews. http://reviews.llvm.org/D4015

llvm-svn: 211339

10 years agoFrontend: Disentangle removePathTraversal from concatenating paths
Justin Bogner [Fri, 20 Jun 2014 03:28:46 +0000 (03:28 +0000)]
Frontend: Disentangle removePathTraversal from concatenating paths

This reimplements part of r211303 in a bit of a cleaner way. Doing so
allows us to use a proper absolute path when calling addFileMapping
rather than relying on a substring being one, which should fix the
tests on Windows.

llvm-svn: 211338

10 years agoSupport: Clean up getRounded() tests
Duncan P. N. Exon Smith [Fri, 20 Jun 2014 02:31:07 +0000 (02:31 +0000)]
Support: Clean up getRounded() tests

llvm-svn: 211337

10 years agoSupport: Write ScaledNumbers::getAdjusted()
Duncan P. N. Exon Smith [Fri, 20 Jun 2014 02:31:03 +0000 (02:31 +0000)]
Support: Write ScaledNumbers::getAdjusted()

llvm-svn: 211336

10 years agoSmall clanups:
Rafael Espindola [Fri, 20 Jun 2014 01:37:35 +0000 (01:37 +0000)]
Small clanups:

Use static instead of anonymous namespace.
Delete write only variables.

llvm-svn: 211335

10 years agoFix .cpp files claiming to be header files
Hans Wennborg [Fri, 20 Jun 2014 01:36:00 +0000 (01:36 +0000)]
Fix .cpp files claiming to be header files

llvm-svn: 211334

10 years agoSupport: Write ScaledNumbers::getRounded()
Duncan P. N. Exon Smith [Fri, 20 Jun 2014 01:30:43 +0000 (01:30 +0000)]
Support: Write ScaledNumbers::getRounded()

Start extracting helper functions out of -block-freq's `UnsignedFloat`
into `Support/ScaledNumber.h` with the eventual goal of moving and
renaming the class to `ScaledNumber`.

The bike shed about names is still being painted, but I'm going with
this for now.

llvm-svn: 211333

10 years ago[x86] Make the x86 PACKSSWB, PACKSSDW, PACKUSWB, and PACKUSDW
Chandler Carruth [Fri, 20 Jun 2014 01:05:28 +0000 (01:05 +0000)]
[x86] Make the x86 PACKSSWB, PACKSSDW, PACKUSWB, and PACKUSDW
instructions available as synthetic SDNodes PACKSS and PACKUS that will
select to the correct instruction variants based on the return type.
This allows us to use these rather important instructions when lowering
vector shuffles.

Also moves the relevant instruction definitions to be split out from
the fully generic multiclasses to allow them to match these new SDNodes
in the same way that the UNPCK instructions do.

No functionality should actually be changed here.

llvm-svn: 211332

10 years agoDon't build switch lookup tables for dllimport or TLS variables
Hans Wennborg [Fri, 20 Jun 2014 00:38:12 +0000 (00:38 +0000)]
Don't build switch lookup tables for dllimport or TLS variables

We would previously put dllimport variables in switch lookup tables, which
doesn't work because the address cannot be used in a constant initializer.
This is basically the same problem that we have in PR19955.

Putting TLS variables in switch tables also desn't work, because the
address of such a variable is not constant.

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

llvm-svn: 211331

10 years agoAvoid invalidating successfully loaded module files
Ben Langmuir [Fri, 20 Jun 2014 00:24:56 +0000 (00:24 +0000)]
Avoid invalidating successfully loaded module files

Successfully loaded module files may be referenced in other
ModuleManagers, so don't invalidate them. Two related things are fixed:

1) I thought the last module in the manager was always the one that
failed, but it isn't.  So check explicitly against the list of
vetted modules from ReadASTCore.

2) We now keep the file descriptor of pcm file open, which avoids the
possibility of having two different pcms for the same module loaded when
building in parallel with headers being modified during a build.

<rdar://problem/16835846>

llvm-svn: 211330

10 years agoCommand files that switch input handlers didn't work, now they do.
Greg Clayton [Fri, 20 Jun 2014 00:23:57 +0000 (00:23 +0000)]
Command files that switch input handlers didn't work, now they do.

The issue was when we called Debugger::RunIOHandler(), it would run the current IOHandler by activating it, and running it and then try to pop it and exit regardless of wether it was on top or not.

The new code will push the IOHandler that was passed in, and run the IOHandlers until the one passed in is successfully popped. This allows files for the "command source" to switch input handlers:

% cat /tmp/commands
br s -S alignLeftEdges:
br command add
bt
frame var
po self
DONE
b s -n main
br command add
bt
frame var
DONE

Note above we set a breakpoint, then add commands do it. The "br command add" will push the breakpoint comment gatherer until it sees "DONE" and then pop itself off the stack. The a new breakpoint will be set and it does the same thing again.

Now this file can be sourced from the command line:

% lldb -s /tmp/commands /path/to/a.out

And your breakpoints will be correctly setup!

<rdar://problem/17081650>

llvm-svn: 211329

10 years agoRevert "Add StringMap::insert(pair) consistent with the standard associative containe...
Rafael Espindola [Fri, 20 Jun 2014 00:23:03 +0000 (00:23 +0000)]
Revert "Add StringMap::insert(pair) consistent with the standard associative container concept."

This reverts commit r211309.

It looks like it broke some bots:

http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/15563/steps/compile/logs/stdio

llvm-svn: 211328

10 years agodiagtool: refactor TreeView to resemble C++
Alp Toker [Fri, 20 Jun 2014 00:06:42 +0000 (00:06 +0000)]
diagtool: refactor TreeView to resemble C++

Replace lots of old-school parameter passing with neat class members.
No attempt made yet to modernize loops, but it's a start.

llvm-svn: 211327

10 years agoAdded the -m option as an alias for -format=darwin to llvm-nm and llvm-size
Kevin Enderby [Fri, 20 Jun 2014 00:04:16 +0000 (00:04 +0000)]
Added the -m option as an alias for -format=darwin to llvm-nm and llvm-size
which is what the darwin tools use for the Mach-O format output.

llvm-svn: 211326

10 years agoThe gold plugin doesn't need disassemblers.
Rafael Espindola [Thu, 19 Jun 2014 23:06:53 +0000 (23:06 +0000)]
The gold plugin doesn't need disassemblers.

Back in r128440 tools/LTO started exporting the disassembler interface. It
was never clear why, but whatever the reason I am pretty sure it doesn't hold
for tools/gold.

llvm-svn: 211325

10 years agoObjective-C qoi. When Objective-C pointer mismatches with
Fariborz Jahanian [Thu, 19 Jun 2014 23:05:46 +0000 (23:05 +0000)]
Objective-C qoi. When Objective-C pointer mismatches with
a qualified-id type because pointer is object of a forward
class declaration, include this info in a diagnostic note.
// rdar://10751015

llvm-svn: 211324

10 years agodiagtool: simplify TreeView diagnostic classification
Alp Toker [Thu, 19 Jun 2014 23:00:52 +0000 (23:00 +0000)]
diagtool: simplify TreeView diagnostic classification

This utility doesn't need to know about the specifics of diagnostic levels.

llvm-svn: 211323

10 years agoSet gold plugin options in a sane order.
Rafael Espindola [Thu, 19 Jun 2014 22:54:47 +0000 (22:54 +0000)]
Set gold plugin options in a sane order.

This fixes the  processing of --plugin-opt=-jump-table-type=arity.

Nice properties:
 * We call InitTargetOptionsFromCodeGenFlags once.
 * We call parseCodeGenDebugOptions once.
 * It works :-)

llvm-svn: 211322

10 years agoFix the output of llvm-nm for Mach-O files to use the characters ‘d’ and ‘b’ for
Kevin Enderby [Thu, 19 Jun 2014 22:49:21 +0000 (22:49 +0000)]
Fix the output of llvm-nm for Mach-O files to use the characters ‘d’ and ‘b’ for
data and bss symbols instead of the generic ’s’ for a symbol in a section.

llvm-svn: 211321

10 years agoSimplify. No functionality change.
Rafael Espindola [Thu, 19 Jun 2014 22:33:23 +0000 (22:33 +0000)]
Simplify. No functionality change.

Thanks to Alp Toker for noticing it.

llvm-svn: 211320

10 years agoUse the assignment operator.
Rafael Espindola [Thu, 19 Jun 2014 22:27:46 +0000 (22:27 +0000)]
Use the assignment operator.

No functionality change.

llvm-svn: 211319

10 years agoReduce indentation. No functionality change.
Rafael Espindola [Thu, 19 Jun 2014 22:20:07 +0000 (22:20 +0000)]
Reduce indentation. No functionality change.

llvm-svn: 211318

10 years agoSet missing options in LTOCodeGenerator::setTargetOptions.
Rafael Espindola [Thu, 19 Jun 2014 22:14:12 +0000 (22:14 +0000)]
Set missing options in LTOCodeGenerator::setTargetOptions.

Patch by Tom Roeder, I just added the test.

llvm-svn: 211317

10 years agoChange the output of llvm-nm and llvm-size for Mach-O universal files (aka
Kevin Enderby [Thu, 19 Jun 2014 22:03:18 +0000 (22:03 +0000)]
Change the output of llvm-nm and llvm-size for Mach-O universal files (aka
fat files) to print “ (for architecture XYZ)” for fat files with more than
one architecture to be like what the darwin tools do for fat files.

Also clean up the Mach-O printing of archive membernames in llvm-nm to use
the darwin form of "libx.a(foo.o)".

llvm-svn: 211316

10 years agoUse lib/LTO directly in the gold plugin.
Rafael Espindola [Thu, 19 Jun 2014 21:14:13 +0000 (21:14 +0000)]
Use lib/LTO directly in the gold plugin.

The tools/lto API is not the best choice for implementing a gold plugin. Among
other issues:

* It is an stable ABI. Old errors stay and we have to be really careful
  before adding new features.
* It has to support two fairly different linkers: gold and ld64.
* We end up with a plugin that depends on a shared lib, something quiet
  unusual in LLVM land.
* It hides LLVM. For some features in the gold plugin it would be really
  nice to be able to just get a Module or a GlobalValue.

This change is intended to be a very direct translation from the C API. It
will just enable other fixes and cleanups.

Tested with a LTO bootstrap on linux.

llvm-svn: 211315

10 years agoAdd a new subtarget hook for whether or not we'd like to enable
Eric Christopher [Thu, 19 Jun 2014 21:03:04 +0000 (21:03 +0000)]
Add a new subtarget hook for whether or not we'd like to enable
the atomic load linked expander pass to run for a particular
subtarget. This requires a check of the subtarget and so save
the TargetMachine rather than only TargetLoweringInfo and update
all callers.

llvm-svn: 211314

10 years agoProvide mul for IEEE quad. From GuanHong Liu.
Joerg Sonnenberger [Thu, 19 Jun 2014 20:34:03 +0000 (20:34 +0000)]
Provide mul for IEEE quad. From GuanHong Liu.

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

llvm-svn: 211313

10 years agoProvide add and sub for IEEE quad. From GuanHong Liu.
Joerg Sonnenberger [Thu, 19 Jun 2014 20:24:49 +0000 (20:24 +0000)]
Provide add and sub for IEEE quad. From GuanHong Liu.

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

llvm-svn: 211312

10 years agoInclude Threading.h instead of forward declaring a function.
Zachary Turner [Thu, 19 Jun 2014 20:20:03 +0000 (20:20 +0000)]
Include Threading.h instead of forward declaring a function.

Previously this led to a circular header dependency, but a recent
change has since removed this dependency, so the correct fix is
to simply include the header rather than forward declare.

llvm-svn: 211311

10 years agotest: Just check the VFS when testing module-dependency-dump
Justin Bogner [Thu, 19 Jun 2014 20:18:00 +0000 (20:18 +0000)]
test: Just check the VFS when testing module-dependency-dump

Checking the filesystem seems to be a bit unreliable. Limit the tests
to the VFS map for now.

llvm-svn: 211310

10 years agoAdd StringMap::insert(pair) consistent with the standard associative container concept.
David Blaikie [Thu, 19 Jun 2014 20:08:56 +0000 (20:08 +0000)]
Add StringMap::insert(pair) consistent with the standard associative container concept.

Patch by Agustín Bergé.

llvm-svn: 211309

10 years agoSince we're using DW_AT_string rather than DW_AT_strp for debug_info
Eric Christopher [Thu, 19 Jun 2014 20:00:13 +0000 (20:00 +0000)]
Since we're using DW_AT_string rather than DW_AT_strp for debug_info
for assembly files we can't depend on the offset within the section
after a string since it could be different between producers etc.
Relax these tests accordingly.

llvm-svn: 211308

10 years agoFix up a few formatting issues.
Eric Christopher [Thu, 19 Jun 2014 20:00:09 +0000 (20:00 +0000)]
Fix up a few formatting issues.

llvm-svn: 211307

10 years agoFrontend: Fix a typo
Justin Bogner [Thu, 19 Jun 2014 19:49:28 +0000 (19:49 +0000)]
Frontend: Fix a typo

llvm-svn: 211306

10 years agoRemove an incorrect fixme.
Rafael Espindola [Thu, 19 Jun 2014 19:45:25 +0000 (19:45 +0000)]
Remove an incorrect fixme.

dynamic-no-pic is just another output type. If gnu ld gets support for MachO,
it should also add something like LDPO_DYN_NO_PIC to the plugin interface.

llvm-svn: 211305

10 years agoFix typos
Alp Toker [Thu, 19 Jun 2014 19:41:26 +0000 (19:41 +0000)]
Fix typos

llvm-svn: 211304

10 years agoFrontend: Add a CC1 flag to dump module dependencies to a directory
Justin Bogner [Thu, 19 Jun 2014 19:36:03 +0000 (19:36 +0000)]
Frontend: Add a CC1 flag to dump module dependencies to a directory

This adds the -module-dependency-dir to clang -cc1, which specifies a
directory to copy all of a module's dependencies into in a form
suitable to be used as a VFS using -ivfsoverlay with the generated
vfs.yaml.

This is useful for crashdumps that involve modules, so that the module
dependencies will be intact when a crash report script is used to
reproduce a problem on another machine.

We currently encode the absolute path to the dump directory, due to
limitations in the VFS system. Until we can handle relative paths in
the VFS, users of the VFS map may need to run a simple search and
replace in the file.

llvm-svn: 211303

10 years agoSupport: Add llvm::sys::fs::copy_file
Justin Bogner [Thu, 19 Jun 2014 19:35:39 +0000 (19:35 +0000)]
Support: Add llvm::sys::fs::copy_file

A function to copy one file's contents to another.

llvm-svn: 211302

10 years agoRemove bogus configure check
David Greene [Thu, 19 Jun 2014 19:31:11 +0000 (19:31 +0000)]
Remove bogus configure check

Configure creates makefiles, so it doesn't make sense to check for
them to see if we can configure.

llvm-svn: 211301

10 years agoAdd option to keep flavor out of the install directory
David Greene [Thu, 19 Jun 2014 19:31:09 +0000 (19:31 +0000)]
Add option to keep flavor out of the install directory

Sometimes we want to install things in "standard" locations and the
flavor directories interfere with that.  Add an option to keep them
out of the install path.

llvm-svn: 211300

10 years agoTurn of -Werror by default
David Greene [Thu, 19 Jun 2014 19:31:05 +0000 (19:31 +0000)]
Turn of -Werror by default

Don't build with -Werror unless asked to.

llvm-svn: 211299

10 years agoFix this test a little harder - use llc_dwarf to make sure we don't
Eric Christopher [Thu, 19 Jun 2014 19:26:42 +0000 (19:26 +0000)]
Fix this test a little harder - use llc_dwarf to make sure we don't
try to execute it on windows.

llvm-svn: 211298

10 years agoRemove unused includes following r211294
Alp Toker [Thu, 19 Jun 2014 19:25:49 +0000 (19:25 +0000)]
Remove unused includes following r211294

llvm-svn: 211297

10 years agoTest commit: Correct type in two comments.
John Wolfe [Thu, 19 Jun 2014 19:21:53 +0000 (19:21 +0000)]
Test commit: Correct type in two comments.

llvm-svn: 211296

10 years agoFixed formatting.
Yaron Keren [Thu, 19 Jun 2014 19:12:02 +0000 (19:12 +0000)]
Fixed formatting.

llvm-svn: 211295

10 years agoUse the c++ APIs.
Rafael Espindola [Thu, 19 Jun 2014 19:11:22 +0000 (19:11 +0000)]
Use the c++ APIs.

No functionality change.

llvm-svn: 211294

10 years agoRelax this test a bit, we don't need the full contents of the
Eric Christopher [Thu, 19 Jun 2014 18:36:15 +0000 (18:36 +0000)]
Relax this test a bit, we don't need the full contents of the
frame section to match, just the version for this test.

llvm-svn: 211293

10 years agoFix PR20069: bad loop pragma arguments crash FE
Eli Bendersky [Thu, 19 Jun 2014 18:30:15 +0000 (18:30 +0000)]
Fix PR20069: bad loop pragma arguments crash FE

This patch fixes a crash when handling malformed arguments to loop pragmas such
as: "#pragma clang loop vectorize(()".  Essentially any argument which is not an
identifier or constant resulted in a crash.  This patch also changes a couple of
the error messages which weren't quite correct.  New behavior with this patch vs
old behavior:

#pragma clang loop vectorize(1)
OLD: error: missing keyword; expected 'enable' or 'disable'
NEW: error: invalid argument; expected 'enable' or 'disable'

#pragma clang loop vectorize()
OLD: error: expected ')'
NEW: error: missing argument to loop pragma 'vectorize'

#pragma clang loop vectorize_width(bad)
OLD: error: missing value; expected a positive integer value
NEW: error: invalid argument; expected a positive integer value

#pragma clang loop vectorize(bad)
OLD: invalid keyword 'bad'; expected 'enable' or 'disable'
NEW: error: invalid argument; expected 'enable' or 'disable'

http://reviews.llvm.org/D4197

Patch by Mark Heffernan

llvm-svn: 211292

10 years agoRemove use of removed function, llvm_stop_multithreading
David Blaikie [Thu, 19 Jun 2014 18:26:28 +0000 (18:26 +0000)]
Remove use of removed function, llvm_stop_multithreading

llvm-svn: 211291

10 years agoRemove circular header reference in Threading.h/Mutex.h
David Blaikie [Thu, 19 Jun 2014 18:26:26 +0000 (18:26 +0000)]
Remove circular header reference in Threading.h/Mutex.h

llvm-svn: 211290

10 years agoSwitch over to using object_getClass to get the class of an object. Previously we...
Jim Ingham [Thu, 19 Jun 2014 18:25:51 +0000 (18:25 +0000)]
Switch over to using object_getClass to get the class of an object.  Previously we were
directly accessing the isa pointer of a class object to get its meta-class, but the isa
pointers are not simple pointers on arm64, so this would cause the stepping to fail.
object_getClass does whatever magic needs doing in this case.

<rdar://problem/17239690>

llvm-svn: 211289

10 years agoFix build on non-Windows platforms.
Zachary Turner [Thu, 19 Jun 2014 18:25:06 +0000 (18:25 +0000)]
Fix build on non-Windows platforms.

llvm-svn: 211288

10 years agoRemove support for LLVM runtime multi-threading.
Zachary Turner [Thu, 19 Jun 2014 18:18:23 +0000 (18:18 +0000)]
Remove support for LLVM runtime multi-threading.

After a number of previous small iterations, the functions
llvm_start_multithreaded() and llvm_stop_multithreaded() have
been reduced essentially to no-ops.  This change removes them
entirely.

Reviewed by: rnk, dblaikie

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

llvm-svn: 211287

10 years agoDocument unroll and unroll_count directives.
Eli Bendersky [Thu, 19 Jun 2014 18:12:44 +0000 (18:12 +0000)]
Document unroll and unroll_count directives.

Extend the documentation for "#pragma clang loop" hints to include the unroll
and unroll_count directives.

Patch by Mark Heffernan [http://reviews.llvm.org/D4198]

llvm-svn: 211286

10 years agoDon't call llvm_start_multithreaded() during init. As of LLVM
Zachary Turner [Thu, 19 Jun 2014 18:03:56 +0000 (18:03 +0000)]
Don't call llvm_start_multithreaded() during init.  As of LLVM
revision r211277, this function is essentially a no-op.

llvm-svn: 211285

10 years agoDebugInfo: Fission: Ensure the address pool entries for location lists are emitted.
David Blaikie [Thu, 19 Jun 2014 17:59:14 +0000 (17:59 +0000)]
DebugInfo: Fission: Ensure the address pool entries for location lists are emitted.

The address pool was being emitted before location lists. The latter
could add more entries to the pool which would be lost/never emitted.

llvm-svn: 211284

10 years agoFixed up gdb-remote auxv regex issues with binary data.
Todd Fiala [Thu, 19 Jun 2014 17:35:40 +0000 (17:35 +0000)]
Fixed up gdb-remote auxv regex issues with binary data.
Fixes two causes for https://github.com/tfiala/lldb/issues/7.

1. Ensures the inferior program has started executing, by printing
a message on output first thing (per the "message:" command line arg)
and waiting for that text to arrive before doing any checks related
to auxv support.

2. Fixes up auxv-related regex patterns to be compiled with the Python
re.MULTILINE and re.DOTALL options.  The multiline is needed because
the binary data can include what look like newlines when interpreted
as text, and the DOTALL is needed to have the (.*) content portion match
newlines.

Added interrupt packet helper methods to add interrupt test sequence
packets and parse the results from them.

llvm-svn: 211283

10 years agoMCNullStreamer: assign file IDs to resolve crashes and errors
Alp Toker [Thu, 19 Jun 2014 17:15:36 +0000 (17:15 +0000)]
MCNullStreamer: assign file IDs to resolve crashes and errors

Use the MCStreamer base implementations for file ID tracking instead of
overriding them as no-ops.

Avoids assertions when streaming Dwarf debug info, and fixes ASM parsing of loc
and file directives.

llvm-svn: 211282

10 years ago[ValueTracking] Extend range metadata to call/invoke
Jingyue Wu [Thu, 19 Jun 2014 16:50:16 +0000 (16:50 +0000)]
[ValueTracking] Extend range metadata to call/invoke

Summary:
With this patch, range metadata can be added to call/invoke including
IntrinsicInst. Previously, it could only be added to load.

Rename computeKnownBitsLoad to computeKnownBitsFromRangeMetadata because
range metadata is not only used by load.

Update the language reference to reflect this change.

Test Plan:
Add several tests in range-2.ll to confirm the verifier is happy with
having range metadata on call/invoke.

Add two tests in AddOverFlow.ll to confirm annotating range metadata to
call/invoke can benefit InstCombine.

Reviewers: meheff, nlewycky, reames, hfinkel, eliben

Reviewed By: eliben

Subscribers: llvm-commits

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

llvm-svn: 211281

10 years agoUpdate for ScopStmt iterator name change in LLVM r210927
Tobias Grosser [Thu, 19 Jun 2014 16:45:04 +0000 (16:45 +0000)]
Update for ScopStmt iterator name change in LLVM r210927

Contributed-by: Yabin Hu <yabin.hwu@gmail.com>
llvm-svn: 211280

10 years agoTests for r211273
Oliver Stannard [Thu, 19 Jun 2014 16:35:19 +0000 (16:35 +0000)]
Tests for r211273

llvm-svn: 211279

10 years agoFix build
Johannes Doerfert [Thu, 19 Jun 2014 16:19:32 +0000 (16:19 +0000)]
Fix build

See r210927 and r210847

llvm-svn: 211278

10 years agoKill the LLVM global lock.
Zachary Turner [Thu, 19 Jun 2014 16:17:42 +0000 (16:17 +0000)]
Kill the LLVM global lock.

This patch removes the LLVM global lock, and updates all existing
users of the global lock to use their own mutex.    None of the
existing users of the global lock were protecting code that was
mutually exclusive with any of the other users of the global
lock, so its purpose was not being met.

Reviewed by: rnk

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

llvm-svn: 211277

10 years agoImprove robustness of tests for module flags metadata
Oliver Stannard [Thu, 19 Jun 2014 16:10:21 +0000 (16:10 +0000)]
Improve robustness of tests for module flags metadata

Fix clang tests to not break if the ID numbers of module flags metadata
nodes change.

llvm-svn: 211276

10 years agoEmit DWARF info for all code section in an assembly file
Oliver Stannard [Thu, 19 Jun 2014 15:52:37 +0000 (15:52 +0000)]
Emit DWARF info for all code section in an assembly file

Currently, when using llvm as an assembler, DWARF debug information is only
generated for the .text section. This patch modifies this so that DWARF info
is emitted for all executable sections.

llvm-svn: 211273

10 years agoEmit DWARF3 call frame information when DWARF3+ debug info is requested
Oliver Stannard [Thu, 19 Jun 2014 15:39:33 +0000 (15:39 +0000)]
Emit DWARF3 call frame information when DWARF3+ debug info is requested

Currently, llvm always emits a DWARF CIE with a version of 1, even when emitting
DWARF 3 or 4, which both support CIE version 3. This patch makes it emit the
newer CIE version when we are emitting DWARF 3 or 4. This will not reduce
compatibility, as we already emit other DWARF3/4 features, and is worth doing as
the DWARF3 spec removed some ambiguities in the interpretation of call frame
information.

It also fixes a minor bug where the "return address" field of the CIE was
encoded as a ULEB128, which is only valid when the CIE version is 3. There are
no test changes for this, because (as far as I can tell) none of the platforms
that we test have a return address register with a DWARF register number >127.

llvm-svn: 211272

10 years ago[mips] Implementation of dli.
Matheus Almeida [Thu, 19 Jun 2014 15:08:04 +0000 (15:08 +0000)]
[mips] Implementation of dli.

Patch by David Chisnall
His work was sponsored by: DARPA, AFRL

Some small modifications to the original patch: we now error if
it's not possible to expand an instruction (mips-expansions-bad.s has some
examples). Added some comments to the expansions.

llvm-svn: 211271

10 years agoFix assertion hit or bogus compiler error in cases when instantiating ObjC property...
Argyrios Kyrtzidis [Thu, 19 Jun 2014 14:45:16 +0000 (14:45 +0000)]
Fix assertion hit or bogus compiler error in cases when instantiating ObjC property accesses used with overloaded binary operators.

rdar://17153478

llvm-svn: 211270

10 years ago[mips] Small update to the logic behind the expansion of assembly pseudo instructions.
Matheus Almeida [Thu, 19 Jun 2014 14:39:14 +0000 (14:39 +0000)]
[mips] Small update to the logic behind the expansion of assembly pseudo instructions.

Summary:
The functions that do the expansion now return false on success and true otherwise. This is so
we can catch some errors during the expansion (e.g.: immediate too large). The next patch adds some test cases.

Reviewers: vmedic

Reviewed By: vmedic

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

llvm-svn: 211269

10 years agoUpdated comments as suggested by Rafael. Thanks.
Dinesh Dwivedi [Thu, 19 Jun 2014 14:11:53 +0000 (14:11 +0000)]
Updated comments as suggested by Rafael. Thanks.

llvm-svn: 211268

10 years ago[c++1z] Implement N3994: a range-based for loop can declare a variable with super...
Richard Smith [Thu, 19 Jun 2014 11:42:00 +0000 (11:42 +0000)]
[c++1z] Implement N3994: a range-based for loop can declare a variable with super-terse notation

  for (x : range) { ... }

which is equivalent to

  for (auto &&x : range) { ... }

llvm-svn: 211267

10 years agoAdded instruction combine to transform few more negative values addition to subtracti...
Dinesh Dwivedi [Thu, 19 Jun 2014 10:36:52 +0000 (10:36 +0000)]
Added instruction combine to transform few more negative values addition to subtraction (Part 1)
This patch enables transforms for following patterns.
  (x + (~(y & c) + 1)   -->   x - (y & c)
  (x + (~((y >> z) & c) + 1)   -->   x - ((y>>z) & c)

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

llvm-svn: 211266

10 years ago[X86] Teach how to combine horizontal binop even in the presence of undefs.
Andrea Di Biagio [Thu, 19 Jun 2014 10:29:41 +0000 (10:29 +0000)]
[X86] Teach how to combine horizontal binop even in the presence of undefs.

Before this change, the backend was unable to fold a build_vector dag
node with UNDEF operands into a single horizontal add/sub.

This patch teaches how to combine a build_vector with UNDEF operands into a
horizontal add/sub when possible. The algorithm conservatively avoids to combine
a build_vector with only a single non-UNDEF operand.

Added test haddsub-undef.ll to verify that we correctly fold horizontal binop
even in the presence of UNDEFs.

llvm-svn: 211265

10 years ago[sanitizer] Intercept pthread_*attr_get*.
Evgeniy Stepanov [Thu, 19 Jun 2014 10:19:57 +0000 (10:19 +0000)]
[sanitizer] Intercept pthread_*attr_get*.

This is a resubmit of r211166 reverted due to osx breakage.

llvm-svn: 211264