summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [ThinLTO/gold] Handle bitcode archivesTeresa Johnson2016-05-262-53/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Several changes were required for ThinLTO links involving bitcode archive static libraries. With this patch clang/llvm bootstraps with ThinLTO and gold. The first is that the gold callbacks get_input_file and release_input_file can normally be used to get file information for each constituent bitcode file within an archive. However, these interfaces lock the underlying file and can't be for each archive constituent for ThinLTO backends where we get all the input files up front and don't release any until after the backend threads complete. However, it is sufficient to only get and release once per file, and then each consituent bitcode file can be accessed via get_view. This required saving some information to identify which file handle is the "leader" for each claimed file sharing the same file descriptor, and other information so that get_input_file isn't necessary later when processing the backends. Second, the module paths in the index need to distinguish between different constituent bitcode files within the same archive file, otherwise they will all end up with the same archive file path. Do this by appending the offset within the archive for the start of the bitcode file, returned by get_input_file when we claim each bitcode file, and saving that along with the file handle. Third, rather than have the function importer try to load a file based on the module path identifier (which now contains a suffix to distinguish different bitcode files within an archive), use a custom module loader. This is the same approach taken in libLTO, and I am using the support refactored into the new LTO.h header in r270509. The module loader parses the bitcode files out of the memory buffers returned from gold via the get_view callback and saved in a map. This also means that we call the function importer directly, rather than add it to the pass pipeline (which was in the plan to do already for other reasons). Reviewers: pcc, joker.eph Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D20559 llvm-svn: 270814
* llvm-objdump: support dumping AUX records for weak externalsSaleem Abdulrasool2016-05-261-0/+7
| | | | | | | | | | | | 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). This reapplies the previous patch with a modification which hopefully should fix the endianness issues. The variadic call would promote the ulittle32_t to a uint32_t which would lose the byte-swapping behaviour desired. llvm-svn: 270813
* llvm-dwp: Ensure uncompressed sections are not relocated during processing ↵David Blaikie2016-05-251-3/+4
| | | | | | | | | | | | | | | | | | | | of later inputs Richard Smith identified this in post commit review of r270466. The string sections in particular (in the future, possibly all sections - so I'm not going to bother pulling out just the string sections for the extra lifetime handling right now) need to remain valid during processing of all inputs so that elements of the DWPStringPool can be looked up repeatedly without having to make in-memory copies of string contents in the noncompressed case (more common in dwp+dwp merge steps where the memory is a bigger problem because the files are larger). Using the SmallVector (or any vector) a reallocation on push_back could cause any of the nested SmallStrings in small mode to move in memory and invalid pointers to their contents. Using a deque the SmallStrings will never move around since no elements are removed from the container. llvm-svn: 270797
* [codeview] Move StreamInterface and StreamReader to libcodeview.Zachary Turner2016-05-251-3/+3
| | | | | | | | | | We have need to reuse this functionality, including making additional generic stream types that are smarter about how and when they copy memory versus referencing the original memory. So all of these structures belong in the common library rather than being pdb specific. llvm-svn: 270751
* [llvm-pdbdump] Dump raw stream contents as binary block.Zachary Turner2016-05-251-2/+3
| | | | | | Dumping it as ASCII makes it fairly useless. llvm-svn: 270742
* [obj2yaml] [yaml2obj] MachO support for rebase opcodesChris Bieneman2016-05-252-21/+120
| | | | | | This is the first bit of support for MachO __LINKEDIT segment data. llvm-svn: 270724
* [CMake] LINK_LIBS need to be public for Darwin dylib targetsChris Bieneman2016-05-251-0/+11
| | | | | | This should actually address PR27855. This results in adding references to the system libs inside generated dylibs so that they get correctly pulled in when linking against the dylib. llvm-svn: 270723
* [RuntimeDyld] Call the SymbolResolver::findSymbolInLogicalDylib method whenLang Hames2016-05-252-3/+3
| | | | | | | | | | | | | | | | | searching for external symbols, and fall back to the SymbolResolver::findSymbol method if the former returns null. This makes RuntimeDyld behave more like a static linker: Symbol definitions from within the current module's "logical dylib" will be preferred to external definitions. We can build on this behavior in the future to properly support weak symbol handling. Custom symbol resolvers that override the findSymbolInLogicalDylib method may notice changes due to this patch. Clients who have not overridden this method should generally be unaffected, however users of the OrcMCJITReplacement class may notice changes. llvm-svn: 270716
* [llvm-pdbdump] Decipher the remaining PDB streams.Zachary Turner2016-05-251-0/+22
| | | | | | | We know at least know the meaning of every stream of the PDB file. Yay! llvm-svn: 270669
* Revert "llvm-objdump: support dumping AUX records for weak externals"Saleem Abdulrasool2016-05-251-6/+0
| | | | | | Revert it until we can figure out the endianness issue. llvm-svn: 270667
* [llvm-pdbdump] Dump the IPI stream and all records.Zachary Turner2016-05-251-20/+60
| | | | llvm-svn: 270661
* [llvm-pdbdump] Stream 0 isn't actually the MSF superblock.Zachary Turner2016-05-251-4/+9
| | | | | | | Oddly enough, I realized we don't actually know what stream 0 is (if anything). llvm-svn: 270655
* [llvm-pdbdump] Dump stream summary list.Zachary Turner2016-05-251-13/+78
| | | | | | | | | 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. llvm-svn: 270653
* llvm-objdump: support dumping AUX records for weak externalsSaleem Abdulrasool2016-05-251-0/+6
| | | | | | | | 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). llvm-svn: 270648
* [codeview] Add support for new type records.Zachary Turner2016-05-241-2/+2
| | | | | | | | | | | | | | | | | | | 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. llvm-svn: 270628
* Remove unused global variable.Zachary Turner2016-05-241-11/+0
| | | | llvm-svn: 270610
* [llvm-pdbdump] Rework command line options.Zachary Turner2016-05-241-71/+110
| | | | | | | | | 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. llvm-svn: 270607
* Add FIXMEs to all derived classes of std::error_category.Peter Collingbourne2016-05-243-0/+9
| | | | | | | | This helps make clear that we're moving away from std::error_code. Differential Revision: http://reviews.llvm.org/D20592 llvm-svn: 270604
* [codeview, pdb] Dump symbol records in publics streamZachary Turner2016-05-241-3/+12
| | | | | | | Differential Revision: http://reviews.llvm.org/D20580 Reviewed By: ruiu llvm-svn: 270597
* Dump symbol record details in llvm-pdbdumpZachary Turner2016-05-241-20/+48
| | | | | | | | | | | | | 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 llvm-svn: 270585
* Remove unused variable breaking -Werror builds.Zachary Turner2016-05-241-2/+1
| | | | llvm-svn: 270529
* Make a symbol visitor and use it to dump CV symbols.Zachary Turner2016-05-231-732/+51
| | | | | | | Differential Revision: http://reviews.llvm.org/D20534 Reviewed By: rnk llvm-svn: 270511
* llvm-dwp: Reduce indentationDavid Blaikie2016-05-231-48/+47
| | | | llvm-svn: 270507
* llvm-dwp: Split out processing of input sections to improve readabilityDavid Blaikie2016-05-231-61/+84
| | | | llvm-svn: 270503
* Tweak to change in r270491 to deal with the lld-x86_64-darwin13 bot having a ↵Kevin Enderby2016-05-231-0/+4
| | | | | | | | old xar.h header. Reviewed the change with Chris Bieneman and Pete Cooper. llvm-svn: 270502
* llvm-dwp: Pull out compression handling helperDavid Blaikie2016-05-231-15/+22
| | | | llvm-svn: 270496
* Add the printing the Mach-O (__LLVM,__bundle) xar archive file section ↵Kevin Enderby2016-05-231-0/+383
| | | | | | | | | | | | | "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 llvm-svn: 270491
* [codeview] Refactor symbol records to use same pattern as types.Zachary Turner2016-05-231-274/+325
| | | | | | | | | | | 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 llvm-svn: 270475
* llvm-dwp: More error handling around invalid compressed sectionsDavid Blaikie2016-05-231-7/+4
| | | | llvm-svn: 270466
* llvm-dwp: Ensure compressed sections are preserved long enough for use in ↵David Blaikie2016-05-231-2/+2
| | | | | | | | | | | | | | | | 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. llvm-svn: 270462
* llvm-dwp: Fix the build by moving DWPStringPool into the llvm namespaceDavid Blaikie2016-05-231-0/+2
| | | | llvm-svn: 270453
* [profile] show more statisticsXinliang David Li2016-05-231-1/+14
| | | | | | Add value profile statistics with the 'show' command. llvm-svn: 270450
* llvm-dwp: Add an abstraction for the DWP string poolDavid Blaikie2016-05-233-30/+88
| | | | | | | Also reference strings in the memory mapped file, reduces memory usage on a large test case by 18.5%. llvm-svn: 270449
* [llvm-readobj] - Teach readobj to recognize SHF_COMPRESSED flag.George Rimar2016-05-211-2/+10
| | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 270320
* [yaml2obj] [MachO] Fill Segment and Section dataChris Bieneman2016-05-201-7/+61
| | | | | | | | 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. llvm-svn: 270286
* dsymutil/modules: Reword the warning for static libraries without module cachesAdrian Prantl2016-05-201-3/+5
| | | | | | | | | | | | 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 llvm-svn: 270269
* pdbdump: print out symbol names referred by publics stream.Rui Ueyama2016-05-201-0/+1
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 270262
* [yaml2obj] Removing debug code that scribbled 0xDEADBEEFChris Bieneman2016-05-191-4/+3
| | | | | | | | 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. llvm-svn: 270158
* Remove specializations of ProfileSummaryEaswaran Raman2016-05-191-4/+3
| | | | | | | | This removes the subclasses of ProfileSummary, moves the members of the derived classes to the base class. Differential Revision: http://reviews.llvm.org/D20390 llvm-svn: 270143
* Move ProfileSummary to IR.Easwaran Raman2016-05-191-9/+10
| | | | | | | | 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 llvm-svn: 270136
* [obj2yaml] [yaml2obj] Support for MachO Load Command dataChris Bieneman2016-05-192-27/+136
| | | | | | | | | | | | | | 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. llvm-svn: 270124
* Revert "[obj2yaml] [yaml2obj] Support for MachO Load Command data"Chris Bieneman2016-05-192-136/+27
| | | | | | | | This reverts commit r270115. This failed on several builders using GCC. llvm-svn: 270121
* [obj2yaml] [yaml2obj] Support for MachO Load Command dataChris Bieneman2016-05-192-27/+136
| | | | | | | | | | | | 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. llvm-svn: 270115
* [ARM, AArch64] Properly initialize InterleavedAccessPassMatthew Simpson2016-05-191-0/+1
| | | | | | | InterleavedAccessPass is an IR-level pass, so this change will enable testing it with opt. This is part of D20250. llvm-svn: 270101
* pdbdump: Rename NumberOfSymbols -> SymbolRecordStreamIndex.Rui Ueyama2016-05-191-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D20441 llvm-svn: 270088
* CodeGen: Make the global-merge pass independently testable, and add a test.Peter Collingbourne2016-05-191-0/+1
| | | | llvm-svn: 270023
* Retry^3 "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"Vedant Kumar2016-05-192-30/+43
| | | | | | | | | | | | | | | 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 llvm-svn: 270020
* [obj2yaml] Refactoring of dumping MachO section structsChris Bieneman2016-05-181-34/+44
| | | | | | 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. llvm-svn: 270001
* Delete Reloc::Default.Rafael Espindola2016-05-187-26/+22
| | | | | | | | | | | | 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. llvm-svn: 269988
* pdbdump: Print out section offsets in the publics stream.Rui Ueyama2016-05-181-0/+1
| | | | llvm-svn: 269955
OpenPOWER on IntegriCloud