Commit Graph

196295 Commits

Author SHA1 Message Date
David Majnemer 2b6dd68535 Restore the gcc build
llvm-svn: 232314
2015-03-15 06:11:24 +00:00
David Blaikie 095a4c7b06 Remove iterator I accidentally left behind
llvm-svn: 232312
2015-03-15 03:21:20 +00:00
David Blaikie 420599cc5e Remove use of reserved identifier _Iterator
llvm-svn: 232311
2015-03-15 03:18:21 +00:00
David Blaikie 503791382b Remove use of reserved identifiers in Twine
llvm-svn: 232310
2015-03-15 03:17:28 +00:00
David Blaikie b253ff3385 Remove use of reserved identifier and some excess 'inline' usage
llvm-svn: 232309
2015-03-15 03:11:26 +00:00
David Blaikie d3e48e480f Remove reserved identifier & some unnecessary 'inline'
llvm-svn: 232308
2015-03-15 03:11:24 +00:00
David Blaikie 2aad0db84d Remove use of reserved identifier
& some unnecessary 'inline' keywords

llvm-svn: 232307
2015-03-15 03:03:41 +00:00
Alexander Kornienko 1c4af5edf4 [clang-tidy] Fix false positives in the misc-static-assert check http://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
2015-03-15 02:19:37 +00:00
Frederic Riss b0464089fd [dsymutil] Add an way to iterate over a DebugMapObject symbols.
llvm-svn: 232305
2015-03-15 02:02:53 +00:00
David Blaikie 65f8f1c937 Remove use of unreserved identifier (_Self)
And some unnecessary inline keywords

llvm-svn: 232304
2015-03-15 01:42:28 +00:00
David Blaikie 4ef351dd6e Remove use of a reserved identifier
(& some unnecessary 'inline' keywords, too)

llvm-svn: 232303
2015-03-15 01:40:42 +00:00
David Blaikie 7d97e80219 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
2015-03-15 01:37:01 +00:00
David Majnemer f45bbd0da3 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
2015-03-15 01:30:58 +00:00
Frederic Riss 912d0f1261 [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
2015-03-15 01:29:30 +00:00
Duncan P. N. Exon Smith 25cf28fd7b 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
2015-03-15 01:23:20 +00:00
David Blaikie c3f2d3faa3 Remove some unnecessary 'inline' keywords
llvm-svn: 232298
2015-03-15 01:21:37 +00:00
David Blaikie bdd9b3caad 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
2015-03-15 01:21:34 +00:00
Duncan P. N. Exon Smith 166121ad0b 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
2015-03-15 01:21:30 +00:00
Dmitri Gribenko ad80af8f19 -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
2015-03-15 01:08:23 +00:00
David Blaikie 86ecb1bdaf [opaque pointer type] IRBuilder gep migration progress
llvm-svn: 232294
2015-03-15 01:03:19 +00:00
George Burgess IV 11d509dba0 Made CFLAA agree with clang-format. NFC.
So everyone's lives are easier in the future

llvm-svn: 232293
2015-03-15 00:52:21 +00:00
Duncan P. N. Exon Smith 959299e7d1 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
2015-03-15 00:50:57 +00:00
Duncan P. N. Exon Smith 6fb58c4f7b Verifier: Make the raw_ostream constructor argument required
This was passed inconsistently; seems clearer to make it required anyway.

llvm-svn: 232291
2015-03-15 00:46:57 +00:00
Duncan P. N. Exon Smith 87c7686664 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
2015-03-15 00:45:51 +00:00
David Majnemer 9ced3dd64c 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
2015-03-14 23:44:48 +00:00
Zachary Turner 073951f28b 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
2015-03-14 23:39:42 +00:00
Zachary Turner eeba1a896a [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
2015-03-14 23:39:28 +00:00
Simon Pilgrim ece7475951 Simplified some stack folding tests.
Replaced explicit pmovzx* intrinsic tests with general shuffles

llvm-svn: 232286
2015-03-14 23:16:43 +00:00
David Majnemer 8062eb6bed 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
2015-03-14 22:24:38 +00:00
Mehdi Amini b344ac9afe 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
2015-03-14 22:19:33 +00:00
Mehdi Amini 4a121fab4e 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
2015-03-14 22:04:06 +00:00
Davide Italiano de42c18889 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
2015-03-14 21:57:15 +00:00
David Blaikie 72edd88273 Add some missed formatting
llvm-svn: 232281
2015-03-14 21:40:12 +00:00
David Blaikie b3a3906ad7 [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
2015-03-14 21:40:10 +00:00
David Blaikie c95c3aee15 [opaque pointer type] gep API migration
llvm-svn: 232279
2015-03-14 21:20:51 +00:00
Chris Bieneman 3bec07a34c 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
2015-03-14 21:20:32 +00:00
David Blaikie 7682663ef6 [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
2015-03-14 21:11:26 +00:00
David Blaikie cd7b97e48f [opaque pointer type] more gep API migrations (AsmParser)
llvm-svn: 232276
2015-03-14 21:11:24 +00:00
Duncan P. N. Exon Smith d6d70e753d 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
2015-03-14 20:19:36 +00:00
David Blaikie 096b1da29d [opaque pointer type] more gep API migration
llvm-svn: 232274
2015-03-14 19:53:33 +00:00
Duncan P. N. Exon Smith 20b76ac2ae AsmWriter: Split out SlotTracker::processInstructionMetadata(), NFC
llvm-svn: 232273
2015-03-14 19:48:31 +00:00
Duncan P. N. Exon Smith 27f33ee368 AsmWriter: Use range-based for, NFC
llvm-svn: 232272
2015-03-14 19:44:01 +00:00
Shankar Easwaran 5d34ad79b4 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
2015-03-14 19:41:24 +00:00
David Blaikie 22319eb920 [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
2015-03-14 19:24:04 +00:00
Yaron Keren bdae8d6403 No need to prototype RtlCaptureContext with mingw-w64.
llvm-svn: 232269
2015-03-14 19:20:56 +00:00
Duncan P. N. Exon Smith ec9d3f779a 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
2015-03-14 16:47:37 +00:00
Frederic Riss dfb9790a3d [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
2015-03-14 15:49:07 +00:00
Benjamin Kramer 09db991e37 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
2015-03-14 14:53:14 +00:00
Benjamin Kramer 0eb262fb28 Sort ObjCProtocolDecls with array_pod_sort.
The predicate is essentially a string comparison. NFC.

llvm-svn: 232264
2015-03-14 13:32:49 +00:00
Benjamin Kramer 5caa50e469 [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
2015-03-14 12:39:22 +00:00