Commit Graph

6999 Commits

Author SHA1 Message Date
Zachary Turner
4f4018ce2c [llvm-pdbdump] Decipher the remaining PDB streams.
We know at least know the meaning of every stream of the
PDB file.  Yay!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270669 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 05:49:48 +00:00
Saleem Abdulrasool
9c894139a0 Revert "llvm-objdump: support dumping AUX records for weak externals"
Revert it until we can figure out the endianness issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270667 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 05:45:02 +00:00
Zachary Turner
fbbe74464a [llvm-pdbdump] Dump the IPI stream and all records.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270661 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 04:35:22 +00:00
Zachary Turner
3b27e60206 [llvm-pdbdump] Stream 0 isn't actually the MSF superblock.
Oddly enough, I realized we don't actually know what stream
0 is (if anything).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 03:53:16 +00:00
Zachary Turner
ec842a3379 [llvm-pdbdump] Dump stream summary list.
Try to figure out what each stream is, and dump its name.

This gives us a better picture of what streams we still don't
understand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270653 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 03:43:17 +00:00
Saleem Abdulrasool
d51855e21d llvm-objdump: support dumping AUX records for weak externals
This is a support COFF feature.  Ensure that we can display the weak externals
auxiliary symbol.  It contains useful information (such as the default binding
and how to resolve the symbol).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270648 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 01:59:32 +00:00
Zachary Turner
2d4f33a508 [codeview] Add support for new type records.
This adds support for parsing and dumping the following
symbol types:

S_LPROCREF
S_ENVBLOCK
S_COMPILE2
S_REGISTER
S_COFFGROUP
S_SECTION
S_THUNK32
S_TRAMPOLINE

As of this patch, the test PDB files no longer have any unknown
symbol types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270628 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-24 22:58:46 +00:00
Zachary Turner
db7b818057 Remove unused global variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-24 20:48:18 +00:00
Zachary Turner
45ab259f8d [llvm-pdbdump] Rework command line options.
When dumping huge PDB files, too many of the options were grouped
together so you would get neverending spew of output.  This patch
introduces more granular display options so you can only dump the
fields you actually care about.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270607 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-24 20:31:48 +00:00
Peter Collingbourne
84e27c2068 Add FIXMEs to all derived classes of std::error_category.
This helps make clear that we're moving away from std::error_code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270604 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-24 20:13:46 +00:00
Zachary Turner
653eb429f5 [codeview, pdb] Dump symbol records in publics stream
Differential Revision: http://reviews.llvm.org/D20580
Reviewed By: ruiu

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270597 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-24 18:55:14 +00:00
Zachary Turner
fe03e32b28 Dump symbol record details in llvm-pdbdump
This makes use of the newly introduced `CVSymbolVisitor` to dump details
of each type of symbol record in the symbol streams.  Future patches will
bring this visitor based dumping to the publics stream, as well as
creating a `SymbolDumpDelegate` to print more information about
relocations etc.

Differential Revision: http://reviews.llvm.org/D20545
Reviewed By: ruiu

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270585 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-24 17:30:25 +00:00
Zachary Turner
ad25a60d24 Remove unused variable breaking -Werror builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270529 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-24 03:32:34 +00:00
Zachary Turner
24466fcd2c Make a symbol visitor and use it to dump CV symbols.
Differential Revision: http://reviews.llvm.org/D20534
Reviewed By: rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270511 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 23:41:13 +00:00
David Blaikie
632d568d2e llvm-dwp: Reduce indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270507 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 22:38:06 +00:00
David Blaikie
7bac6e8629 llvm-dwp: Split out processing of input sections to improve readability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 22:21:10 +00:00
Kevin Enderby
f0a99b9f68 Tweak to change in r270491 to deal with the lld-x86_64-darwin13 bot having a old xar.h header.
Reviewed the change with Chris Bieneman and Pete Cooper.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 22:18:59 +00:00
David Blaikie
16017f941b llvm-dwp: Pull out compression handling helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270496 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 21:58:58 +00:00
Kevin Enderby
866cdd590d Add the printing the Mach-O (__LLVM,__bundle) xar archive file section "verbosely"
to llvm-objdump. This section is created with -fembed-bitcode option.

This requires the use of libxar and the Cmake and lit support were crafted by
Chris Bieneman!

rdar://26202242


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 21:34:12 +00:00
Zachary Turner
dc38d33d03 [codeview] Refactor symbol records to use same pattern as types.
This will pave the way to introduce a full fledged symbol visitor
similar to how we have a type visitor, thus allowing the same
dumping code to be used in llvm-readobj and llvm-pdbdump.

Differential Revision: http://reviews.llvm.org/D20384
Reviewed By: rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 18:49:06 +00:00
David Blaikie
27665308ff llvm-dwp: More error handling around invalid compressed sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270466 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 17:59:17 +00:00
David Blaikie
fb4915b806 llvm-dwp: Ensure compressed sections are preserved long enough for use in the string pool
Now that the string pool is referential rather than maintaining its own
copy of string data, compressed sections (well, technically only the
debug_str section*) need to be preserved for the lifetime of the pool to
match.

* I'm not currently optimizing for memory footprint with compressed
  input - the major memory limit I'm hitting is on dwp+dwp merge steps
  and we aren't currently compressing contents in dwp files, just in the
  .dwo inputs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 17:35:51 +00:00
David Blaikie
5131c267e1 llvm-dwp: Fix the build by moving DWPStringPool into the llvm namespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 16:45:00 +00:00
Xinliang David Li
1386ead074 [profile] show more statistics
Add value profile statistics with the 'show' command.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 16:36:11 +00:00
David Blaikie
018cdc89a0 llvm-dwp: Add an abstraction for the DWP string pool
Also reference strings in the memory mapped file, reduces memory usage
on a large test case by 18.5%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 16:32:11 +00:00
George Rimar
e73be5ff27 [llvm-readobj] - Teach readobj to recognize SHF_COMPRESSED flag.
Main problem here was that SHF_COMPRESSED has the same value with
XCORE_SHF_CP_SECTION, which was included as standart (common) flag.
As far I understand xCore is a family of controllers and it that
means it's constant should be processed separately,
only if e_machine == EM_XCORE, otherwise llvm-readobj would output
different constants twice for compressed section:

Flags [
..
SHF_COMPRESSED (0x800)
..
XCORE_SHF_CP_SECTION (0x800)
..
]

what probably does not make sence if you're not working with xcore file.

Differential revision: http://reviews.llvm.org/D20273

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-21 10:16:58 +00:00
Chris Bieneman
d60c9c7025 [yaml2obj] [MachO] Fill Segment and Section data
This fills section data with 0xDEADBEEF and segment data not inside a section with 0xBAADDA7A. This results in yaml2obj generating a matching size object file. Any additional bytes in the file are zero'd.

This is a starting point for populating the remaining segment data, and provides a hex viewable file that you can easily see the missing data in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 22:31:50 +00:00
Adrian Prantl
d492dcbc14 dsymutil/modules: Reword the warning for static libraries without module caches
In addition to clarifying the warning message this contains a minor functional
change in that it now warns if the *immediate* parent directory in which the
missing PCM is expected to be isn't found.

This patch also includes a more comprehensive testcase.

rdar://problem/25860711

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270269 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 20:36:06 +00:00
Rui Ueyama
59427f6dc7 pdbdump: print out symbol names referred by publics stream.
DBI stream contains a stream number of the symbol record stream.
Symbol record streams is an array of length-type-value members.
Each member represents one symbol.

Publics stream contains offsets to the symbol record stream.
This patch is to print out all symbols that are referenced by
the publics stream.

Note that even with this patch, llvm-pdbdump cannot dump all the
information in a publics stream since it contains more information
than symbol names. I'll improve it in followup patches.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-20 19:55:17 +00:00
Chris Bieneman
e90cbf6c44 [yaml2obj] Removing debug code that scribbled 0xDEADBEEF
Now that MachO load command fields are fully covered we can fill unaccounted for bytes with 0. That allows us to sparsely specify YAML to simplify tests.

Simplifying load_commands test accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 23:26:31 +00:00
Easwaran Raman
30c760d801 Remove specializations of ProfileSummary
This removes the subclasses of ProfileSummary, moves the members of the derived classes to the base class.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 21:53:28 +00:00
Easwaran Raman
17e7f1191f Move ProfileSummary to IR.
This splits ProfileSummary into two classes: a ProfileSummary class that has methods to convert from/to metadata and a ProfileSummaryBuilder class that computes the profiles summary which is in ProfileData.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270136 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 21:07:12 +00:00
Chris Bieneman
09166ea25b [obj2yaml] [yaml2obj] Support for MachO Load Command data
This re-applies r270115.

Many of the MachO load commands can have data appended after the command structure. This data is frequently strings, but can actually be anything. This patch adds support for three optional fields on load command yaml descriptions.

The new PayloadString YAML field is populated with the data after load commands known to have strings as extra data.

The new ZeroPadBytes YAML field is a count of zero'd bytes after the end of the load command structure before the next command. This can apply anywhere in the file. MachO2YAML verifies that bytes are zero before populating this field, and YAML2MachO will add zero'd bytes.

The new PayloadBytes YAML field stores all bytes after the end of the load command structure before the next command if they are non-zero. This is a catch all for all unhandled bytes. If MachO2Yaml populates PayloadBytes it will not populate ZeroPadBytes, instead zero'd bytes will be in the PayloadBytes structure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270124 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:54:43 +00:00
Chris Bieneman
ac5b9174b6 Revert "[obj2yaml] [yaml2obj] Support for MachO Load Command data"
This reverts commit r270115.

This failed on several builders using GCC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270121 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:48:54 +00:00
Chris Bieneman
dadbde9f38 [obj2yaml] [yaml2obj] Support for MachO Load Command data
Many of the MachO load commands can have data appended after the command structure. This data is frequently strings, but can actually be anything. This patch adds support for three optional fields on load command yaml descriptions.

The new PayloadString YAML field is populated with the data after load commands known to have strings as extra data.

The new ZeroPadBytes YAML field is a count of zero'd bytes after the end of the load command structure before the next command. This can apply anywhere in the file. MachO2YAML verifies that bytes are zero before populating this field, and YAML2MachO will add zero'd bytes.

The new PayloadBytes YAML field stores all bytes after the end of the load command structure before the next command if they are non-zero. This is a catch all for all unhandled bytes. If MachO2Yaml populates PayloadBytes it will not populate ZeroPadBytes, instead zero'd bytes will be in the PayloadBytes structure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270115 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:40:03 +00:00
Matthew Simpson
d06ea8a8f4 [ARM, AArch64] Properly initialize InterleavedAccessPass
InterleavedAccessPass is an IR-level pass, so this change will enable testing
it with opt. This is part of D20250.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270101 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 20:08:32 +00:00
Rui Ueyama
cc76d42fd3 pdbdump: Rename NumberOfSymbols -> SymbolRecordStreamIndex.
Differential Revision: http://reviews.llvm.org/D20441

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 18:05:58 +00:00
Peter Collingbourne
28f667b461 CodeGen: Make the global-merge pass independently testable, and add a test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270023 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 04:38:56 +00:00
Vedant Kumar
c77570e062 Retry^3 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"
Transition InstrProf and Coverage over to the stricter Error/Expected
interface.

Changes since the initial commit:
- Fix error message printing in llvm-profdata.
- Check errors in loadTestingFormat() + annotateAllFunctions().
- Defer error handling in InstrProfIterator to InstrProfReader.
- Remove the base ProfError class to work around an MSVC ICE.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19 03:54:45 +00:00
Chris Bieneman
5963742178 [obj2yaml] Refactoring of dumping MachO section structs
This refactoring is to reduce code duplication between the 32-bit and 64-bit code paths. This refactoring will also make the special casing for other data after load commands cleaner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270001 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 23:22:53 +00:00
Rafael Espindola
ac8db59598 Delete Reloc::Default.
Having an enum member named Default is quite confusing: Is it distinct
from the others?

This patch removes that member and instead uses Optional<Reloc> in
places where we have a user input that still hasn't been maped to the
default value, which is now clear has no be one of the remaining 3
options.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 22:04:49 +00:00
Rui Ueyama
17e3d064b5 pdbdump: Print out section offsets in the publics stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:24:16 +00:00
Chris Bieneman
7ec0ea16b7 Re-apply: [obj2yaml] [yaml2obj] Support MachO section and section_64
This re-applies r269845, r269846, and r269850 with an included fix for a crash reported by zturner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269953 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 16:17:23 +00:00
Rafael Espindola
2dc637165b Don't pass a Reloc::Model to MC.
MC only needs to know if the output is PIC or not. It never has to
decide about creating GOTs and PLTs for example. The only thing that
MC itself uses this information for is expanding "macros" in sparc and
mips. The rest I am pretty sure could be moved to CodeGen.

This is a cleanup and isolates the code from future changes to
Reloc::Model.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 11:58:50 +00:00
Igor Kudrin
24466cded7 [Coverage] Ensure that coverage mapping data has an expected alignment in 'covmapping' files.
Coverage mapping data is organized in a sequence of blocks, each of which is expected
to be aligned by 8 bytes. This feature is used when reading those blocks, see
VersionedCovMapFuncRecordReader::readFunctionRecords(). If a misaligned covearge
mapping data has more than one block, it causes llvm-cov to fail.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269887 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 07:43:27 +00:00
Rafael Espindola
36f243d8fa Delete default in fully covered switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 00:31:06 +00:00
Zachary Turner
60ce11fcce [codeview] Some cleanup of Symbol Records.
* Reworks the CVSymbolTypes.def to work similarly to TypeRecords.def.
* Moves some enums from SymbolRecords.h to CodeView.h to maintain
  consistency with how we do type records.
* Generalize a few simple things like the record prefix
* Define the leaf enum and the kind enum similar to how we do with tyep
  records.

Differential Revision: http://reviews.llvm.org/D20342
Reviewed By: amccarth, rnk

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:50:21 +00:00
David Blaikie
f84af69256 llvm-dwp: remove some unused error handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:44:13 +00:00
Zachary Turner
8e5ffc9803 Revert "[obj2yaml] [yaml2obj] Support MachO section and section_64
structs"

This reverts commits r269845, r269846, and r269850 as they
introduce a crash in obj2yaml when trying to do a roundtrip.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:38:22 +00:00
David Blaikie
34ab13fd25 llvm-dwp: Move error handling code closer to use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269864 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 23:37:44 +00:00