1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

5113 Commits

Author SHA1 Message Date
Justin Bogner
804984b091 llvm-cov: Push some more debug output into the View (NFC)
llvm-svn: 217984
2014-09-17 21:48:52 +00:00
Rafael Espindola
10b142b791 Internalize common symbols when we can.
This fixes pr20974.

llvm-svn: 217981
2014-09-17 20:41:13 +00:00
Justin Bogner
aa59e21d08 llvm-cov: Rework the API for getting the coverage of a file (NFC)
This encapsulates how we handle the coverage regions of a file or
function. In the old model, the user had to deal with nested regions,
so they needed to maintain their own auxiliary data structures to get
any useful information out of this. The new API provides a sequence of
non-overlapping coverage segments, which makes it possible to render
coverage information in a single pass and avoids a fair amount of
extra work.

llvm-svn: 217975
2014-09-17 18:23:47 +00:00
Justin Bogner
46a2bb923b LineIterator: Provide a variant that keeps blank lines
It isn't always useful to skip blank lines, as evidenced by the
somewhat awkward use of line_iterator in llvm-cov. This adds a knob to
control whether or not to skip blanks.

llvm-svn: 217960
2014-09-17 15:43:01 +00:00
Justin Bogner
6b1db2fff7 llvm-cov: Fix a typo
It doesn't make sense for this default parameter to be false, since
false makes the function a no-op.

llvm-svn: 217945
2014-09-17 08:12:12 +00:00
Justin Bogner
270ad5d7f6 Add move constructors/assignment to make MSVC happy after r217940
llvm-svn: 217941
2014-09-17 06:32:48 +00:00
Justin Bogner
ffaab84f27 llvm-cov: Distinguish expansion/instantiation from SourceCoverageView
SourceCoverageView currently has "Kind" and a list of child views, all
of which must have either an expansion or an instantiation Kind. In
addition to being an error-prone design, this makes it awkward to
differentiate between the two child types and adds a number of
optionally used members to the type.

Split the subview types into their own separate objects, and maintain
lists of each rather than one combined "Children" list.

llvm-svn: 217940
2014-09-17 05:33:20 +00:00
Nick Kledzik
8671995d9c [llvm-objdump] properly use c_str() with format("%s"). Improve getLibraryShortNameByIndex() error handling.
llvm-svn: 217930
2014-09-17 00:25:22 +00:00
Nick Kledzik
3e015e4df1 [llvm-objdump] improve error reporting of bad mach-o ordinals
llvm-svn: 217909
2014-09-16 22:03:13 +00:00
Kevin Enderby
2381e3a0ed Hookup the MCSymbolizer to llvm-objdump’s disassembly for Mach-O files.
First step done in this commit is to get flush out enough of the
SymbolizerGetOpInfo() routine to symbolic an X86_64 hello world .o and
its loading of the literal string and call to printf.  Also the code to
symbolicate the X86_64_RELOC_SUBTRACTOR relocation and a test is also
added to show a slightly more complicated case.

Next will be to flush out enough of SymbolizerSymbolLookUp() to get the
literal string “Hello world” printed as a comment on the instruction that load
the pointer to it.

llvm-svn: 217893
2014-09-16 18:00:57 +00:00
Justin Bogner
b42946011d llvm-cov: Rename a variable and clean up its usage
Offset is a terrible name for an indentation / nesting level, and it
confuses me every time I look at this code.

llvm-svn: 217861
2014-09-16 06:21:57 +00:00
David Majnemer
7b9da9e01d yaml2obj: Support bigobj
Teach yaml2obj how to make a bigobj COFF file.  Like the rest of LLVM,
we automatically decide whether or not to use regular COFF or bigobj
COFF on the fly depending on how many sections the resulting object
would have.

This ends the task of adding bigobj support to LLVM.

N.B. This was tested by forcing yaml2obj to be used in bigobj mode
regardless of the number of sections.  While a dedicated test was
written, the smallest I could make it was 36 MB (!) of yaml and it still
took a significant amount of time to execute on a powerful machine.

llvm-svn: 217858
2014-09-16 03:52:46 +00:00
Nick Kledzik
acba0c3deb [llvm-objdump] for mach-o add -bind, -lazy-bind, and -weak-bind options
This finishes the ability of llvm-objdump to print out all information from
the LC_DYLD_INFO load command.

The -bind option prints out symbolic references that dyld must resolve 
immediately.

The -lazy-bind option prints out symbolc reference that are lazily resolved on 
first use.

The -weak-bind option prints out information about symbols which dyld must
try to coalesce across images.

llvm-svn: 217853
2014-09-16 01:41:51 +00:00
Justin Bogner
bd9ae45726 llvm-cov: Make debug output more consistent
This changes the debug output of the llvm-cov tool to consistently
write to stderr, and moves the highlighting output closer to where
it's relevant.

llvm-svn: 217838
2014-09-15 22:23:29 +00:00
Justin Bogner
50e68a6de5 llvm-cov: Fix an issue with showing regions but not counts
In r217746, though it was supposed to be NFC, I broke llvm-cov's
handling of showing regions without showing counts. This should've
shown up in the existing tests, except they were checking debug output
that was displayed regardless of what was actually output. I've moved
the relevant debug output to a more appropriate place so that the
tests catch this kind of thing.

llvm-svn: 217835
2014-09-15 22:12:28 +00:00
David Majnemer
579f5bb06a MC: Add support for BigObj
Teach WinCOFFObjectWriter how to write -mbig-obj style object files;
these object files allow for more sections inside an object file.

Our support for BigObj is notably different from binutils and cl: we
implicitly upgrade object files to BigObj instead of asking the user to
compile the same file *again* but with another flag.  This matches up
with how LLVM treats ELF variants.

This was tested by forcing LLVM to always emit BigObj files and running
the entire test suite.  A specific test has also been added.

I've lowered the maximum number of sections in a normal COFF file,
VS "14" CTP 3 supports no more than 65279 sections.  This is important
otherwise we might not switch to BigObj quickly enough, leaving us with
a COFF file that we couldn't link.

yaml2obj support is all that remains to implement.

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

llvm-svn: 217812
2014-09-15 19:42:42 +00:00
Justin Bogner
293ec338b0 llvm-cov: Clean up some redundancy in the view API (NFC)
This removes the need to pass a starting and ending line when creating
a SourceCoverageView, since these are easy to determine.

llvm-svn: 217746
2014-09-15 03:41:04 +00:00
Justin Bogner
4bb118ab83 llvm-cov: Simplify CounterMappingRegion, pushing logic to its user
A single function in SourceCoverageDataManager was the only user of
some of the comparisons in CounterMappingRegion, and at this point we
know that only one file is relevant. This lets us use slightly simpler
logic directly in the client.

llvm-svn: 217745
2014-09-15 03:41:01 +00:00
Nick Kledzik
07d339033f [llvm-objdump] Use PRIX64 with format()
llvm-svn: 217724
2014-09-13 00:18:40 +00:00
Nick Kledzik
269b17eed0 [llvm-objdump] support -rebase option for mach-o to dump rebasing info
Similar to my previous -exports-trie option, the -rebase option dumps info from
the LC_DYLD_INFO load command. The rebasing info is a list of the the locations
that dyld needs to adjust if a mach-o image is not loaded at its preferred 
address. Since ASLR is now the default, images almost never load at their
preferred address, and thus need to be rebased by dyld.

llvm-svn: 217709
2014-09-12 21:34:15 +00:00
Justin Bogner
50f453be5f llvm-cov: Move FunctionCoverageMapping into CoverageMapping.h (NFC)
llvm-svn: 217657
2014-09-12 06:52:44 +00:00
Justin Bogner
d27a521c07 Revert "llvm-cov: Remove an overly system specific test"
This fixes a call to sys::fs::equivalent that should've been to
CodeCoverageTool::equivalentFiles, which lets us restore the test of
r217476 that was removed in r217478.

This reverts r217478, but the test works this time.

llvm-svn: 217646
2014-09-11 23:20:48 +00:00
Rui Ueyama
19cceece7b Support: Delete {aligned_,}{u,}{little,big}8_t
The byte has no endianness, so these types don't make sense.
uint8_t should be used instead.

llvm-svn: 217631
2014-09-11 21:46:33 +00:00
Rafael Espindola
5e43285c55 Use the simpler sys::fs:;exists. NFC.
llvm-svn: 217617
2014-09-11 18:44:26 +00:00
Ismail Pazarbasi
60befa06fc Added missing LLVM_NOEXCEPT to the definition of _obj2yaml_error_category::name
LLVM_NOEXCEPT was added in r210591.

llvm-svn: 217603
2014-09-11 17:19:54 +00:00
Rafael Espindola
4753b87f60 Add doInitialization/doFinalization to DataLayoutPass.
With this a DataLayoutPass can be reused for multiple modules.

Once we have doInitialization/doFinalization, it doesn't seem necessary to pass
a Module to the constructor.

Overall this change seems in line with the idea of making DataLayout a required
part of Module. With it the only way of having a DataLayout used is to add it
to the Module.

llvm-svn: 217548
2014-09-10 21:27:43 +00:00
Rafael Espindola
f22493d161 Remember to eraseFromParent after replaceAllUsesWith.
llvm-svn: 217536
2014-09-10 19:39:41 +00:00
David Majnemer
6dd8f341ed Object: Add support for bigobj
This adds support for reading the "bigobj" variant of COFF produced by
cl's /bigobj and mingw's -mbig-obj.

The most significant difference that bigobj brings is more than 2**16
sections to COFF.

bigobj brings a few interesting differences with it:
- It doesn't have a Characteristics field in the file header.
- It doesn't have a SizeOfOptionalHeader field in the file header (it's
  only used in executable files).
- Auxiliary symbol records have the same width as a symbol table entry.
  Since symbol table entries are bigger, so are auxiliary symbol
  records.

Write support will come soon.

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

llvm-svn: 217496
2014-09-10 12:51:52 +00:00
Justin Bogner
40d9fabf30 llvm-cov: Fix a misuse of ArrayRef::slice I introduced in r217430
It appears this code was completely untested, so using ArrayRef wrong
didn't break anything obvious.

llvm-svn: 217476
2014-09-10 06:06:07 +00:00
Rafael Espindola
5d2ea83b96 Handle common linkage correctly in the gold plugin.
This is the plugin version of pr20882.

This handles the case of every common symbol being in the IR. We will need some
support from gold to handle the case where some symbols are in ELF and some in
the IR.

llvm-svn: 217458
2014-09-09 20:08:22 +00:00
Tim Northover
17de4f5ae4 llvm-objdump: don't crash when __compact_unwind has no relocs.
llvm-svn: 217433
2014-09-09 10:45:06 +00:00
Justin Bogner
04bf7c7e7c llvm-cov: Use ArrayRef::slice (NFC)
llvm-svn: 217430
2014-09-09 09:15:52 +00:00
Justin Bogner
951fd60695 llvm-cov: Combine two types that were nearly identical (NFC)
llvm-cov had a SourceRange type that was nearly identical to a
CountedRegion except that it shaved off a couple of fields. There
aren't likely to be enough of these for the minor memory savings to be
worth the extra complexity here.

llvm-svn: 217417
2014-09-09 05:32:18 +00:00
Justin Bogner
8f071790c7 llvm-cov: Rename MappingRegion to coverage::CountedRegion (NFC)
This name was too similar to CoverageMappingRegion, and the type
really belongs in the coverage library anyway.

llvm-svn: 217416
2014-09-09 05:32:14 +00:00
Justin Bogner
b977873733 llvm-cov: Use ErrorOr rather than an error_code* (NFC)
llvm-svn: 217404
2014-09-08 21:04:00 +00:00
Justin Bogner
bb93be54d8 llvm-cov: Remove dead code
FunctionCoverageMapping::PrettyName was from a version of the tool
during review, and isn't actually used currently.

llvm-svn: 217398
2014-09-08 19:51:21 +00:00
Kevin Enderby
c8fe95519b Adds the next bit of support for llvm-objdump’s -private-headers for executable Mach-O files.
This adds the printing of more load commands, so that the normal load commands
in a typical X86 Mach-O executable can all be printed.

llvm-svn: 217172
2014-09-04 16:54:47 +00:00
Lang Hames
1c12ed82fc [MCJIT] Add command-line argument to llvm-rtdyld to specify target addresses for
sections.

This allows fine-grained control of the memory layout of hypothetical target
processes for testing purposes.

llvm-svn: 217122
2014-09-04 04:19:54 +00:00
Justin Bogner
a1e018be46 llvm-cov: Don't pointlessly create a unique_ptr (NFC)
There's no ownership going on here, and no reason to heap allocate
this object.

llvm-svn: 217113
2014-09-04 00:04:54 +00:00
Chris Bieneman
401492ce04 Enabling LLVM & Clang to be cross-compiled using CMake from a single configuration command line
The basic idea is similar to the existing cross compilation support. A directory must be configured to build host versions of tablegen tools and llvm-config. This directory can be user provided (and configured), or it can be created during the build. During a build the native build directory will be configured and built to supply the tablegen tools used during the build. A user could also explicitly provide the tablegen executables to run on the CMake command line.

llvm-svn: 217105
2014-09-03 23:21:18 +00:00
David Blaikie
981acfbd5e unique_ptrify a bunch of stuff through RuntimeDyld::loadObject
llvm-svn: 217065
2014-09-03 19:48:09 +00:00
David Blaikie
9ec4b63537 unique_ptrify IRObjectFile::createIRObjectFile
I took a guess at the changes to the gold plugin, because that doesn't
seem to build by default for me. Not sure what dependencies I might be
missing for that.

llvm-svn: 217056
2014-09-03 17:59:23 +00:00
Rafael Espindola
cbfc7723a8 Pass a && to getLazyBitcodeModule.
This forces callers to use std::move when calling it. It is somewhat odd to have
code with std::move that doesn't always move, but it is also odd to have code
without std::move that sometimes moves.

llvm-svn: 217049
2014-09-03 17:31:46 +00:00
Alexander Potapenko
7fa9a22550 Follow-up for r217020: actually commit the fix for PR20800,
revert the accidentally committed changes to LLVMSymbolize.cpp

llvm-svn: 217021
2014-09-03 07:37:20 +00:00
Alexander Potapenko
60df1a262c Fix PR20800: correctly calculate the offset of the subq instruction when generating compact unwind info.
This CL replaces the constant DarwinX86AsmBackend.PushInstrSize with a method
that lets the backend account for different sizes of "push %reg" instruction
sizes.

llvm-svn: 217020
2014-09-03 07:11:34 +00:00
Lang Hames
c4cba8b01c [MCJIT] Make llvm-rtdyld process eh_frame sections in -verify mode (accidentally
left out of r217010).

Also remove a crufty debugging output statement that was accidentally left in.

llvm-svn: 217011
2014-09-03 05:42:52 +00:00
Nick Kledzik
62009b9b9c Replace printf with outs() <<
llvm-svn: 217005
2014-09-03 01:12:52 +00:00
Sean Silva
537b499a27 Nuke MCAnalysis.
The code is buggy and barely tested. It is also mostly boilerplate.
(This includes MCObjectDisassembler, which is the interface to that
functionality)

Following an IRC discussion with Jim Grosbach, it seems sensible to just
nuke the whole lot of functionality, and dig it up from VCS if
necessary (I hope not!).

All of this stuff appears to have been added in a huge patch dump (look
at the timeframe surrounding e.g. r182628) where almost every patch
seemed to be untested and not reviewed before being committed.
Post-review responses to the patches were never addressed. I don't think
any of it would have passed pre-commit review.

I doubt anyone is depending on this, since this code appears to be
extremely buggy. In limited testing that Michael Spencer and I did, we
couldn't find a single real-world object file that wouldn't crash the
CFG reconstruction stuff. The symbolizer stuff has O(n^2) behavior and
so is not much use to anyone anyway. It seemed simpler to remove them as
a whole. Most of this code is boilerplate, which is the only way it was
able to scrape by 60% coverage.

HEADSUP: Modules folks, some files I nuked were referenced from
include/llvm/module.modulemap; I just deleted the references. Hopefully
that is the right fix (one was a FIXME though!).

llvm-svn: 216983
2014-09-02 22:32:20 +00:00
Eric Christopher
2f6f860aaa Reinstate "Nuke the old JIT."
Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reinstates commits r215111, 215115, 215116, 215117, 215136.

llvm-svn: 216982
2014-09-02 22:28:02 +00:00
Nick Kledzik
62d76ca7ab Code review tweaks
llvm-svn: 216931
2014-09-02 18:50:24 +00:00