Commit Graph

194360 Commits

Author SHA1 Message Date
Greg Clayton 18232f7ecc Fix the test so it runs correctly when there are spaces in the path to the stdc++ library.
<rdar://problem/19297312>

llvm-svn: 230102
2015-02-21 00:28:32 +00:00
Greg Clayton 7ab0d6f443 Fix this test case so it runs correctly.
<rdar://problem/19286788>

llvm-svn: 230101
2015-02-21 00:23:36 +00:00
Duncan P. N. Exon Smith 5f989abcd4 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
2015-02-21 00:18:40 +00:00
Adrian Prantl 6572faa1eb configure+make: Rearange clangCodeGen to come before clangAST.
Follow-up to r230089.

llvm-svn: 230099
2015-02-21 00:15:40 +00:00
Rafael Espindola 85d8509267 Set the datalayout in the gold plugin.
This fixes the gold tests after r230054.

llvm-svn: 230098
2015-02-21 00:13:15 +00:00
Philip Reames 0b1b387441 [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
2015-02-21 00:09:09 +00:00
Adrian Prantl a05c7f876b configure+make: Add ipo to the dependencies of libclang.
Follow-up to r230089.

llvm-svn: 230096
2015-02-21 00:04:15 +00:00
Duncan P. N. Exon Smith 96d21d6fa5 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
2015-02-20 23:49:24 +00:00
David Blaikie 82ad78771b 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
2015-02-20 23:44:24 +00:00
Matthias Braun 876e7172ee 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
2015-02-20 23:43:14 +00:00
Simon Atanasyan 162feb5f8e [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
2015-02-20 23:37:40 +00:00
Filipe Cabecinhas 0385152752 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
2015-02-20 23:35:19 +00:00
Adrian Prantl 6897e3e456 Adapt Makefile dependencies for the clang module format change in r230089.
llvm-svn: 230090
2015-02-20 23:35:07 +00:00
Adrian Prantl f2b0cd91eb 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
2015-02-20 23:34:26 +00:00
Philip Reames 1f3e5c195c 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
2015-02-20 23:32:03 +00:00
Rafael Espindola 9075f77064 Use short names for jumptable sections.
Also refactor code to remove some duplication.

llvm-svn: 230087
2015-02-20 23:28:28 +00:00
Rui Ueyama 0068408001 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
2015-02-20 23:22:36 +00:00
Zachary Turner 7b0871cc74 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
2015-02-20 23:21:21 +00:00
Philip Reames 1f017547bb [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
2015-02-20 23:16:52 +00:00
Zachary Turner d1b1136e0e [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
2015-02-20 23:05:57 +00:00
Siva Chandra 2da9cd26d6 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
2015-02-20 22:58:00 +00:00
Philip Reames e9c3b9bd46 [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
2015-02-20 22:48:20 +00:00
Enrico Granata d02d1e0a04 This should fix the Windows build
llvm-svn: 230080
2015-02-20 22:43:17 +00:00
Philip Reames d2b664642f [RewriteStatepointsForGC] Cleanup - replace std::vector usage [NFC]
Migrate std::vector usage to a combination of SmallVector and ArrayRef.

llvm-svn: 230079
2015-02-20 22:39:41 +00:00
Eric Christopher d4e723f2cf Used the cached subtarget off of the MachineFunction.
llvm-svn: 230078
2015-02-20 22:36:11 +00:00
Enrico Granata b38ef8c2b6 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
2015-02-20 22:20:30 +00:00
Greg Clayton b65c6299d4 Make sure things build for iOS after recent changes.
llvm-svn: 230076
2015-02-20 22:20:05 +00:00
Reid Kleckner 8142a08ce7 X86: Remove pre-2010 dead code in mergeSPUpdatesDown
llvm-svn: 230075
2015-02-20 22:13:25 +00:00
Simon Pilgrim b7875837c7 LowerScalarImmediateShift - Merged v16i8 and v32i8 shift lowering. NFC.
llvm-svn: 230074
2015-02-20 22:13:03 +00:00
Adrian Prantl 690b2f7746 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
2015-02-20 22:12:19 +00:00
Matt Arsenault 20711b7bae 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
2015-02-20 22:10:45 +00:00
Matt Arsenault 8d6300346f 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
2015-02-20 22:10:41 +00:00
Matt Arsenault 0dc54c4dee 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
2015-02-20 22:10:33 +00:00
Rui Ueyama 2c64aef35f 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
2015-02-20 22:10:28 +00:00
Philip Reames 860660ea5e [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
2015-02-20 22:05:18 +00:00
Adrian Prantl b59bc1a528 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
2015-02-20 21:53:12 +00:00
Greg Clayton 338d0bdc96 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
2015-02-20 21:51:06 +00:00
Enrico Granata 83a1437646 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
2015-02-20 21:48:38 +00:00
Ben Langmuir bc35fbe43a 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
2015-02-20 21:46:39 +00:00
Philip Reames 0a3240f4de [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
2015-02-20 21:34:11 +00:00
Chris Bieneman e88a396f86 Raising minimum required CMake version to 2.8.12.2.
llvm-svn: 230062
2015-02-20 21:28:18 +00:00
Jacques Pienaar 68a7dbf86d Fix merging of << at end of input.
Commit of review http://reviews.llvm.org/D7766

llvm-svn: 230061
2015-02-20 21:09:01 +00:00
Greg Clayton 35824e36f5 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
2015-02-20 20:59:47 +00:00
Eric Christopher 9ecaa174d6 Grab the DataLayout off of the TargetMachine since that's where
it's stored.

llvm-svn: 230059
2015-02-20 20:56:39 +00:00
Benjamin Kramer 911d5b3ace 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
2015-02-20 20:49:25 +00:00
Duncan P. N. Exon Smith a5c57ccf2d 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
2015-02-20 20:35:17 +00:00
Peter Collingbourne e0c4f7eb81 Add test suite for the Control Flow Integrity feature.
Differential Revision: http://reviews.llvm.org/D7738

llvm-svn: 230056
2015-02-20 20:31:18 +00:00
Peter Collingbourne a4ccff3281 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
2015-02-20 20:30:56 +00:00
Peter Collingbourne e6909c8e8b 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
2015-02-20 20:30:47 +00:00
Jozef Kolek 0365675522 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
2015-02-20 20:26:52 +00:00