Commit Graph

196323 Commits

Author SHA1 Message Date
Sanjoy Das 95d041215a [IRCE] Delete two tests.
I accidentally checked in two tests that used -debug-only -- these fail
on a release LLVM build.  Temporarily delete these from the repo to keep
the bots green while I fix this locally.

llvm-svn: 232446
2015-03-17 00:54:50 +00:00
Sanjoy Das 7a0b7f5996 [IRCE] Add comments, NFC.
This change adds some comments that justify why a potentially
overflowing operation is safe.

llvm-svn: 232445
2015-03-17 00:42:16 +00:00
Sanjoy Das e2cde6f195 [IRCE] Support half-range checks.
This change to IRCE gets it to recognize "half" range checks.  Half
range checks are range checks that only either check if the index is
`slt` some positive integer ("length") or if the index is `sge` `0`.

The range solver does not try to be clever / aggressive about solving
half-range checks -- it transforms "I < L" to "0 <= I < L" and "0 <= I"
to "0 <= I < INT_SMAX".  This is safe, but not always optimal.

llvm-svn: 232444
2015-03-17 00:42:13 +00:00
Justin Bogner d0a6243529 llvm-cov: Warn instead of error if a .gcda has arcs from an exit block
Patch by Vanderson M. Rosario. Thanks!

llvm-svn: 232443
2015-03-17 00:18:51 +00:00
Duncan P. N. Exon Smith 79f8d11d5a AsmWriter: Assert on unresolved metadata nodes
Assert that `MDNode::isResolved()`.  While in theory the `Verifier`
should catch this, it doesn't descend into all debug info, and the
`DebugInfoVerifier` doesn't call into the `Verifier`.  Besides, this
helps to catch bugs when `-disable-verify=true`.

Note that I haven't come across a place where this fails with clang
today, so no testcase.

llvm-svn: 232442
2015-03-17 00:16:35 +00:00
Vince Harron de0a0f3100 XFAIL flaky tests
llvm-svn: 232441
2015-03-17 00:10:51 +00:00
Justin Bogner c0a4b59c2f Fix typo in previous commit
llvm-svn: 232440
2015-03-17 00:04:57 +00:00
Justin Bogner 4e46237c6d GCOV: Expose the -coverage-exit-block-before-body flag in clang -cc1
This exposes the optional exit block placement logic from r232438 as a
clang -cc1 option. There is a test on the llvm side, but there isn't
really a way to inspect the gcov options from clang to test it here as
well.

llvm-svn: 232439
2015-03-16 23:52:21 +00:00
Justin Bogner 3faa76bfab GCOV: Make the exit block placement from r223193 optional
By default we want our gcov emission to stay 4.2 compatible, which
means we need to continue emit the exit block last by default. We add
an option to emit it before the body for users that need it.

llvm-svn: 232438
2015-03-16 23:52:03 +00:00
Oleksiy Vyalov 933f853030 Make ModuleList::GetSharedModule to use module_search_paths parameter.
http://reviews.llvm.org/D8365

llvm-svn: 232437
2015-03-16 23:44:30 +00:00
Rui Ueyama 3c2e306a5c PECOFF: Make FileCOFF:findAtomAt from O(n) to O(1).
I knew I cut corners when I wrote this. Turned out that it is
actually slow when a file being read has many symbols. This patch
is to stop doing linear search and instead do map lookup.

llvm-svn: 232436
2015-03-16 23:43:11 +00:00
Peter Collingbourne ad0bdcd238 LowerBitSets: do not use private aliases at all on Darwin.
LLVM currently turns these into linker-private symbols, which can be dead
stripped by the Darwin linker.

llvm-svn: 232435
2015-03-16 23:36:24 +00:00
Siva Chandra 3b36038f45 Cleanup implementation of formatter for std::vector from libstdc++.
Summary: Removed unused variables and methods.

Test Plan: dotest.py -p TestDataFormatterStdVector

Reviewers: vharron

Subscribers: lldb-commits

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

llvm-svn: 232434
2015-03-16 23:02:03 +00:00
Jim Ingham 6312991cdb Report an error for line number values that don't convert to integers during argument
parsing so that we can give a more accurate error message.

<rdar://problem/20145563>

llvm-svn: 232433
2015-03-16 22:47:38 +00:00
Siva Chandra 588ec02f19 Enable TestDataFormatterStdMap on linux (libstdc++) with clang.
Summary:
This test should have been enabled along with
7181dae1248cc1b03505cca1b7c6e3dfeffefc0a, but since the test was
actually crashing, I thought it was a much deeper problem. Turns out,
all I had to do was to add "-fno-limit-debug-info" when compiling
the test case.

The test is still skipped when the testcase is compiled with GCC.

Test Plan: dotest.py -p TestDataFormatterStdMap

Reviewers: vharron

Subscribers: lldb-commits

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

llvm-svn: 232432
2015-03-16 22:45:05 +00:00
Alexander Kornienko c5bc68e7ab [clang-tidy] Move google-readability-function check to readability-named-parameter.
Summary: The relevant style rule is going to be removed, thus the check is no longer needed in the Google module. Leaving the check in readability/ in case someone needs it.

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

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

llvm-svn: 232431
2015-03-16 22:31:16 +00:00
Rafael Espindola 55cfaa2552 Update for llvm API change.
llvm-svn: 232430
2015-03-16 22:30:13 +00:00
Rafael Espindola f696df1148 Pass in a "const Triple &T" instead of a raw StringRef.
llvm-svn: 232429
2015-03-16 22:29:29 +00:00
Rafael Espindola 9bcf2fcb89 Remove unused argument. NFC.
llvm-svn: 232428
2015-03-16 22:06:15 +00:00
David Blaikie 12cf5d70e8 Add testing for mismatched explicit type on a gep operator when loading from bitcode
llvm-svn: 232427
2015-03-16 22:03:50 +00:00
Peter Collingbourne 3fc1563ad7 CFI: Make check-cfi depend on libLTO on Darwin.
llvm-svn: 232426
2015-03-16 22:00:04 +00:00
Richard Trieu a1877598aa Take the non-reference type when constructing a dummy expression.
Otherwise, Expr will assert during construction with a reference type.

llvm-svn: 232425
2015-03-16 21:49:43 +00:00
David Blaikie c695cc7e58 Add testing for mismatched explicit type on a load instruction when loading from bitcode
llvm-svn: 232424
2015-03-16 21:48:46 +00:00
Rafael Espindola 73870dd438 There is only one Asm streamer, there is no need for targets to register it.
Instead, have the targets register a TargetStreamer to be use with the
asm streamer (if any).

llvm-svn: 232423
2015-03-16 21:43:42 +00:00
Justin Bogner a438717638 InstrProf: Fix CoverageMappingReader on big endian
This makes the reader check the endianness of the object file its
given and behave appropriately. For the test I dug up a really old
linker and created a ppc-apple-darwin file for llvm-cov to read.

llvm-svn: 232422
2015-03-16 21:40:18 +00:00
David Majnemer a20616ec10 CodeGen: @llvm.eh.typeid.for replaced @llvm.eh.typeid.for.i32
We removed @llvm.eh.typeid.for.i32 and replaced it with
@llvm.eh.typeid.for quite some time ago.  Fix up some test cases which
never got updated.

llvm-svn: 232421
2015-03-16 21:36:38 +00:00
David Blaikie 675e8cb09e Test bitcode parsing error-handling for incorrect explicit type
(turns out I had regressed this when sinking handling of this type down
into GetElementPtrInst::Create - since that asserted before the error
handling was performed)

llvm-svn: 232420
2015-03-16 21:35:48 +00:00
Shankar Easwaran 9b7374b821 [Core] Add parallel_for_each
This adds a parallel_for_each similar to functionality in MSVC concurrency
library.

This was very patiently reviewed by Rui and credits go to him for this patch.

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

llvm-svn: 232419
2015-03-16 21:27:32 +00:00
Duncan P. N. Exon Smith 7401b1e780 Verifier: Don't call debug info verifier if the module is broken
If `Verifier` has already found a failure, don't call
`DebugInfoVerifier`.  The latter sometimes crashes in `DebugInfoFinder`
when the former would give a nice message.  The only two cases I found
it crashing are explicit verifier tests I've added:

  - test/Verifier/llvm.dbg.declare-expression.ll
  - test/Verifier/llvm.dbg.value-expression.ll

However, I assume frontends with bugs will create invalid IR as well.

IMO, the `DebugInfoVerifier` should never crash (instead, it should fail
to verify), but subtleties like that will be easier to work out once
it's enabled again.

This is part of PR22777.

llvm-svn: 232418
2015-03-16 21:23:56 +00:00
Duncan P. N. Exon Smith 3d510665e9 AsmWriter: Handle broken metadata nodes
Print out temporary `MDNode`s so we don't crash in the verifier (or
during `dump()` output).

llvm-svn: 232417
2015-03-16 21:21:10 +00:00
Duncan P. N. Exon Smith b786572d7c DebugInfo: Fix testcases that fail -verify-debug-info=true
As part of PR22777, fix testcases that fail the debug info verifier.
The changes fall into the following categories:

  - Empty `filename:` fields in `MDFile`s.  Compile units and some types
    require non-empty filenames.  A number of testcases have empty
    filenames, probably due to hand-reduction of testcases.
  - Not-quite empty arrays: `!{i32 0}`.  This used to be equivalent in
    the debug info schema to `!{}`.  They cause problems for
    `!MDSubroutineType`'s `types:` array, since it requires all operands
    to be valid types.  (Note that `!{null}` is the correct type array
    for functions that take no arguments and return `void`.)
  - Significantly bitrotted testcases.  Nodes got left behind a few
    upgrades ago because of missing or invalid tags.

llvm-svn: 232415
2015-03-16 21:10:12 +00:00
Simon Atanasyan 4b4706b601 [ELF] Use pcrel format for eh_frame_ptr field encoding
The `eh_frame_ptr` field in the `.eh_frame_hdr` section contains an address
of the `.eh_frame` section. Using an absolute 32-bit format for encoding
of this field does not work for 64-bit targets. It is better to use a
relative format because it covers both 32-bit and 64-bit cases. Sure
this work if a distance between `.eh_frame_hdr` and `.eh_frame` sections
is less than 4 Gb but it is a rather correct assumption.

http://reviews.llvm.org/D8352

llvm-svn: 232414
2015-03-16 21:07:46 +00:00
Duncan P. N. Exon Smith 9255a5535a Verifier: Simplify logic in processCallInst(), NFC
No need for local variables here.

llvm-svn: 232413
2015-03-16 21:05:33 +00:00
Duncan P. N. Exon Smith e9d379c038 IR: Take advantage of -verify checks for MDExpression
Now that we check `MDExpression` during `-verify` (r232299), make
the `DIExpression` wrapper more strict:

  - remove redundant checks in `DebugInfoVerifier`,
  - overload `get()` to `cast_or_null<MDExpression>` (superseding
    `getRaw()`),
  - stop checking for null in any accessor, and
  - remove `DIExpression::Verify()` entirely in favour of
    `MDExpression::isValid()`.

There is still some logic in this class, mostly to do with high-level
iterators; I'll defer cleaning up those until the rest of the wrappers
are similarly strict.

llvm-svn: 232412
2015-03-16 21:03:55 +00:00
Richard Smith e687bf83c0 [modules] If we find more formerly-canonical declarations of an entity while
building its redecl chains, make sure we pull in the redeclarations of those
canonical declarations.

It's pretty difficult to reach a situation where we can find more canonical
declarations of an entity while building its redecl chains; I think the
provided testcase (4 modules and 7 declarations) cannot be reduced further.

llvm-svn: 232411
2015-03-16 20:54:07 +00:00
Duncan P. N. Exon Smith f37404033f DebugInfo: Simplify logic in DIType::Verify(), NFC
Clarify the logic in `DIType::Verify()` by checking `isBasicType()`
earlier, by skipping `else` after `return`s, and by documenting an
otherwise opaque check.

No functionality change.

llvm-svn: 232410
2015-03-16 20:46:27 +00:00
Rafael Auler 01d73c9678 [LinkerScript] Handle symbols defined in linker scripts
Puts symbols defined in linker script expressions in a runtime file that is
added as input to the resolver, making the input object files see symbols
defined in linker scripts.

http://reviews.llvm.org/D8263

llvm-svn: 232409
2015-03-16 20:39:07 +00:00
Duncan P. N. Exon Smith 18e92078f2 Verifier: Remove unnecessary double-checks
Turns out `visitIntrinsicFunctionCall()` descends into all operands
already, so explicitly descending in `visitDbgIntrinsic()` (part of
r232296) isn't useful.

Updating a testcase that doesn't really need `-verify-debug-info` (since
r231082) as confirmation.

llvm-svn: 232408
2015-03-16 20:24:02 +00:00
Richard Smith 2095ffea41 Lambdaify some helper functions. No functionality change.
llvm-svn: 232407
2015-03-16 20:11:03 +00:00
Kevin Enderby bc847fa4ed Add the options, -dylibs-used and -dylib-id to llvm-objdump used with -macho
to print the Mach-O dynamic shared libraries used by a linked image or the
library id of a shared library.

llvm-svn: 232406
2015-03-16 20:08:09 +00:00
Rafael Espindola 928c393810 Don't repeat names in comments. Remove unused default value.
llvm-svn: 232405
2015-03-16 20:02:28 +00:00
Rafael Auler 8dd680dcb1 [LinkerScript] Adding test cases for SECTIONS semantics
llvm-svn: 232404
2015-03-16 19:56:42 +00:00
Siva Chandra 4da7a29a11 Skip TestDataFormatterStdMap on linux instead of xfailing.
Summary:
After 7181dae1248cc1b03505cca1b7c6e3dfeffefc0a, this test progresses
much further but crashes. Will skip this test while I fix this properly.

Test Plan: dotest.py -p TestDataFormatterStdMap

Reviewers: vharron

Subscribers: lldb-commits

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

llvm-svn: 232403
2015-03-16 19:56:36 +00:00
Rafael Auler 9a7e211e8f [LinkerScript] Implement semantics for simple sections mappings
This commit implements the behaviour of the SECTIONS linker script directive,
used to not only define a custom mapping between input and output sections, but
also order input sections in the output file. To do this, we modify
DefaultLayout with hooks at important places that allow us to re-order input
sections according to a custom order. We also add a hook in SegmentChunk to
allow us to calculate linker script expressions while assigning virtual
addresses to the input sections that live in a segment.

Not all SECTIONS constructs are currently supported, but only the ones that do
not use special sort orders. It adds two LIT test as practical examples of
which sections directives are currently supported.

In terms of high-level changes, it creates a new class "script::Sema" that owns
all linker script ASTs and the logic for linker script semantics as well.
ELFLinkingContext owns a single copy of Sema, which will be used throughout
the object file writing process (to layout sections as proposed by the linker
script).

Other high-level change is that the writer no longer uses a "const" copy of
the linking context. This happens because linker script expressions must be
calculated *while* calculating final virtual addresses, which is a very late
step in object file writing. While calculating these expressions, we need to
update the linker script symbol table (inside the semantics object), and, thus,
we are "modifying our context" as we prepare to write the file.

http://reviews.llvm.org/D8157

llvm-svn: 232402
2015-03-16 19:55:15 +00:00
Greg Clayton 75a19344ad Added an Python operating system plug-in test to verify that python can be used to add threads to an existing process.
The test does the following:
1 - runs a program to main without the OS plug-in and verifies no OS threads are in the process
2 - loads the OS plug-in and verifies the 3 OS plug-in threads are now in the current process
3 - verify the register contents of each thread that shows up
4 - unload the python OS plug-in and verify that the OS threads are gone.

llvm-svn: 232401
2015-03-16 19:54:22 +00:00
Duncan P. N. Exon Smith 3eea196a4f AsmParser: Stop requiring 'name:' when it's not printed
r230877 optimized which fields are written out for `CHECK`-ability, but
apparently missed changing some of them to optional in `LLParser`.

Fixes PR22921.

llvm-svn: 232400
2015-03-16 19:01:54 +00:00
Siva Chandra 870602dd3c Handle PyLong return values in LLDBSwigPython_CalculateNumChildren.
Summary:
Also, change its return type to size_t to match the return types of
its callers.

With this change, std::vector and std::list data formatter tests
pass on Linux (when using libstdc++) with clang as well as with gcc.
These tests have also been enabled in this patch.

Test Plan: dotest.py -p <TestDataFormatterStdVector|TestDataFormatterStdList>

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: zturner, lldb-commits

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

llvm-svn: 232399
2015-03-16 19:01:33 +00:00
Sanjay Patel 11ce908e4c fixed to test feature, not CPU
llvm-svn: 232398
2015-03-16 18:24:28 +00:00
David Blaikie cd97b9fe1f Remove dead file (was only used by the C backend)
llvm-svn: 232397
2015-03-16 18:18:32 +00:00
Hafiz Abid Qadeer a40780e36c Remove redundant comments from lldb-mi source files.
Most of lldb-mi files have comments about environement, copyright etc which were neither needed nor uptodate.
This commit removes those comments.

llvm-svn: 232396
2015-03-16 18:18:18 +00:00