platform/upstream/llvm.git
9 years agoRevert "Wrap clang module files in a Mach-O, ELF, or COFF container."
Adrian Prantl [Sat, 21 Feb 2015 00:29:14 +0000 (00:29 +0000)]
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."

This reverts commit 230099.

The Linux configure+make build variant still needs some work.

llvm-svn: 230103

9 years agoFix the test so it runs correctly when there are spaces in the path to the stdc+...
Greg Clayton [Sat, 21 Feb 2015 00:28:32 +0000 (00:28 +0000)]
Fix the test so it runs correctly when there are spaces in the path to the stdc++ library.

<rdar://problem/19297312>

llvm-svn: 230102

9 years agoFix this test case so it runs correctly.
Greg Clayton [Sat, 21 Feb 2015 00:23:36 +0000 (00:23 +0000)]
Fix this test case so it runs correctly.

<rdar://problem/19286788>

llvm-svn: 230101

9 years agoAsmParser: Use StringRef for keyword comparisons, NFC
Duncan P. N. Exon Smith [Sat, 21 Feb 2015 00:18:40 +0000 (00:18 +0000)]
AsmParser: Use StringRef for keyword comparisons, NFC

Leverage `StringRef` inside keyword comparison macros.  There's no
reason to be so low-level here, and I'm about to add another
`startswith()` use, so let's make it easy to read.

llvm-svn: 230100

9 years agoconfigure+make: Rearange clangCodeGen to come before clangAST.
Adrian Prantl [Sat, 21 Feb 2015 00:15:40 +0000 (00:15 +0000)]
configure+make: Rearange clangCodeGen to come before clangAST.
Follow-up to r230089.

llvm-svn: 230099

9 years agoSet the datalayout in the gold plugin.
Rafael Espindola [Sat, 21 Feb 2015 00:13:15 +0000 (00:13 +0000)]
Set the datalayout in the gold plugin.

This fixes the gold tests after r230054.

llvm-svn: 230098

9 years ago[PlaceSafepoints] Adjust enablement logic to default to off and be GC configurable...
Philip Reames [Sat, 21 Feb 2015 00:09:09 +0000 (00:09 +0000)]
[PlaceSafepoints] Adjust enablement logic to default to off and be GC configurable per GC

Previously, this pass ran over every function in the Module if added to the pass order.  With this change, it runs only over those with a GC attribute where the GC explicitly opts in.  A GC can also choose which of entry safepoint polls, backedge safepoint polls, and call safepoints it wants.  I hope to get these exposed as checks on the GCStrategy at some point, but for now, the checks are manual string comparisons.

llvm-svn: 230097

9 years agoconfigure+make: Add ipo to the dependencies of libclang.
Adrian Prantl [Sat, 21 Feb 2015 00:04:15 +0000 (00:04 +0000)]
configure+make: Add ipo to the dependencies of libclang.
Follow-up to r230089.

llvm-svn: 230096

9 years agoAsmParser: Use do{}while(false) in macros, NFC
Duncan P. N. Exon Smith [Fri, 20 Feb 2015 23:49:24 +0000 (23:49 +0000)]
AsmParser: Use do{}while(false) in macros, NFC

`do { ... } while (false)` is standard macro etiquette for forcing
instantiations into a single statement and requiring a `;` afterwards,
making statement-like macros easier to reason about (and harder to use
incorrectly).

I'm about to modify the macros in `LexIdentifier()`.  I noticed that the
`KEYWORD` macro *does* follow the rule, so I thought I'd clean up the
other macros to match (otherwise might not be worth changing, since the
benefits of this pattern are fairly irrelevant here).

llvm-svn: 230095

9 years agoRemove some unnecessary unreachables in favor of (sometimes implicit) assertions
David Blaikie [Fri, 20 Feb 2015 23:44:24 +0000 (23:44 +0000)]
Remove some unnecessary unreachables in favor of (sometimes implicit) assertions

Also simplify some else-after-return cases including some standard
algorithm convenience/use.

llvm-svn: 230094

9 years agoLiveRangeCalc: Don't start liveranges of PHI instruction at the block begin.
Matthias Braun [Fri, 20 Feb 2015 23:43:14 +0000 (23:43 +0000)]
LiveRangeCalc: Don't start liveranges of PHI instruction at the block begin.

Summary:
Letting them begin at the PHI instruction slightly simplifies the code
but more importantly avoids breaking the assumption that live ranges
starting at the block begin are also live at the end of the predecessor
blocks. The MachineVerifier checks that but was apparently never run in
the few instances where liveranges are calculated for machine-SSA
functions.

Reviewers: qcolombet

Subscribers: llvm-commits

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

llvm-svn: 230093

9 years ago[Mips] Support mips32r3, mips32r5, mips64r3, mips64r5 MIPS ISA names
Simon Atanasyan [Fri, 20 Feb 2015 23:37:40 +0000 (23:37 +0000)]
[Mips] Support mips32r3, mips32r5, mips64r3, mips64r5 MIPS ISA names

The patch teaches the clang's driver to understand new MIPS ISA names,
pass appropriate options to the assembler, defines corresponding macros etc

http://reviews.llvm.org/D7737

llvm-svn: 230092

9 years agoDon't set $LIB if we're not targetting windows.
Filipe Cabecinhas [Fri, 20 Feb 2015 23:35:19 +0000 (23:35 +0000)]
Don't set $LIB if we're not targetting windows.

Reviewers: timurrrr, samsonov

Subscribers: llvm-commits

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

llvm-svn: 230091

9 years agoAdapt Makefile dependencies for the clang module format change in r230089.
Adrian Prantl [Fri, 20 Feb 2015 23:35:07 +0000 (23:35 +0000)]
Adapt Makefile dependencies for the clang module format change in r230089.

llvm-svn: 230090

9 years agoWrap clang module files in a Mach-O, ELF, or COFF container.
Adrian Prantl [Fri, 20 Feb 2015 23:34:26 +0000 (23:34 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

This reapplies r230044 with a fixed configure+make build and updated
dependencies. Take 2.

llvm-svn: 230089

9 years agoHide a bunch of advanced testing options in default opt --help output
Philip Reames [Fri, 20 Feb 2015 23:32:03 +0000 (23:32 +0000)]
Hide a bunch of advanced testing options in default opt --help output

These are internal options.  I need to go through, evaluate which are worth keeping and which not.  Many of them should probably be renamed as well.  Until I have time to do that, we can at least stop poluting the standard opt -help output.

llvm-svn: 230088

9 years agoUse short names for jumptable sections.
Rafael Espindola [Fri, 20 Feb 2015 23:28:28 +0000 (23:28 +0000)]
Use short names for jumptable sections.

Also refactor code to remove some duplication.

llvm-svn: 230087

9 years agoPECOFF: Temporarily add a lock to un-break buildbot.
Rui Ueyama [Fri, 20 Feb 2015 23:22:36 +0000 (23:22 +0000)]
PECOFF: Temporarily add a lock to un-break buildbot.

Looks like there's a threading issue in the COFF reader which makes
buildbot unstable. Probability of crash varies depending on the number
of input. If we are linking a big executalbe, LLD almost always crash.

This patch temporarily adds a lock to guard the reader so that LLD
doesn't crash. I'll investigate and fix the issue as soon as possible
because this patch has negative performance impact.

llvm-svn: 230086

9 years agoRevert "[llvm-pdbdump] Add some tests for llvm-pdbdump."
Zachary Turner [Fri, 20 Feb 2015 23:21:21 +0000 (23:21 +0000)]
Revert "[llvm-pdbdump] Add some tests for llvm-pdbdump."

It is not correctly detecting the situations where the test is
unsupported.  Reverting until we can figure it out.

llvm-svn: 230085

9 years ago[RewriteStatepointsForGC] Use DenseSet in place of std::set [NFC]
Philip Reames [Fri, 20 Feb 2015 23:16:52 +0000 (23:16 +0000)]
[RewriteStatepointsForGC] Use DenseSet in place of std::set [NFC]

This should be the last cleanup on non-llvm preferred data structures.  I left one use of std::set in an assertion; DenseSet didn't seem to have a tombstone for CallSite defined.  That might be worth fixing, but wasn't worth it for a debug only use.

llvm-svn: 230084

9 years ago[llvm-pdbdump] Add some tests for llvm-pdbdump.
Zachary Turner [Fri, 20 Feb 2015 23:05:57 +0000 (23:05 +0000)]
[llvm-pdbdump] Add some tests for llvm-pdbdump.

This adds only a very basic set of tests that dump a few
functions and object files.

Differential Revision: http://reviews.llvm.org/D7656
Reviewed By: David Blaikie

llvm-svn: 230083

9 years agoFix TestStubSetSID after unification in to a single lldb-server binary.
Siva Chandra [Fri, 20 Feb 2015 22:58:00 +0000 (22:58 +0000)]
Fix TestStubSetSID after unification in to a single lldb-server binary.

Summary:
lldb-server needs an explicit 'g' or 'p' argument now. Since lldb-server
is started as a gdbserver in this test, 'g' should be passed to it
explicitly.

Test Plan: ./dotest.py -p TestStubSetSID

Reviewers: flackr, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 230082

9 years ago[RewriteStatepointsForGC] Replace std::map with DenseMap
Philip Reames [Fri, 20 Feb 2015 22:48:20 +0000 (22:48 +0000)]
[RewriteStatepointsForGC] Replace std::map with DenseMap

I'd done the work of extracting the typedef in a previous commit, but didn't actually change it.  Hopefully this will make any subtle changes easier to isolate.

llvm-svn: 230081

9 years agoThis should fix the Windows build
Enrico Granata [Fri, 20 Feb 2015 22:43:17 +0000 (22:43 +0000)]
This should fix the Windows build

llvm-svn: 230080

9 years ago[RewriteStatepointsForGC] Cleanup - replace std::vector usage [NFC]
Philip Reames [Fri, 20 Feb 2015 22:39:41 +0000 (22:39 +0000)]
[RewriteStatepointsForGC] Cleanup - replace std::vector usage [NFC]

Migrate std::vector usage to a combination of SmallVector and ArrayRef.

llvm-svn: 230079

9 years agoUsed the cached subtarget off of the MachineFunction.
Eric Christopher [Fri, 20 Feb 2015 22:36:11 +0000 (22:36 +0000)]
Used the cached subtarget off of the MachineFunction.

llvm-svn: 230078

9 years agoRename the "glob arguments" feature to "shell expand arguments"
Enrico Granata [Fri, 20 Feb 2015 22:20:30 +0000 (22:20 +0000)]
Rename the "glob arguments" feature to "shell expand arguments"

This should not bring any feature change, except changing names of things here and there

llvm-svn: 230077

9 years agoMake sure things build for iOS after recent changes.
Greg Clayton [Fri, 20 Feb 2015 22:20:05 +0000 (22:20 +0000)]
Make sure things build for iOS after recent changes.

llvm-svn: 230076

9 years agoX86: Remove pre-2010 dead code in mergeSPUpdatesDown
Reid Kleckner [Fri, 20 Feb 2015 22:13:25 +0000 (22:13 +0000)]
X86: Remove pre-2010 dead code in mergeSPUpdatesDown

llvm-svn: 230075

9 years agoLowerScalarImmediateShift - Merged v16i8 and v32i8 shift lowering. NFC.
Simon Pilgrim [Fri, 20 Feb 2015 22:13:03 +0000 (22:13 +0000)]
LowerScalarImmediateShift - Merged v16i8 and v32i8 shift lowering. NFC.

llvm-svn: 230074

9 years agoRevert "Wrap clang module files in a Mach-O, ELF, or COFF container."
Adrian Prantl [Fri, 20 Feb 2015 22:12:19 +0000 (22:12 +0000)]
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."

This reverts commit r230067.

Investigating another batch of problems found by the bots.

llvm-svn: 230073

9 years agoR600/SI: Remove v_sub_f64 pseudo
Matt Arsenault [Fri, 20 Feb 2015 22:10:45 +0000 (22:10 +0000)]
R600/SI: Remove v_sub_f64 pseudo

The expansion code does the same thing. Since
the operands were not defined with the correct
types, this has the side effect of fixing operand
folding since the expanded pseudo would never use
SGPRs or inline immediates.

llvm-svn: 230072

9 years agoR600: Use new fmad node.
Matt Arsenault [Fri, 20 Feb 2015 22:10:41 +0000 (22:10 +0000)]
R600: Use new fmad node.

This enables a few useful combines that used to only
use fma.

Also since v_mad_f32 apparently does not support denormals,
disable the existing cases that are custom handled if they are
requested.

llvm-svn: 230071

9 years agoAdd generic fmad DAG node.
Matt Arsenault [Fri, 20 Feb 2015 22:10:33 +0000 (22:10 +0000)]
Add generic fmad DAG node.

This allows sharing of FMA forming combines to work
with instructions that have the same semantics as a separate
multiply and add.

This is expand by default, and only formed post legalization
so it shouldn't have much impact on targets that do not want it.

llvm-svn: 230070

9 years agoRemove YAML/Native round-trip passes.
Rui Ueyama [Fri, 20 Feb 2015 22:10:28 +0000 (22:10 +0000)]
Remove YAML/Native round-trip passes.

The round-trip passes were introduced in r193300. The intention of
the change was to make sure that LLD is capable of reading end
writing such file formats.

But that turned out to be yet another over-designed stuff that had
been slowing down everyday development.

The passes ran after the core linker and before the writer. If you
had an additional piece of information that needs to be passed from
front-end to the writer, you had to invent a way to save the data to
YAML/Native. These passes forced us to do that even if that data
was not needed to be represented neither in an object file nor in
an executable/DSO. It doesn't make sense. We don't need these passes.

http://reviews.llvm.org/D7480

llvm-svn: 230069

9 years ago[RewriteStatepointsForGC] More style cleanup [NFC]
Philip Reames [Fri, 20 Feb 2015 22:05:18 +0000 (22:05 +0000)]
[RewriteStatepointsForGC] More style cleanup [NFC]

Use llvm_unreachable where appropriate, use SmallVector where easy to do so, introduce typedefs for planned type migrations.

llvm-svn: 230068

9 years agoWrap clang module files in a Mach-O, ELF, or COFF container.
Adrian Prantl [Fri, 20 Feb 2015 21:53:12 +0000 (21:53 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

This reapplies r230044 with a fixed configure+make build and updated
dependencies.

llvm-svn: 230067

9 years agoMake sure the public state is eStateStopped when we return from SBTarget::LoadCore...
Greg Clayton [Fri, 20 Feb 2015 21:51:06 +0000 (21:51 +0000)]
Make sure the public state is eStateStopped when we return from SBTarget::LoadCore() by hijacking the public event queue so we can ensure that the event gets consumed and the public state of the process (StateType SBProcess::GetState()) returns eStateStopped.

llvm-svn: 230066

9 years agoStart the refactoring of globbing
Enrico Granata [Fri, 20 Feb 2015 21:48:38 +0000 (21:48 +0000)]
Start the refactoring of globbing

- Add Host::GlobArguments() to perform local-globbing
I implemented this on OSX and Windows in terms of argdumper (Windows implementation is essentially the same as the OSX version + a change in binary name and some string magic)
Other platforms did not specifically chime in, so I left it unimplemented for them for the time being. Please feel free to fill in the blanks

- Add Platform::GlobArguments() to support remote-globbing
For now, no feature change here - but now we have infrastructure to help GDBRemote targets to support globbing - and patches to that effect will follow

No visible feature change

llvm-svn: 230065

9 years agoDon't try to rebuild modules on umbrella header mismatch
Ben Langmuir [Fri, 20 Feb 2015 21:46:39 +0000 (21:46 +0000)]
Don't try to rebuild modules on umbrella header mismatch

There are two issues here:
1) It's too late to rebuild at this point, because we won't go through
removeModules and when we try to reload the new .pcm we'll get the old
one instead.  We might be able to call removeModules after an OutOfDate
here, but I'm not yet confident that it is always safe to do so.

2) In practice, this check fails spuriously when the umbrella header
appears to change because of a VFS change that means it maps to a
different copy of the same file.  Because of this, we just skip the
check for now.

llvm-svn: 230064

9 years ago[RewriteStatepointsForGC] Remove notion of SafepointBounds [NFC]
Philip Reames [Fri, 20 Feb 2015 21:34:11 +0000 (21:34 +0000)]
[RewriteStatepointsForGC] Remove notion of SafepointBounds [NFC]

The notion of a range of inserted safepoint related code is no longer really applicable.  This survived over from an earlier implementation.  Just saving the inserted gc.statepoint and working from that is far clearer given the current code structure.  Particularly when invokable statepoints get involved.

llvm-svn: 230063

9 years agoRaising minimum required CMake version to 2.8.12.2.
Chris Bieneman [Fri, 20 Feb 2015 21:28:18 +0000 (21:28 +0000)]
Raising minimum required CMake version to 2.8.12.2.

llvm-svn: 230062

9 years agoFix merging of << at end of input.
Jacques Pienaar [Fri, 20 Feb 2015 21:09:01 +0000 (21:09 +0000)]
Fix merging of << at end of input.

Commit of review http://reviews.llvm.org/D7766

llvm-svn: 230061

9 years agoAvoid a race condition when loading core files where the process might still be handl...
Greg Clayton [Fri, 20 Feb 2015 20:59:47 +0000 (20:59 +0000)]
Avoid a race condition when loading core files where the process might still be handling the eStateStopped event we post to the private state thread causing us to return from SBTarget::LoadCore() before the process is ready to have API calls used on it.

This fixes a crasher that could happen when loading core files from scripts.

llvm-svn: 230060

9 years agoGrab the DataLayout off of the TargetMachine since that's where
Eric Christopher [Fri, 20 Feb 2015 20:56:39 +0000 (20:56 +0000)]
Grab the DataLayout off of the TargetMachine since that's where
it's stored.

llvm-svn: 230059

9 years agoLoopRotate: When reconstructing loop simplify form don't split edges from indirectbrs.
Benjamin Kramer [Fri, 20 Feb 2015 20:49:25 +0000 (20:49 +0000)]
LoopRotate: When reconstructing loop simplify form don't split edges from indirectbrs.

Yet another chapter in the endless story. While this looks like we leave
the loop in a non-canonical state this replicates the logic in
LoopSimplify so it doesn't diverge from the canonical form in any way.

PR21968

llvm-svn: 230058

9 years agoIR: Change MDFile to directly store the filename/directory
Duncan P. N. Exon Smith [Fri, 20 Feb 2015 20:35:17 +0000 (20:35 +0000)]
IR: Change MDFile to directly store the filename/directory

In the old (well, current) schema, there are two types of file
references: untagged and tagged (the latter references the former).

    !0 = !{!"filename", !"/directory"}
    !1 = !{!"0x29", !1} ; DW_TAG_file_type [filename] [/directory]

The interface to `DIBuilder` universally takes the tagged version,
described by `DIFile`.  However, most `file:` references actually use
the untagged version directly.

In the new hierarchy, I'm merging this into a single node: `MDFile`.

Originally I'd planned to keep the old schema unchanged until after I
moved the new hierarchy into place.

However, it turns out to be trivial to make `MDFile` match both nodes at
the same time.

  - Anyone referencing !1 does so through `DIFile`, whose implementation
    I need to gut anyway (as I do the rest of the `DIDescriptor`s).
  - Anyone referencing !0 just references an `MDNode`, and expects a
    node with two `MDString` operands.

This commit achieves that, and updates all the testcases for the parts
of the new hierarchy that used the two-node schema (I've replaced the
untagged nodes with `distinct !{}` to make the diff clear (otherwise the
metadata all gets renumbered); it might be worthwhile to come back and
delete those nodes and renumber the world, not sure).

llvm-svn: 230057

9 years agoAdd test suite for the Control Flow Integrity feature.
Peter Collingbourne [Fri, 20 Feb 2015 20:31:18 +0000 (20:31 +0000)]
Add test suite for the Control Flow Integrity feature.

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

llvm-svn: 230056

9 years agoImplement Control Flow Integrity for virtual calls.
Peter Collingbourne [Fri, 20 Feb 2015 20:30:56 +0000 (20:30 +0000)]
Implement Control Flow Integrity for virtual calls.

This patch introduces the -fsanitize=cfi-vptr flag, which enables a control
flow integrity scheme that checks that virtual calls take place using a vptr of
the correct dynamic type. More details in the new docs/ControlFlowIntegrity.rst
file.

It also introduces the -fsanitize=cfi flag, which is currently a synonym for
-fsanitize=cfi-vptr, but will eventually cover all CFI checks implemented
in Clang.

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

llvm-svn: 230055

9 years agoIntroduce bitset metadata format and bitset lowering pass.
Peter Collingbourne [Fri, 20 Feb 2015 20:30:47 +0000 (20:30 +0000)]
Introduce bitset metadata format and bitset lowering pass.

This patch introduces a new mechanism that allows IR modules to co-operatively
build pointer sets corresponding to addresses within a given set of
globals. One particular use case for this is to allow a C++ program to
efficiently verify (at each call site) that a vtable pointer is in the set
of valid vtable pointers for the class or its derived classes. One way of
doing this is for a toolchain component to build, for each class, a bit set
that maps to the memory region allocated for the vtables, such that each 1
bit in the bit set maps to a valid vtable for that class, and lay out the
vtables next to each other, to minimize the total size of the bit sets.

The patch introduces a metadata format for representing pointer sets, an
'@llvm.bitset.test' intrinsic and an LTO lowering pass that lays out the globals
and builds the bitsets, and documents the new feature.

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

llvm-svn: 230054

9 years agoReversed revision 229706. The reason is regression, which is caused by the
Jozef Kolek [Fri, 20 Feb 2015 20:26:52 +0000 (20:26 +0000)]
Reversed revision 229706. The reason is regression, which is caused by the
usage of instruction ADDU16 by CodeGen. For this instruction an improper
register is allocated, i.e. the register that is not from register set defined
for the instruction.

llvm-svn: 230053

9 years agoRevert "Wrap clang module files in a Mach-O, ELF, or COFF container."
Adrian Prantl [Fri, 20 Feb 2015 20:00:27 +0000 (20:00 +0000)]
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."

This reverts commit r230044 while dealing with buildbot breakage.

Conflicts:
test/Modules/module_container.m

llvm-svn: 230052

9 years agoVerifier: Unused comdats might not have a corresponding GV
David Majnemer [Fri, 20 Feb 2015 19:58:48 +0000 (19:58 +0000)]
Verifier: Unused comdats might not have a corresponding GV

This fixes PR22646.

llvm-svn: 230051

9 years agoFix an asan use-after-free bug introduced by the asm printer
Eric Christopher [Fri, 20 Feb 2015 19:54:07 +0000 (19:54 +0000)]
Fix an asan use-after-free bug introduced by the asm printer
changes to remove non-Function based subtargets out of the asm
printer. For module level emission we'll need to construct up
an MCSubtargetInfo so that we can encode instructions for
emission.

llvm-svn: 230050

9 years agoAdd the new file to the CMakeLists. This should appease the Windows bot
Enrico Granata [Fri, 20 Feb 2015 19:54:06 +0000 (19:54 +0000)]
Add the new file to the CMakeLists. This should appease the Windows bot

llvm-svn: 230049

9 years agoRequire a target for this testacse.
Adrian Prantl [Fri, 20 Feb 2015 19:52:43 +0000 (19:52 +0000)]
Require a target for this testacse.

llvm-svn: 230048

9 years ago[GC, RewriteStatepointsForGC] Style cleanup and bug fix
Philip Reames [Fri, 20 Feb 2015 19:51:56 +0000 (19:51 +0000)]
[GC, RewriteStatepointsForGC] Style cleanup and bug fix

When doing style cleanup, I noticed a minor bug in this code.  If we have a pointer that we think is unused after a statepoint and thus doesn't need relocation, we store a null pointer into the alloca we're about to promote.  This helps turn a mistake in liveness analysis into an easily debuggable crash.  It turned out this code had never been updated to handle invoke statepoints.

There's no test for this.  Without a bug in liveness, it appears impossible to make this trigger in a way which is visible in the resulting IR.  We might store the null, but when promoting the alloca, there will be no uses and thus nothing to test against.  Suggestions on how to test are very welcome.

llvm-svn: 230047

9 years agoAdd an OptionValueLanguage class
Enrico Granata [Fri, 20 Feb 2015 19:46:30 +0000 (19:46 +0000)]
Add an OptionValueLanguage class

llvm-svn: 230046

9 years agoUse unreachable instead of assert(false) to silence MSVC warning
Reid Kleckner [Fri, 20 Feb 2015 19:46:02 +0000 (19:46 +0000)]
Use unreachable instead of assert(false) to silence MSVC warning

llvm-svn: 230045

9 years agoWrap clang module files in a Mach-O, ELF, or COFF container.
Adrian Prantl [Fri, 20 Feb 2015 19:44:52 +0000 (19:44 +0000)]
Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

llvm-svn: 230044

9 years ago[X86][FastIsel] Teach how to select float-half conversion intrinsics.
Andrea Di Biagio [Fri, 20 Feb 2015 19:37:14 +0000 (19:37 +0000)]
[X86][FastIsel] Teach how to select float-half conversion intrinsics.

This patch teaches X86FastISel how to select intrinsic 'convert_from_fp16' and
intrinsic 'convert_to_fp16'.
If the target has F16C, we can select VCVTPS2PHrr for a float-half conversion,
and VCVTPH2PSrr for a half-float conversion.

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

llvm-svn: 230043

9 years ago[GC] Style cleanup for RewriteStatepointForGC (1 of many) [NFC]
Philip Reames [Fri, 20 Feb 2015 19:26:04 +0000 (19:26 +0000)]
[GC] Style cleanup for RewriteStatepointForGC (1 of many) [NFC]

Starting to update variable naming and types to match LLVM style.  This will be an incremental process to minimize the chance of breakage as I work.  Step one, rename member variables to LLVM CamelCase and use llvm's ADT.  Much more to come.

llvm-svn: 230042

9 years agoSetting up CMake to default to Debug when no build type is specified.
Chris Bieneman [Fri, 20 Feb 2015 19:02:59 +0000 (19:02 +0000)]
Setting up CMake to default to Debug when no build type is specified.

Summary: Turns out if you don't set CMAKE_BUILD_TYPE the default is an empty string. This results in some of the behaviors of debug builds, but not all of them. For example ENABLE_ASSERTIONS is false.

Reviewers: rnk

Reviewed By: rnk

Subscribers: chapuni, llvm-commits

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

llvm-svn: 230041

9 years agoBugfix for 229954
Philip Reames [Fri, 20 Feb 2015 18:56:14 +0000 (18:56 +0000)]
Bugfix for 229954

Before calling Function::getGC to test for enablement, we need to make sure there's actually a GC at all via Function::hasGC.  Otherwise, we'd crash on functions without a GC.  Thankfully, this only mattered if you manually scheduled the pass, but still, oops. :(

llvm-svn: 230040

9 years agoRemove a use of the Subtarget in the darwin ppc asm printer.
Eric Christopher [Fri, 20 Feb 2015 18:53:42 +0000 (18:53 +0000)]
Remove a use of the Subtarget in the darwin ppc asm printer.
EmitFunctionStubs is called from doFinalization and so can't
depend on the Subtarget existing. It's also irrelevant as
we know we're darwin since we're in the darwin asm printer.

llvm-svn: 230039

9 years agoGet the function specific subtarget.
Eric Christopher [Fri, 20 Feb 2015 18:44:17 +0000 (18:44 +0000)]
Get the function specific subtarget.

llvm-svn: 230038

9 years agoGet the cached subtarget off the MachineFunction rather than
Eric Christopher [Fri, 20 Feb 2015 18:44:15 +0000 (18:44 +0000)]
Get the cached subtarget off the MachineFunction rather than
inquiring for a new one from the TargetMachine.

llvm-svn: 230037

9 years agoIntroduce FileSystem::CalculateMD5AsString that supports any platform and make existi...
Oleksiy Vyalov [Fri, 20 Feb 2015 18:34:03 +0000 (18:34 +0000)]
Introduce FileSystem::CalculateMD5AsString that supports any platform and make existing FileSystem::CalculateMD5 to use it.

http://reviews.llvm.org/D7771

llvm-svn: 230036

9 years agoTwo warning messages fixed.
Andrey Churbanov [Fri, 20 Feb 2015 18:19:41 +0000 (18:19 +0000)]
Two warning messages fixed.

llvm-svn: 230035

9 years agoMisprint in comment fixed
Andrey Churbanov [Fri, 20 Feb 2015 18:17:03 +0000 (18:17 +0000)]
Misprint in comment fixed

llvm-svn: 230034

9 years agoDetect Intel MIC architecture and set some defaults at run time instead of build...
Andrey Churbanov [Fri, 20 Feb 2015 18:14:43 +0000 (18:14 +0000)]
Detect Intel MIC architecture and set some defaults at run time instead of build time.

llvm-svn: 230033

9 years agoRemoved unused varargs from __kmpc_flush function.
Andrey Churbanov [Fri, 20 Feb 2015 18:09:27 +0000 (18:09 +0000)]
Removed unused varargs from __kmpc_flush function.

llvm-svn: 230032

9 years agoAdd -funique-section-names and -fno-unique-section-names options.
Rafael Espindola [Fri, 20 Feb 2015 18:08:57 +0000 (18:08 +0000)]
Add -funique-section-names and -fno-unique-section-names options.

For now -funique-section-names is the default, so no change in default behavior.

The total .o size in a build of llvm and clang goes from 241687775 to 230649031
bytes if -fno-unique-section-names is used.

llvm-svn: 230031

9 years agoAdded new user-guided lock api, currently disabled. Use KMP_USE_DYNAMIC_LOCK=1 to...
Andrey Churbanov [Fri, 20 Feb 2015 18:05:17 +0000 (18:05 +0000)]
Added new user-guided lock api, currently disabled. Use KMP_USE_DYNAMIC_LOCK=1 to enable it.

llvm-svn: 230030

9 years agoChanged default stack offset for threads on non-Mac architectures to a CACHE_LINE.
Andrey Churbanov [Fri, 20 Feb 2015 17:57:58 +0000 (17:57 +0000)]
Changed default stack offset for threads on non-Mac architectures to a CACHE_LINE.

llvm-svn: 230029

9 years agoMinor changes after r229901: move the CMICmdCmdStackSelectFrame to the end of header...
Ilia K [Fri, 20 Feb 2015 17:56:05 +0000 (17:56 +0000)]
Minor changes after r229901: move the CMICmdCmdStackSelectFrame to the end of header file

llvm-svn: 230028

9 years agoAdded some compiler flags for security on Linux and Mac link stages.
Andrey Churbanov [Fri, 20 Feb 2015 17:55:48 +0000 (17:55 +0000)]
Added some compiler flags for security on Linux and Mac link stages.

llvm-svn: 230027

9 years ago[Sanitizer] Refactor SuppressionContext class.
Alexey Samsonov [Fri, 20 Feb 2015 17:41:59 +0000 (17:41 +0000)]
[Sanitizer] Refactor SuppressionContext class.

SuppressionContext is no longer a singleton, shared by all sanitizers,
but a regular class. Each of ASan, LSan, UBSan and TSan now have their
own SuppressionContext, which only parses suppressions specific to
that sanitizer.

"suppressions" flag is moved away from common flags into tool-specific
flags, so the user now may pass
  ASAN_OPTIONS=suppressions=asan_supp.txt LSAN_OPIONS=suppressions=lsan_supp.txt
in a single invocation.

llvm-svn: 230026

9 years agoForgot to remove initialization of MiTestCaseBase.mydir in r230022
Ilia K [Fri, 20 Feb 2015 17:21:57 +0000 (17:21 +0000)]
Forgot to remove initialization of MiTestCaseBase.mydir in r230022

llvm-svn: 230025

9 years agocanonicalize a v2f64 blendi of 2 registers
Sanjay Patel [Fri, 20 Feb 2015 16:55:27 +0000 (16:55 +0000)]
canonicalize a v2f64 blendi of 2 registers

This canonicalization step saves us 3 pattern matching possibilities * 4 math ops
for scalar FP math that uses xmm regs. The backend can re-commute the operands
post-instruction-selection if that makes register allocation better.

The tests in llvm/test/CodeGen/X86/sse-scalar-fp-arith.ll cover this scenario already,
so there are no new tests with this patch.

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

llvm-svn: 230024

9 years agoPut MSVC back into the dumb compiler's corner.
Benjamin Kramer [Fri, 20 Feb 2015 16:35:42 +0000 (16:35 +0000)]
Put MSVC back into the dumb compiler's corner.

It fails to compile std::trivially_copyable for forward-declared enums.

llvm-svn: 230023

9 years agoRefactor lldb-mi tests
Ilia K [Fri, 20 Feb 2015 16:34:33 +0000 (16:34 +0000)]
Refactor lldb-mi tests

Summary:
This patch includes following changes:
* split lldb-mi tests into separate folders. It will make our life simpler because we can modify a test program of certain test and don't worry about other tests
* a bit refactoring
* fix comments
* improve some tests

Reviewers: emaste, clayborg, abidh

Reviewed By: clayborg, abidh

Subscribers: clayborg, lldb-commits, emaste, abidh

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

llvm-svn: 230022

9 years agoBase isPodLike on is_trivially_copyable for GCC 5 and MSVC
Benjamin Kramer [Fri, 20 Feb 2015 16:19:28 +0000 (16:19 +0000)]
Base isPodLike on is_trivially_copyable for GCC 5 and MSVC

It would be nice to get rid of the version checks here, but that will
have to wait until libstdc++ is upgraded to 5.0 everywhere ...

llvm-svn: 230021

9 years agoI incorrectly marked the VORC instruction as isCommutable when I added it.
Kit Barton [Fri, 20 Feb 2015 15:54:58 +0000 (15:54 +0000)]
I incorrectly marked the VORC instruction as isCommutable when I added it.
This fix removes the VORC instruction definition from the isCommutable block.

Phabricator review: http://reviews.llvm.org/D7772

llvm-svn: 230020

9 years ago[ASan] Make the argument of '__sanitizer_annotate_contiguous_container' is not aligne...
Timur Iskhodzhanov [Fri, 20 Feb 2015 15:45:51 +0000 (15:45 +0000)]
[ASan] Make the argument of '__sanitizer_annotate_contiguous_container' is not aligned error message easier to understand

llvm-svn: 230019

9 years ago[ASan/Win] Work around PR22545 - unregister globals when using the MD runtime
Timur Iskhodzhanov [Fri, 20 Feb 2015 15:34:16 +0000 (15:34 +0000)]
[ASan/Win] Work around PR22545 - unregister globals when using the MD runtime

llvm-svn: 230018

9 years agoGeneralize statepoint lowering to use ImmutableStatepoint. Move statepoint lowering...
Igor Laevsky [Fri, 20 Feb 2015 15:28:35 +0000 (15:28 +0000)]
Generalize statepoint lowering to use ImmutableStatepoint. Move statepoint lowering into a separate function 'LowerStatepoint' which uses ImmutableStatepoint instead of a CallInst. Also related utility functions are changed to receive ImmutableCallSite.

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

llvm-svn: 230017

9 years agoConstants.cpp: Only read 32 bits for float.
Benjamin Kramer [Fri, 20 Feb 2015 15:11:55 +0000 (15:11 +0000)]
Constants.cpp: Only read 32 bits for float.

Otherwise we'll discard the wrong half of a uint64_t on big-endian systems.

llvm-svn: 230016

9 years agoRemove redundant "explicit".
Rui Ueyama [Fri, 20 Feb 2015 14:57:04 +0000 (14:57 +0000)]
Remove redundant "explicit".

llvm-svn: 230015

9 years agoDeleted module-map-checker, as it's been folded into modularize.
John Thompson [Fri, 20 Feb 2015 14:28:10 +0000 (14:28 +0000)]
Deleted module-map-checker, as it's been folded into modularize.

llvm-svn: 230014

9 years agoConstants.cpp: getElementAsAPFloat(): Don't handle constant value via host's float...
NAKAMURA Takumi [Fri, 20 Feb 2015 14:24:49 +0000 (14:24 +0000)]
Constants.cpp: getElementAsAPFloat(): Don't handle constant value via host's float/double, just handle with APInt/APFloat.

x87 FPU didn't keep SNAN, but demoted to QNAN.

llvm-svn: 230013

9 years agoRewriteStatepointsForGC: Move details into anonymous namespaces. NFC.
Benjamin Kramer [Fri, 20 Feb 2015 14:00:58 +0000 (14:00 +0000)]
RewriteStatepointsForGC: Move details into anonymous namespaces. NFC.

While there reduce the number of duplicated std::map lookups.

llvm-svn: 230012

9 years agoclang-format: [js] Support template strings.
Daniel Jasper [Fri, 20 Feb 2015 13:47:38 +0000 (13:47 +0000)]
clang-format: [js] Support template strings.

Merge template strings (marked by backticks ``).
Do not format any contents of template strings.

Patch by Martin Probst. Thank you.

llvm-svn: 230011

9 years agoMake the static instance of None just const.
Benjamin Kramer [Fri, 20 Feb 2015 13:16:05 +0000 (13:16 +0000)]
Make the static instance of None just const.

This way there shouldn't be any unused variable warnings.

llvm-svn: 230010

9 years agoWrap recursive function only used in assert in #ifndef NDEBUG.
Benjamin Kramer [Fri, 20 Feb 2015 13:15:49 +0000 (13:15 +0000)]
Wrap recursive function only used in assert in #ifndef NDEBUG.

Avoids unused function warnings in Release builds.

llvm-svn: 230009

9 years agoAdd -symbol-list-lines command (MI)
Ilia K [Fri, 20 Feb 2015 13:07:41 +0000 (13:07 +0000)]
Add -symbol-list-lines command (MI)

Summary:
Add -symbol-list-lines command + test.

All test passed on OS X.

Reviewers: emaste, abidh, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh, emaste

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

llvm-svn: 230008

9 years ago[Mach-O] Remove redundant allocator
Jean-Daniel Dupas [Fri, 20 Feb 2015 11:57:06 +0000 (11:57 +0000)]
[Mach-O] Remove redundant allocator

llvm-svn: 230007

9 years agoAdd -fno-implicit-modules.
Manuel Klimek [Fri, 20 Feb 2015 11:44:41 +0000 (11:44 +0000)]
Add -fno-implicit-modules.

If this flag is set, we error out when a module build is required. This is
useful in environments where all required modules are passed via -fmodule-file.

llvm-svn: 230006

9 years agoRefactor OptionValue::SetValueFromCString to use llvm::StringRef
Pavel Labath [Fri, 20 Feb 2015 11:14:59 +0000 (11:14 +0000)]
Refactor OptionValue::SetValueFromCString to use llvm::StringRef

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 230005

9 years ago[x86] Switching the shuffle equivalence test to a variadic template was
Chandler Carruth [Fri, 20 Feb 2015 10:47:28 +0000 (10:47 +0000)]
[x86] Switching the shuffle equivalence test to a variadic template was
the wrong answer. We also got initializer lists which are *way* cleaner
for this kind of thing. Let's use those and make this a normal, boring
functionn accepting ArrayRef.

llvm-svn: 230004