platform/upstream/llvm.git
9 years agoRemove use of reserved identifiers in Twine
David Blaikie [Sun, 15 Mar 2015 03:17:28 +0000 (03:17 +0000)]
Remove use of reserved identifiers in Twine

llvm-svn: 232310

9 years agoRemove use of reserved identifier and some excess 'inline' usage
David Blaikie [Sun, 15 Mar 2015 03:11:26 +0000 (03:11 +0000)]
Remove use of reserved identifier and some excess 'inline' usage

llvm-svn: 232309

9 years agoRemove reserved identifier & some unnecessary 'inline'
David Blaikie [Sun, 15 Mar 2015 03:11:24 +0000 (03:11 +0000)]
Remove reserved identifier & some unnecessary 'inline'

llvm-svn: 232308

9 years agoRemove use of reserved identifier
David Blaikie [Sun, 15 Mar 2015 03:03:41 +0000 (03:03 +0000)]
Remove use of reserved identifier

& some unnecessary 'inline' keywords

llvm-svn: 232307

9 years ago[clang-tidy] Fix false positives in the misc-static-assert check http://llvm.org...
Alexander Kornienko [Sun, 15 Mar 2015 02:19:37 +0000 (02:19 +0000)]
[clang-tidy] Fix false positives in the misc-static-assert check llvm.org/PR22880

The misc-static-assert check will not warn on assert(false), assert(False),
assert(FALSE); where false / False / FALSE are macros expanding to the false or
0 literals.

Also added corresponding test cases.

http://reviews.llvm.org/D8328

Patch by Szabolcs Sipos!

llvm-svn: 232306

9 years ago[dsymutil] Add an way to iterate over a DebugMapObject symbols.
Frederic Riss [Sun, 15 Mar 2015 02:02:53 +0000 (02:02 +0000)]
[dsymutil] Add an way to iterate over a DebugMapObject symbols.

llvm-svn: 232305

9 years agoRemove use of unreserved identifier (_Self)
David Blaikie [Sun, 15 Mar 2015 01:42:28 +0000 (01:42 +0000)]
Remove use of unreserved identifier (_Self)

And some unnecessary inline keywords

llvm-svn: 232304

9 years agoRemove use of a reserved identifier
David Blaikie [Sun, 15 Mar 2015 01:40:42 +0000 (01:40 +0000)]
Remove use of a reserved identifier

(& some unnecessary 'inline' keywords, too)

llvm-svn: 232303

9 years agoRemove use of reserved identifier
David Blaikie [Sun, 15 Mar 2015 01:37:01 +0000 (01:37 +0000)]
Remove use of reserved identifier

The C++ standard reserves all identifiers starting with an underscore
followed by an uppercase letter for the implementation for any use.

llvm-svn: 232302

9 years agollvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdump
David Majnemer [Sun, 15 Mar 2015 01:30:58 +0000 (01:30 +0000)]
llvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdump

llvm-vtabledump has grown enough functionality not related to vtables
that it deserves a name which is more descriptive.

llvm-svn: 232301

9 years ago[dsymutil] Add function size to the debug map.
Frederic Riss [Sun, 15 Mar 2015 01:29:30 +0000 (01:29 +0000)]
[dsymutil] Add function size to the debug map.

The debug map embedded by ld64 in binaries conatins function sizes.
These sizes are less precise than the ones given by the debug information
(byte granularity vs linker atom granularity), but they might cover code
that is referenced in the line table but not in the DIE tree (that might
very well be a compiler bug that I need to investigate later).
Anyway, extracting that information is necessary to be able to mimic
dsymutil's behavior exactly.

llvm-svn: 232300

9 years agoDbgIntrinsicInst: Downcast to specialized MDNodes in accessors
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 01:23:20 +0000 (01:23 +0000)]
DbgIntrinsicInst: Downcast to specialized MDNodes in accessors

Change accessors to downcast to `MDLocalVariable` and `MDExpression`,
now that we have -verify checks in place to confirm that it's safe.

llvm-svn: 232299

9 years agoRemove some unnecessary 'inline' keywords
David Blaikie [Sun, 15 Mar 2015 01:21:37 +0000 (01:21 +0000)]
Remove some unnecessary 'inline' keywords

llvm-svn: 232298

9 years agoIntervalIterator: Add move semantics rather than relying on broken implicit copy...
David Blaikie [Sun, 15 Mar 2015 01:21:34 +0000 (01:21 +0000)]
IntervalIterator: Add move semantics rather than relying on broken implicit copy ctor (found with -Wdeprecated)

We were just getting lucky because the copy ctor would be elided by RVO.

llvm-svn: 232297

9 years agoVerifier: Check debug info intrinsic arguments
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 01:21:30 +0000 (01:21 +0000)]
Verifier: Check debug info intrinsic arguments

Verify that debug info intrinsic arguments are valid.  (These checks
will not recurse through the full debug info graph, so they don't need
to be cordoned of in `DebugInfoVerifier`.)

With those checks in place, changing the `DbgIntrinsicInst` accessors to
downcast to `MDLocalVariable` and `MDExpression` is natural (added isa
specializations in `Metadata.h` to support this).

Added tests to `test/Verifier` for the new -verify checks, and fixed the
debug info in all the in-tree tests.

If you have out-of-tree testcases that have started to fail to -verify,
hopefully the verify checks are helpful.  The most likely problem is
that the expression argument is `!{}` (instead of `!MDExpression()`).

llvm-svn: 232296

9 years ago-Wempty-body: fix false negative triggered by macros
Dmitri Gribenko [Sun, 15 Mar 2015 01:08:23 +0000 (01:08 +0000)]
-Wempty-body: fix false negative triggered by macros

When if statement condition ended in a macro:

    if (ptr == NULL);

the check used to consider the definition location of NULL, instead of the
current line.

Patch by Manasij Mukherjee.

llvm-svn: 232295

9 years ago[opaque pointer type] IRBuilder gep migration progress
David Blaikie [Sun, 15 Mar 2015 01:03:19 +0000 (01:03 +0000)]
[opaque pointer type] IRBuilder gep migration progress

llvm-svn: 232294

9 years agoMade CFLAA agree with clang-format. NFC.
George Burgess IV [Sun, 15 Mar 2015 00:52:21 +0000 (00:52 +0000)]
Made CFLAA agree with clang-format. NFC.

So everyone's lives are easier in the future

llvm-svn: 232293

9 years agoVerifier: Remove unnecessary null check
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 00:50:57 +0000 (00:50 +0000)]
Verifier: Remove unnecessary null check

This is already assumed to be non-null above due to a dyn_cast<>.  Also
remove extraneous braces around statement.

llvm-svn: 232292

9 years agoVerifier: Make the raw_ostream constructor argument required
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 00:46:57 +0000 (00:46 +0000)]
Verifier: Make the raw_ostream constructor argument required

This was passed inconsistently; seems clearer to make it required anyway.

llvm-svn: 232291

9 years agoAssembler: Rewrite test for function-local metadata
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 00:45:51 +0000 (00:45 +0000)]
Assembler: Rewrite test for function-local metadata

This test for function-local metadata did strange things, and never
really sent in valid arguments for `llvm.dbg.declare` and
`llvm.dbg.value` intrinsics.  Those that might have once been valid have
bitrotted.

Rewrite it to be a targeted test for function-local metadata --
unrelated to debug info, which is tested elsewhere -- and rename it to
better match other metadata-related tests.

(Note: the scope of function-local metadata changed drastically during
the metadata/value split, but I didn't properly clean up this testcase.
Most of the IR in this file, while invalid for debug info intrinsics,
used to provide coverage for various (now illegal) forms of
function-local metadata.)

llvm-svn: 232290

9 years agoMS ABI: Tidy up references to the ASTContext
David Majnemer [Sat, 14 Mar 2015 23:44:48 +0000 (23:44 +0000)]
MS ABI: Tidy up references to the ASTContext

CGCXXABI has a handy getContext() method.  Use that instead of
explicitly going through the CodeGenModule.

llvm-svn: 232289

9 years agoFix a bug related to arg escaping, and add unit tests.
Zachary Turner [Sat, 14 Mar 2015 23:39:42 +0000 (23:39 +0000)]
Fix a bug related to arg escaping, and add unit tests.

A recent refactor had introduced a bug where if you escaped a
character, the rest of the string would get processed incorrectly.

This patch fixes that bug and adds some unit tests for Args.

llvm-svn: 232288

9 years ago[CMake] Make the unittests link against everything...
Zachary Turner [Sat, 14 Mar 2015 23:39:28 +0000 (23:39 +0000)]
[CMake] Make the unittests link against everything...

Sigh.  There's really not a good alternative until we decouple
python from lldb better.  The only way the build works right now
is by having every executable link against every LLDB library.
This causes implicit transitive link dependencies on the union
of everything that LLDB brings in.  Which means that if all we
want is one header file from interpreter, we have to bring in
everything, including everything that everything depends on,
which means python.

There's outstanding efforts to address this, but it's not yet
complete.  So until then, this is all we can do.

llvm-svn: 232287

9 years agoSimplified some stack folding tests.
Simon Pilgrim [Sat, 14 Mar 2015 23:16:43 +0000 (23:16 +0000)]
Simplified some stack folding tests.

Replaced explicit pmovzx* intrinsic tests with general shuffles

llvm-svn: 232286

9 years agoCodeGen: Correctly initialize bitfields with non-constant initializers
David Majnemer [Sat, 14 Mar 2015 22:24:38 +0000 (22:24 +0000)]
CodeGen: Correctly initialize bitfields with non-constant initializers

It is possible to construct an initializer for a bitfield which is not
constant.  Instead of emitting code to initialize the field before the
execution of main, clang would crash.

llvm-svn: 232285

9 years agoUpdate InstCombine to transform aggregate stores into scalar stores.
Mehdi Amini [Sat, 14 Mar 2015 22:19:33 +0000 (22:19 +0000)]
Update InstCombine to transform aggregate stores into scalar stores.

Summary: This is a first step toward getting proper support for aggregate loads and stores.

Test Plan: Added unittests

Reviewers: reames, chandlerc

Reviewed By: chandlerc

Subscribers: majnemer, joker.eph, chandlerc, llvm-commits

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

Patch by Amaury Sechet

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

9 years agoUpdate LangRef now that a DataLayout is mandatory.
Mehdi Amini [Sat, 14 Mar 2015 22:04:06 +0000 (22:04 +0000)]
Update LangRef now that a DataLayout is mandatory.

Reviewers: rafael, echristo

Reviewed By: rafael

Subscribers: rafael, llvm-commits

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

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

9 years agoUse setVisibility() rather than assigning the value directly.
Davide Italiano [Sat, 14 Mar 2015 21:57:15 +0000 (21:57 +0000)]
Use setVisibility() rather than assigning the value directly.
We don't want to risk to override wrong st_other bits, and when
we need to zero, we can do that explictly.

llvm-svn: 232282

9 years agoAdd some missed formatting
David Blaikie [Sat, 14 Mar 2015 21:40:12 +0000 (21:40 +0000)]
Add some missed formatting

llvm-svn: 232281

9 years ago[opaque pointer type] gep API migration
David Blaikie [Sat, 14 Mar 2015 21:40:10 +0000 (21:40 +0000)]
[opaque pointer type] gep API migration

This concludes the GetElementPtrInst::Create migration, thus marking the
beginning of the IRBuilder::CreateGEP* migration to come.

llvm-svn: 232280

9 years ago[opaque pointer type] gep API migration
David Blaikie [Sat, 14 Mar 2015 21:20:51 +0000 (21:20 +0000)]
[opaque pointer type] gep API migration

llvm-svn: 232279

9 years agoA few minor updates based on feedback from Justin and a few things I thought were...
Chris Bieneman [Sat, 14 Mar 2015 21:20:32 +0000 (21:20 +0000)]
A few minor updates based on feedback from Justin and a few things I thought were missing.

* Moved autotools configure & build example out of "Getting Started Quickly (A Summary)" and into BuildingLLVMWithAutoTools.
* Removed the annotations that CMake is the recommended process and Autotools is alternate.
* Added brief documentation about build targets under "Getting Started Quickly..."
* Added Overview text to BuildingLLVMWithAutotools
* Fixed up a broken link.

llvm-svn: 232278

9 years ago[opaque pointer type] gep API migration, ArgPromo
David Blaikie [Sat, 14 Mar 2015 21:11:26 +0000 (21:11 +0000)]
[opaque pointer type] gep API migration, ArgPromo

This involved threading the type-to-gep through a data structure, since
the code was relying on the pointer type to carry this information. I
imagine there will be a lot of this work across the project... slow
work chasing each use case, but the assertions will help keep me honest.

llvm-svn: 232277

9 years ago[opaque pointer type] more gep API migrations (AsmParser)
David Blaikie [Sat, 14 Mar 2015 21:11:24 +0000 (21:11 +0000)]
[opaque pointer type] more gep API migrations (AsmParser)

llvm-svn: 232276

9 years agoIR: Make Metadata::print() reliable and useful
Duncan P. N. Exon Smith [Sat, 14 Mar 2015 20:19:36 +0000 (20:19 +0000)]
IR: Make Metadata::print() reliable and useful

Replumb the `AsmWriter` so that `Metadata::print()` is generally useful.
(Similarly change `Metadata::printAsOperand()`.)

- `SlotTracker` now has a mode where all metadata will be correctly
  numbered when initializing a `Module`.  Normally, `Metadata` only
  referenced from within `Function`s gets numbered when the `Function`
  is incorporated.
- `Metadata::print()` and `Metadata::printAsOperand()` (and
  `Metadata::dump()`) now take an optional `Module` argument.  When
  provided, `SlotTracker` is initialized with the new mode, and the
  numbering will be complete and consistent for all calls to `print()`.
- `Value::print()` uses the new `SlotTracker` mode when printing
  intrinsics with `MDNode` operands, `MetadataAsValue` operands, or the
  bodies of functions.  Thus, metadata numbering will be consistent
  between calls to `Metadata::print()` and `Value::print()`.
- `Metadata::print()` (and `Metadata::dump()`) now print the full
  definition of `MDNode`s:

    !5 = !{!6, !"abc", !7}

  This matches behaviour for `Value::print()`, which includes the name
  of instructions.
- Updated call sites in `Verifier` to call `print()` instead of
  `printAsOperand()`.

All this, so that `Verifier` can print out useful failure messages that
involve `Metadata` for PR22777.

Note that `Metadata::printAsOperand()` previously took an optional
`bool` and `Module` operand.  The former was cargo-culted from
`Value::printAsOperand()` and wasn't doing anything useful.  The latter
didn't give consistent results (without the new `SlotTracker` mode).

llvm-svn: 232275

9 years ago[opaque pointer type] more gep API migration
David Blaikie [Sat, 14 Mar 2015 19:53:33 +0000 (19:53 +0000)]
[opaque pointer type] more gep API migration

llvm-svn: 232274

9 years agoAsmWriter: Split out SlotTracker::processInstructionMetadata(), NFC
Duncan P. N. Exon Smith [Sat, 14 Mar 2015 19:48:31 +0000 (19:48 +0000)]
AsmWriter: Split out SlotTracker::processInstructionMetadata(), NFC

llvm-svn: 232273

9 years agoAsmWriter: Use range-based for, NFC
Duncan P. N. Exon Smith [Sat, 14 Mar 2015 19:44:01 +0000 (19:44 +0000)]
AsmWriter: Use range-based for, NFC

llvm-svn: 232272

9 years agoRevert "[ELF] Change few static functions."
Shankar Easwaran [Sat, 14 Mar 2015 19:41:24 +0000 (19:41 +0000)]
Revert "[ELF] Change few static functions."

This reverts commit r232253.

Fix comments from dblaikie. Since these functions dont access member state, its ok to be static.

llvm-svn: 232271

9 years ago[opaque pointer type] more gep API migrations
David Blaikie [Sat, 14 Mar 2015 19:24:04 +0000 (19:24 +0000)]
[opaque pointer type] more gep API migrations

Adding nullptr to all the IRBuilder stuff because it's the first thing
that fails to build when testing without the back-compat functions, so
I'll keep having to re-add these locally for each chunk of migration I
do. Might as well check them in to save me the churn. Eventually I'll
have to migrate these too, but I'm going breadth-first.

llvm-svn: 232270

9 years agoNo need to prototype RtlCaptureContext with mingw-w64.
Yaron Keren [Sat, 14 Mar 2015 19:20:56 +0000 (19:20 +0000)]
No need to prototype RtlCaptureContext with mingw-w64.

llvm-svn: 232269

9 years agoRecover the ability to 'b CheckFailed' after r231577
Duncan P. N. Exon Smith [Sat, 14 Mar 2015 16:47:37 +0000 (16:47 +0000)]
Recover the ability to 'b CheckFailed' after r231577

Given that the stated purpose of `CheckFailed()` is to provide a nice
spot for a breakpoint, it'd be nice not to have to use a regex to break
on it.  Recover the ability to simply use `b CheckFailed` by
specializing the message-only version, and by changing the variadic
version to call into the message-only version.

llvm-svn: 232268

9 years ago[dsymutil] Add support for debug_loc section.
Frederic Riss [Sat, 14 Mar 2015 15:49:07 +0000 (15:49 +0000)]
[dsymutil] Add support for debug_loc section.

There is no need to look into the location expressions to transfer them,
the only modification to apply is to patch their base address to reflect
the linked function address.

llvm-svn: 232267

9 years agoarray_pod_sort: Since we're checking the length anyways also ignore one-element ranges
Benjamin Kramer [Sat, 14 Mar 2015 14:53:14 +0000 (14:53 +0000)]
array_pod_sort: Since we're checking the length anyways also ignore one-element ranges

Sorting them is obviously a noop and we can skip the libc call. This is
surprisingly common in clang. NFC.

llvm-svn: 232265

9 years agoSort ObjCProtocolDecls with array_pod_sort.
Benjamin Kramer [Sat, 14 Mar 2015 13:32:49 +0000 (13:32 +0000)]
Sort ObjCProtocolDecls with array_pod_sort.

The predicate is essentially a string comparison. NFC.

llvm-svn: 232264

9 years ago[analyzer] Sort path diagnostics with array_pod_sort.
Benjamin Kramer [Sat, 14 Mar 2015 12:39:22 +0000 (12:39 +0000)]
[analyzer] Sort path diagnostics with array_pod_sort.

They're expensive to compare and we won't sort many of them so std::sort
doesn't give any benefits and causes code bloat. Func fact: clang -O3 didn't
even bother to inline libc++'s std::sort here.

While there validate the predicate a bit harder, the sort is unstable and we
don't want to introduce any non-determinism. I had to spell out the function
pointer type because GCC 4.7 still fails to convert the lambda to a function
pointer :(

No intended functionality change.

llvm-svn: 232263

9 years ago[MachineLICM] First steps of sinking GEPs near calls.
Daniel Jasper [Sat, 14 Mar 2015 10:58:38 +0000 (10:58 +0000)]
[MachineLICM] First steps of sinking GEPs near calls.

Specifically, if there are copy-like instructions in the loop header
they are moved into the loop close to their uses. This reduces the live
intervals of the values and can avoid register spills.

This is working towards a fix for http://llvm.org/PR22230.
Review: http://reviews.llvm.org/D7259

Next steps:
- Find a better cost model (which non-copy instructions should be sunk?)
- Make this dependent on register pressure

llvm-svn: 232262

9 years ago[ELF] Ability to resolve undefined symbols lazily
Denis Protivensky [Sat, 14 Mar 2015 10:34:43 +0000 (10:34 +0000)]
[ELF] Ability to resolve undefined symbols lazily

Handle resolution of symbols coming from linked object files lazily.
Add implementation of handling _GLOBAL_OFFSET_TABLE_ and __exidx_start/_end symbols for ARM platform.

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

llvm-svn: 232261

9 years ago[mips] Remove trivial header for the MipsModuleISelDAGToDAG pass. NFC.
Vasileios Kalintiris [Sat, 14 Mar 2015 09:20:52 +0000 (09:20 +0000)]
[mips] Remove trivial header for the MipsModuleISelDAGToDAG pass. NFC.

llvm-svn: 232260

9 years ago[mips] Remove trivial header for the Mips16HardFloat pass. NFC.
Vasileios Kalintiris [Sat, 14 Mar 2015 09:02:23 +0000 (09:02 +0000)]
[mips] Remove trivial header for the Mips16HardFloat pass. NFC.

llvm-svn: 232259

9 years ago[mips] Remove trivial header for the MipsOs16 pass. NFC.
Vasileios Kalintiris [Sat, 14 Mar 2015 08:34:25 +0000 (08:34 +0000)]
[mips] Remove trivial header for the MipsOs16 pass. NFC.

llvm-svn: 232258

9 years agoStrip trailing whitespace from python-wrapper.swig
Ed Maste [Sat, 14 Mar 2015 08:06:56 +0000 (08:06 +0000)]
Strip trailing whitespace from python-wrapper.swig

(To test the dependency added in r232256.)

llvm-svn: 232257

9 years agoMake LLDBWrapPython.cpp depend on the .swig files (configure+make build)
Ed Maste [Sat, 14 Mar 2015 07:58:06 +0000 (07:58 +0000)]
Make LLDBWrapPython.cpp depend on the .swig files (configure+make build)

This is equivalent to r232175 for the CMake build.

llvm-svn: 232256

9 years agoMS ABI: Mangle virtual member pointer thunks with the correct CC
David Majnemer [Sat, 14 Mar 2015 06:34:41 +0000 (06:34 +0000)]
MS ABI: Mangle virtual member pointer thunks with the correct CC

Virtual member pointers are implemented using a thunk.  We assumed that
the calling convention for this thunk was always __thiscall for 32-bit
targets and __cdecl for 64-bit targets.  However, this is not the case.
Mangle in whichever calling convention is appropriate for this member
function thunk.

llvm-svn: 232254

9 years ago[ELF] Change few static functions.
Shankar Easwaran [Sat, 14 Mar 2015 05:27:01 +0000 (05:27 +0000)]
[ELF] Change few static functions.

Functions hasOutputSegment/maybeGetSOName doesnot need not be static.

llvm-svn: 232253

9 years ago[ELF] Rename .got.dyn to .got
Shankar Easwaran [Sat, 14 Mar 2015 05:26:58 +0000 (05:26 +0000)]
[ELF] Rename .got.dyn to .got

Gnu doesnot creates only a .got section.

llvm-svn: 232252

9 years ago[ELF] Fix DenseMapInfo for StringRef
Shankar Easwaran [Sat, 14 Mar 2015 05:26:55 +0000 (05:26 +0000)]
[ELF] Fix DenseMapInfo for StringRef

llvm-svn: 232251

9 years ago[ELF] Remove ambiguity
Shankar Easwaran [Sat, 14 Mar 2015 05:26:53 +0000 (05:26 +0000)]
[ELF] Remove ambiguity

Fix ambiguous finalize function.

llvm-svn: 232250

9 years ago[ELF] Simplify appending chunks to segments.
Shankar Easwaran [Sat, 14 Mar 2015 05:26:50 +0000 (05:26 +0000)]
[ELF] Simplify appending chunks to segments.

The Segment Chunk had two functions one to append a section and one to append a
chunk. A section is a subclass of a chunk and clearly this can be merged into
one single function.

llvm-svn: 232249

9 years ago[modules] Teach the AST reader to handle the case of importing a module
Chandler Carruth [Sat, 14 Mar 2015 04:47:43 +0000 (04:47 +0000)]
[modules] Teach the AST reader to handle the case of importing a module
with a subset of the existing target CPU features or mismatched CPU
names.

While we can't check that the CPU name used to build the module will end
up being able to codegen correctly for the translation unit, we actually
check that the imported features are a subset of the existing features.

While here, rewrite the code to use std::set_difference and have it
diagnose all of the differences found.

Test case added which walks the set relationships and ensures we
diagnose all the right cases and accept the others.

No functional change for implicit modules here, just better diagnostics.

llvm-svn: 232248

9 years ago[gtest] Fix gtest failures on Windows.
Zachary Turner [Sat, 14 Mar 2015 04:19:32 +0000 (04:19 +0000)]
[gtest] Fix gtest failures on Windows.

On Windows, you need to call WSAStartup() before making any socket
calls, and WSACleanup() before you shutdown.  This wasn't being
done, so all of the socket tests were failing.  This fixes
that, which brings the unit test suite to a fully working state
on Windows.

llvm-svn: 232247

9 years ago[dsymutil] Generate debug_aranges section.
Frederic Riss [Sat, 14 Mar 2015 03:46:51 +0000 (03:46 +0000)]
[dsymutil] Generate debug_aranges section.

This actually shares most of its implementation with the  generation
of the debug_ranges (the absence of 'a' is not a typo) contribution
for the unit's DW_AT_ranges attribute.

llvm-svn: 232246

9 years ago[dsymutil] Identify each CompileUnit with a unique ID.
Frederic Riss [Sat, 14 Mar 2015 03:46:40 +0000 (03:46 +0000)]
[dsymutil] Identify each CompileUnit with a unique ID.

The ID can eg. de used in MCSymbol names to differentiate the ones
that need to be created for every unit.
The ID is a constructor parameter and not a static class member so
there is no issue with counter updates if we decide to thread that
code.

llvm-svn: 232245

9 years ago[CMake] Convert TABs to spaces.
Zachary Turner [Sat, 14 Mar 2015 03:10:51 +0000 (03:10 +0000)]
[CMake] Convert TABs to spaces.

This file had been using TAB all along, but my recent change that
used spaces exposed the issue.

llvm-svn: 232244

9 years agoSkip additional lldb-mi tests that failed on FreeBSD
Ed Maste [Sat, 14 Mar 2015 02:54:57 +0000 (02:54 +0000)]
Skip additional lldb-mi tests that failed on FreeBSD

llvm-svn: 232243

9 years agoCFI: Add test for bad cast checks.
Peter Collingbourne [Sat, 14 Mar 2015 02:42:39 +0000 (02:42 +0000)]
CFI: Add test for bad cast checks.

llvm-svn: 232242

9 years agoImplement bad cast checks using control flow integrity information.
Peter Collingbourne [Sat, 14 Mar 2015 02:42:25 +0000 (02:42 +0000)]
Implement bad cast checks using control flow integrity information.

This scheme checks that pointer and lvalue casts are made to an object of
the correct dynamic type; that is, the dynamic type of the object must be
a derived class of the pointee type of the cast. The checks are currently
only introduced where the class being casted to is a polymorphic class.

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

llvm-svn: 232241

9 years ago[opaque pointer type] Start migrating GEP creation to explicitly specify the pointee...
David Blaikie [Sat, 14 Mar 2015 01:53:18 +0000 (01:53 +0000)]
[opaque pointer type] Start migrating GEP creation to explicitly specify the pointee type

I'm just going to migrate these in a pretty ad-hoc & incremental way -
providing the backwards compatible API for now, then locally removing
it, fixing a few callers, adding it back in and commiting those callers.
Rinse, repeat.

The assertions should ensure that if I get this wrong we'll find out
about it and not just have one giant patch to revert, recommit, revert,
recommit, etc.

llvm-svn: 232240

9 years agoAdd a bunch of CHECK missing colons in tests. NFC.
Ahmed Bougacha [Sat, 14 Mar 2015 01:43:57 +0000 (01:43 +0000)]
Add a bunch of CHECK missing colons in tests.  NFC.

Some wouldn't pass;  fixed most, the rest will be fixed separately.

llvm-svn: 232239

9 years agoCFI: Add a test for distinguishing between non-overriding siblings.
Peter Collingbourne [Sat, 14 Mar 2015 01:35:33 +0000 (01:35 +0000)]
CFI: Add a test for distinguishing between non-overriding siblings.

llvm-svn: 232238

9 years agoAdd a bunch of missing "CHECK" colons in tests. NFC.
Ahmed Bougacha [Sat, 14 Mar 2015 01:10:19 +0000 (01:10 +0000)]
Add a bunch of missing "CHECK" colons in tests.  NFC.

llvm-svn: 232237

9 years agoCommandLine: Replace cold std::sort with array_pod_sort.
Benjamin Kramer [Sat, 14 Mar 2015 00:20:13 +0000 (00:20 +0000)]
CommandLine: Replace cold std::sort with array_pod_sort.

Also replace an old use of qsort with it. Compiles down to the same thing but
gives us some type safety. Safes a couple of kb on CommandLine.o.

NFC.

llvm-svn: 232236

9 years agoLowerBitSets: Do not export symbols for bit set referenced globals on Darwin.
Peter Collingbourne [Sat, 14 Mar 2015 00:00:49 +0000 (00:00 +0000)]
LowerBitSets: Do not export symbols for bit set referenced globals on Darwin.

The linker on that platform may re-order symbols or strip dead symbols, which
will break bit set checks. Avoid this by hiding the symbols from the linker.

llvm-svn: 232235

9 years ago[dsymutil] Fix typo in comment.
Frederic Riss [Fri, 13 Mar 2015 23:55:29 +0000 (23:55 +0000)]
[dsymutil] Fix typo in comment.

Next time, when I fix a typo, I'll take the time to reread the whole
comment instead of waiting for the commit email to realize that there
is another one two words later...

llvm-svn: 232234

9 years ago[dsymutil] Fix typo in doxygen comment.
Frederic Riss [Fri, 13 Mar 2015 23:51:06 +0000 (23:51 +0000)]
[dsymutil] Fix typo in doxygen comment.

llvm-svn: 232233

9 years ago[dsymutil] Implement DW_AT_ranges linking.
Frederic Riss [Fri, 13 Mar 2015 23:30:31 +0000 (23:30 +0000)]
[dsymutil] Implement DW_AT_ranges linking.

Nothing fancy, just a straightforward offset to apply to the original
debug_ranges entries to get them in line with the linked addresses.

llvm-svn: 232232

9 years ago[dsymutil] Move a function declaration closer to its peers.
Frederic Riss [Fri, 13 Mar 2015 23:30:27 +0000 (23:30 +0000)]
[dsymutil] Move a function declaration closer to its peers.

llvm-svn: 232231

9 years agoDWARFDebugRangeList: make the list of entries available to clients.
Frederic Riss [Fri, 13 Mar 2015 23:30:07 +0000 (23:30 +0000)]
DWARFDebugRangeList: make the list of entries available to clients.

For users like llvm-dsymutil that want to have access to the encoded
debug_ranges entries.

llvm-svn: 232230

9 years agoMS ABI: Generate default constructor closures
David Majnemer [Fri, 13 Mar 2015 22:36:55 +0000 (22:36 +0000)]
MS ABI: Generate default constructor closures

The MS ABI utilizes a compiler generated function called the "vector
constructor iterator" to construct arrays of objects with
non-trivial constructors/destructors.  For this to work, the constructor
must follow a specific calling convention.  A thunk must be created if
the default constructor has default arguments, is variadic or is
otherwise incompatible.  This thunk is called the default constructor
closure.

N.B.  Default constructor closures are only generated if the default
constructor is exported because clang itself does not utilize vector
constructor iterators.  Failing to export the default constructor
closure will result in link/load failure if a translation unit compiled
with MSVC is on the import side.

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

llvm-svn: 232229

9 years agoIf creating a Python command via a class, the help text is handled directly by the...
Enrico Granata [Fri, 13 Mar 2015 22:35:44 +0000 (22:35 +0000)]
If creating a Python command via a class, the help text is handled directly by the class object, no need for setting it manually via the cmdline

llvm-svn: 232228

9 years agoRevert test/Makefile to state before r232205
Vince Harron [Fri, 13 Mar 2015 22:33:42 +0000 (22:33 +0000)]
Revert test/Makefile to state before r232205

llvm-svn: 232227

9 years agoAdd accessors on SBCommand to get and set the help texts for a command
Enrico Granata [Fri, 13 Mar 2015 22:32:11 +0000 (22:32 +0000)]
Add accessors on SBCommand to get and set the help texts for a command

llvm-svn: 232226

9 years agoIntroduce documentation for Python command objects
Enrico Granata [Fri, 13 Mar 2015 22:27:36 +0000 (22:27 +0000)]
Introduce documentation for Python command objects

llvm-svn: 232225

9 years agoAdd support for Python object commands to return custom short and long help by implem...
Enrico Granata [Fri, 13 Mar 2015 22:22:28 +0000 (22:22 +0000)]
Add support for Python object commands to return custom short and long help by implementing

def get_short_help(self)
def get_long_help(self)

methods on the command object

Also, add a test case for this feature

llvm-svn: 232224

9 years agoUse add32ri8 and friends on fast isel.
Rafael Espindola [Fri, 13 Mar 2015 22:18:18 +0000 (22:18 +0000)]
Use add32ri8 and friends on fast isel.

This fixes pr22854.

The core issue on the bug is that there are multiple instructions that
print the same in assembly. In fact, there doesn't seem to be any
syntax for specifying that a constant that fits in 8 bits should use a 32 bit
immediate.

The attached patch changes fast isel to consider i16immSExt8,
i32immSExt8, and i64immSExt8. They were disabled because fastisel didn’t know
to call the predicate back in the day.

llvm-svn: 232223

9 years agobpf: turn on HasJIT flag in BPF backend
Alexei Starovoitov [Fri, 13 Mar 2015 22:03:25 +0000 (22:03 +0000)]
bpf: turn on HasJIT flag in BPF backend

basic tests that use BPF backend to produce code in memory are passing.

llvm-svn: 232222

9 years agoBe lazy about loading metadata in IRObjectFile.
Rafael Espindola [Fri, 13 Mar 2015 21:54:20 +0000 (21:54 +0000)]
Be lazy about loading metadata in IRObjectFile.

This speeds up llvm-ar building lib64/libclangSema.a with debug IR files
from 8.658015807 seconds to just 0.351036519 seconds :-)

llvm-svn: 232221

9 years agoFix makefiles to build shared library tests on Windows.
Zachary Turner [Fri, 13 Mar 2015 21:51:11 +0000 (21:51 +0000)]
Fix makefiles to build shared library tests on Windows.

Abstracted away some POSIX-isms that caused MAKE to issue invalid
commands on Windows.  Added a new force-include for the test
programs so that we can use platform-specific macros.

TestSharedLib now builds and cleans up on Windows, though the test
still fails some of the expectations.

Differential Revision: http://reviews.llvm.org/D8277
Patch by: Adrian McCarthy
Issue Tracker: http://llvm.org/pr21727

llvm-svn: 232220

9 years agoTranslate some MSVC CMAKE_*_FLAGS to clang flags in clang_compile
Reid Kleckner [Fri, 13 Mar 2015 21:39:29 +0000 (21:39 +0000)]
Translate some MSVC CMAKE_*_FLAGS to clang flags in clang_compile

Passing MSVC-style cflags to the gcc-style clang driver will almost
always end badly. Just translate a couple of simple flags used by the
base CMake cflags like /D, /U, and /O.

llvm-svn: 232219

9 years ago[CMake] Fix unit test build on Linux.
Zachary Turner [Fri, 13 Mar 2015 21:33:34 +0000 (21:33 +0000)]
[CMake] Fix unit test build on Linux.

A filename had been misspelled in the CMake.

llvm-svn: 232218

9 years agoBranchFolding: MergePotentialsElt has a total order, just call array_pod_sort.
Benjamin Kramer [Fri, 13 Mar 2015 21:17:02 +0000 (21:17 +0000)]
BranchFolding: MergePotentialsElt has a total order, just call array_pod_sort.

No functionality change intended.

llvm-svn: 232217

9 years ago[opaque pointer type] Bitcode support for explicit type parameter on the gep operator
David Blaikie [Fri, 13 Mar 2015 21:03:36 +0000 (21:03 +0000)]
[opaque pointer type] Bitcode support for explicit type parameter on the gep operator

This happened to be fairly easy to support backwards compatibility based
on the number of operands (old format had an even number, new format has
one more operand so an odd number).

test/Bitcode/old-aliases.ll already appears to test old gep operators
(if I remove the backwards compatibility in the BitcodeReader, this and
another test fail) so I'm not adding extra test coverage here.

llvm-svn: 232216

9 years agoTurn assertion into bitcode reading error
David Blaikie [Fri, 13 Mar 2015 21:03:34 +0000 (21:03 +0000)]
Turn assertion into bitcode reading error

I don't think we test invalid bitcode records in any detail, so no test
here - just a change for consistency with existing error checks in
surrounding code.

llvm-svn: 232215

9 years agoSimplify expression
David Blaikie [Fri, 13 Mar 2015 21:03:30 +0000 (21:03 +0000)]
Simplify expression

llvm-svn: 232214

9 years agoCreate a check-lldb-unit target to run unit tests.
Zachary Turner [Fri, 13 Mar 2015 20:55:07 +0000 (20:55 +0000)]
Create a check-lldb-unit target to run unit tests.

llvm-svn: 232212

9 years agoRework the gtest directory structure.
Zachary Turner [Fri, 13 Mar 2015 20:54:57 +0000 (20:54 +0000)]
Rework the gtest directory structure.

This makes the directory structure mirror the canonical LLVM
directory structure for a gtest suite.

Additionally, this patch deletes the xcode project.  Nobody
is currently depending on this, and it would be better to have
gtest unit tests be hand-maintained in the Xcode workspace
rather than using this python test runner.  Patches to that
effect will be submitted as followups.

llvm-svn: 232211

9 years agoCreate a CMake build for the gtest unit tests.
Zachary Turner [Fri, 13 Mar 2015 20:54:21 +0000 (20:54 +0000)]
Create a CMake build for the gtest unit tests.

llvm-svn: 232210

9 years agoReapply "[Reassociate] Add initial support for vector instructions."
Robert Lougher [Fri, 13 Mar 2015 20:53:01 +0000 (20:53 +0000)]
Reapply "[Reassociate] Add initial support for vector instructions."

This reapplies the patch previously committed at revision 232190.  This was
reverted at revision 232196 as it caused test failures in tests that did not
expect operands to be commuted.  I have made the tests more resilient to
reassociation in revision 232206.

llvm-svn: 232209

9 years agobpf: fix build
Alexei Starovoitov [Fri, 13 Mar 2015 20:49:38 +0000 (20:49 +0000)]
bpf: fix build

fix missed bits which were left over after r231987

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
llvm-svn: 232208