Justin Bogner [Sat, 21 Feb 2015 20:53:36 +0000 (20:53 +0000)]
docs: Mention that assertions must be enabled to use the -stats flag
Patch by Rob Stewart. Thanks!
llvm-svn: 230144
Lang Hames [Sat, 21 Feb 2015 20:44:36 +0000 (20:44 +0000)]
[Orc] Move Orc code into a namespace (llvm::orc), update Kaleidoscope code.
NFC.
llvm-svn: 230143
Benjamin Kramer [Sat, 21 Feb 2015 17:08:08 +0000 (17:08 +0000)]
MachineInstr: Use range-based for loops. NFC.
llvm-svn: 230142
Benjamin Kramer [Sat, 21 Feb 2015 16:22:48 +0000 (16:22 +0000)]
Calling memmove on a MachineOperand is totally safe.
While it's not POD due to the user-defined constructor, it's still a trivially
copyable type. No functional change.
llvm-svn: 230141
Johannes Doerfert [Sat, 21 Feb 2015 16:18:28 +0000 (16:18 +0000)]
Remove leftover code
llvm-svn: 230140
Shankar Easwaran [Sat, 21 Feb 2015 15:51:54 +0000 (15:51 +0000)]
[ELF] Remove FIXME(s) that are already fixed.
FIXME code was left around in few places where its already been taken care of.
This removes the FIXME's that are not needed.
llvm-svn: 230139
Shankar Easwaran [Sat, 21 Feb 2015 15:49:34 +0000 (15:49 +0000)]
[ELF][Writer] Use Path to create AtomSection.
Now since the correct file path for atoms is available and not clobbered,
commit r222309 which was reverted previously can be added back.
No change in functionality.
llvm-svn: 230138
Benjamin Kramer [Sat, 21 Feb 2015 14:35:00 +0000 (14:35 +0000)]
Remove dead prototype.
llvm-svn: 230137
Benjamin Kramer [Sat, 21 Feb 2015 14:31:29 +0000 (14:31 +0000)]
X86: Remove custom lowering of SIGN_EXTEND_INREG
This was just replicating logic from the legalizer. Covered by existing
tests.
llvm-svn: 230136
Eric Christopher [Sat, 21 Feb 2015 09:09:15 +0000 (09:09 +0000)]
Unconditionally create a new MCInstrInfo in the asm printer for
asm parsing since it's not subtarget dependent and we can't depend
upon the one hanging off the MachineFunction's subtarget still
being around.
llvm-svn: 230135
Eric Christopher [Sat, 21 Feb 2015 08:48:23 +0000 (08:48 +0000)]
Remove obsolete comment.
llvm-svn: 230134
Eric Christopher [Sat, 21 Feb 2015 08:48:22 +0000 (08:48 +0000)]
Have the MipsAsmPrinter fp stub emission code take a custom
MCSubtargetInfo as the MachineFunction has gone away and we need
to emit code at the module level.
llvm-svn: 230133
Eric Christopher [Sat, 21 Feb 2015 08:32:38 +0000 (08:32 +0000)]
Turn an if+llvm_unreachable into an assert and reword comment.
llvm-svn: 230132
Eric Christopher [Sat, 21 Feb 2015 08:32:22 +0000 (08:32 +0000)]
Endianness can be gotten from the DataLayout which we already
have. Also, the subtarget is invalid at this point.
llvm-svn: 230131
Jason Molenda [Sat, 21 Feb 2015 06:13:51 +0000 (06:13 +0000)]
If constructed llvm_build_dir doesn't exist, retry as an iphoneos path.
llvm-svn: 230130
David Majnemer [Sat, 21 Feb 2015 05:49:45 +0000 (05:49 +0000)]
X86: Call __main using the SelectionDAG
Synthesizing a call directly using the MI layer would confuse the frame
lowering code. This is problematic as frame lowering is highly
sensitive the particularities of calls, etc.
llvm-svn: 230129
Zachary Turner [Sat, 21 Feb 2015 04:45:12 +0000 (04:45 +0000)]
Add missing #include. This should fix the Windows build.
llvm-svn: 230128
Shankar Easwaran [Sat, 21 Feb 2015 04:42:43 +0000 (04:42 +0000)]
[ELF] Fix References being ignored.
The ELFReader was skipping references for sections that contained relocations.
This fixes the bug.
llvm-svn: 230127
Chandler Carruth [Sat, 21 Feb 2015 04:31:13 +0000 (04:31 +0000)]
Update for Clang API change in r230123 -- lookup_result was always
const, there was never a need for lookup_const_result. Now that vestigal
type is gone, so switch LLDB to lookup_result and to use the
DeclContextLookupResult rather than the Const variant.
llvm-svn: 230126
Eric Fiselier [Sat, 21 Feb 2015 04:30:36 +0000 (04:30 +0000)]
Add temporary workaround for missing symbol __cxa_throw_bad_new_array_length on OS X.
llvm-svn: 230125
Shankar Easwaran [Sat, 21 Feb 2015 04:28:26 +0000 (04:28 +0000)]
[obj2yaml/yaml2obj] Add SHT_GROUP support.
This adds section group support to the tools obj2yaml and yaml2obj.
llvm-svn: 230124
Richard Smith [Sat, 21 Feb 2015 02:45:19 +0000 (02:45 +0000)]
Cleanup: remove artificial division between lookup results and const lookup
results. No-one was ever modifying a lookup result, and it would not be
reasonable to do so.
llvm-svn: 230123
Davide Italiano [Sat, 21 Feb 2015 02:36:54 +0000 (02:36 +0000)]
Small cleanup. Don't use else when not needed.
Pointed out by David Majnemer.
llvm-svn: 230122
Richard Smith [Sat, 21 Feb 2015 02:31:57 +0000 (02:31 +0000)]
Revert r167816 and replace it with a proper fix for the issue: do not
invalidate lookup_iterators and lookup_results for some name within a
DeclContext if the lookup results for a *different* name change.
llvm-svn: 230121
Eric Fiselier [Sat, 21 Feb 2015 02:30:41 +0000 (02:30 +0000)]
[libc++] Try and prevent evaluation of `is_default_constructible` on tuples default constructor if it is not needed.
Summary:
Currently parts of the SFINAE on tuples default constructor always gets evaluated even when the default constructor is never called or instantiated. This can cause a hard compile error when a tuple is created with types that do not have a default constructor. Below is a self contained example using a pair like class. This code will not compile but probably should.
```
#include <type_traits>
template <class T>
struct IllFormedDefaultImp {
IllFormedDefaultImp(T x) : value(x) {}
constexpr IllFormedDefaultImp() {}
T value;
};
typedef IllFormedDefaultImp<int &> IllFormedDefault;
template <class T, class U>
struct pair
{
template <bool Dummy = true,
class = typename std::enable_if<
std::is_default_constructible<T>::value
&& std::is_default_constructible<U>::value
&& Dummy>::type
>
constexpr pair() : first(), second() {}
pair(T const & t, U const & u) : first(t), second(u) {}
T first;
U second;
};
int main()
{
int x = 1;
IllFormedDefault v(x);
pair<IllFormedDefault, IllFormedDefault> p(v, v);
}
```
One way to fix this is to use `Dummy` in a more involved way in the constructor SFINAE. The following patch fixes these sorts of hard compile errors for tuple.
Reviewers: mclow.lists, rsmith, K-ballo, EricWF
Reviewed By: EricWF
Subscribers: ldionne, cfe-commits
Differential Revision: http://reviews.llvm.org/D7569
llvm-svn: 230120
Eric Fiselier [Sat, 21 Feb 2015 02:26:24 +0000 (02:26 +0000)]
[libcxx] Move to using libc++abi2.exp as the default symbol list for libc++
Summary:
libc++abi2.exp should be used whenever `cxxabi.h` defines `_LIBCPPABI_VERSION`. This macro was added to libc++abi in 2012 in r149632. For this reason we should use libc++abi2.exp as default unless otherwise specified.
Also when building against an in-tree libc++abi we definitely want to use libc++abi2.exp.
I would love to know what OSX was the last to use libc++abi.exp but I can only test on 10.9.
Reviewers: danalbert, mclow.lists, EricWF
Reviewed By: EricWF
Subscribers: meadori, cfe-commits
Differential Revision: http://reviews.llvm.org/D7773
llvm-svn: 230119
Tim Northover [Sat, 21 Feb 2015 02:11:17 +0000 (02:11 +0000)]
CodeGen: convert CCState interface to using ArrayRefs
Everyone except R600 was manually passing the length of a static array
at each callsite, calculated in a variety of interesting ways. Far
easier to let ArrayRef handle that.
There should be no functional change, but out of tree targets may have
to tweak their calls as with these examples.
llvm-svn: 230118
Peter Collingbourne [Sat, 21 Feb 2015 01:48:51 +0000 (01:48 +0000)]
Run simple-fail.cpp at -O{1,2,3}.
It's probably overkill to run the other tests at -O* given the increasing
combinatorial explosion.
llvm-svn: 230117
Peter Collingbourne [Sat, 21 Feb 2015 01:36:08 +0000 (01:36 +0000)]
CFI: Add tests for 32-bit, 64-bit and memory bitsets. Break optimization in more places.
llvm-svn: 230116
Hans Wennborg [Sat, 21 Feb 2015 01:07:24 +0000 (01:07 +0000)]
Improve diagnostic when failing to synthesize implicit member due to dllexport (PR22591)
This is only a problem in C++03 mode targeting MS ABI (MinGW doesn't
export inline methods, and C++11 marks these methods implicitly
deleted).
Since targeting the MS ABI in pre-C++11 mode is a rare configuration,
this will probably not get fixed, but we can at least have a better
error message.
llvm-svn: 230115
Larisse Voufo [Sat, 21 Feb 2015 01:05:29 +0000 (01:05 +0000)]
Fix typo.
llvm-svn: 230114
David Majnemer [Sat, 21 Feb 2015 01:04:47 +0000 (01:04 +0000)]
Win64: Stack alignment constraints aren't applied during SET_FPREG
Stack realignment occurs after the prolog, not during, for Win64.
Because of this, don't factor in the maximum stack alignment when
establishing a frame pointer.
This fixes PR22572.
llvm-svn: 230113
Larisse Voufo [Sat, 21 Feb 2015 01:03:48 +0000 (01:03 +0000)]
Move -fdefine-sized-deallocation and -fno-sized-deallocation options from driver into CC1 for now.
llvm-svn: 230112
Duncan P. N. Exon Smith [Sat, 21 Feb 2015 01:02:18 +0000 (01:02 +0000)]
AsmParser/Writer: Handle symbolic constants in DI 'flags:'
Parse (and write) symbolic constants in debug info `flags:` fields.
This prevents a readability (and CHECK-ability) regression with the new
debug info hierarchy.
Old (well, current) assembly, with pretty-printing:
!{!"...\\0016387", ...} ; ... [public] [rvalue reference]
Flags field without this change:
!MDDerivedType(flags: 16387, ...)
Flags field with this change:
!MDDerivedType(flags: DIFlagPublic | DIFlagRValueReference, ...)
As discussed in the review thread, this isn't a final state. Most of
these flags correspond to `DW_AT_` symbolic constants, and we might
eventually want to support arbitrary attributes in some form. However,
as it stands now, some of the flags correspond to other concepts (like
`FlagStaticMember`); until things are refactored this is the simplest
way to move forward without regressing assembly.
llvm-svn: 230111
Greg Clayton [Sat, 21 Feb 2015 00:57:59 +0000 (00:57 +0000)]
Add missing Xcode project files for MICmdCmdSymbol.cpp and MICmdCmdSymbol.h.
llvm-svn: 230110
Fariborz Jahanian [Sat, 21 Feb 2015 00:45:58 +0000 (00:45 +0000)]
[Objective-C]. Provide a new formatting kind, "os_trace" which
can take a "const char*" format but supports standard printf
and CF/NS types . rdar://
19904147
llvm-svn: 230109
Duncan P. N. Exon Smith [Sat, 21 Feb 2015 00:45:26 +0000 (00:45 +0000)]
IR: Add helper to split debug info flags bitfield
Split debug info 'flags' bitfield over a vector so the current flags can
be iterated over. This API (in combination with r230107) will be used
for assembly support for symbolic constants.
llvm-svn: 230108
Duncan P. N. Exon Smith [Sat, 21 Feb 2015 00:43:09 +0000 (00:43 +0000)]
IR: Add debug info flag string conversions
Add `DIDescriptor::getFlag(StringRef)` and
`DIDescriptor::getFlagString(unsigned)`. The latter only converts exact
matches; I'll add separate API for breaking the flags bitfield up into
parts.
llvm-svn: 230107
Greg Clayton [Sat, 21 Feb 2015 00:39:13 +0000 (00:39 +0000)]
Don't use:
#include <lldb/API/*>"
Please use:
#include "lldb/API/*"
llvm-svn: 230106
Duncan P. N. Exon Smith [Sat, 21 Feb 2015 00:37:53 +0000 (00:37 +0000)]
IR: Move DebugInfo Flag* definitions to .def file, NFC
This prepares for adding string support.
llvm-svn: 230105
Adrian Prantl [Sat, 21 Feb 2015 00:29:43 +0000 (00:29 +0000)]
Revert "Adapt Makefile dependencies for the clang module format change in r230089."
llvm-svn: 230104
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Enrico Granata [Fri, 20 Feb 2015 22:43:17 +0000 (22:43 +0000)]
This should fix the Windows build
llvm-svn: 230080
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
Eric Christopher [Fri, 20 Feb 2015 22:36:11 +0000 (22:36 +0000)]
Used the cached subtarget off of the MachineFunction.
llvm-svn: 230078
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
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
Reid Kleckner [Fri, 20 Feb 2015 22:13:25 +0000 (22:13 +0000)]
X86: Remove pre-2010 dead code in mergeSPUpdatesDown
llvm-svn: 230075
Simon Pilgrim [Fri, 20 Feb 2015 22:13:03 +0000 (22:13 +0000)]
LowerScalarImmediateShift - Merged v16i8 and v32i8 shift lowering. NFC.
llvm-svn: 230074
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Adrian Prantl [Fri, 20 Feb 2015 19:52:43 +0000 (19:52 +0000)]
Require a target for this testacse.
llvm-svn: 230048
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
Enrico Granata [Fri, 20 Feb 2015 19:46:30 +0000 (19:46 +0000)]
Add an OptionValueLanguage class
llvm-svn: 230046
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