summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* build: add the ability to create a symlink for dsymutilSaleem Abdulrasool2018-02-281-2/+7
| | | | | | | | | Add a `LLVM_INSTALL_CCTOOLS_SYMLINKS` to mirror `LLVM_INSTALL_BINUTILS_SYMLINKS`. For now, this allows us to create symlinks for `dsymutil` to `llvm-dsymutil`. This option is off by default, but the user can enable it. llvm-svn: 326381
* [WebAssembly] Remove DataSize from linking metadata sectionSam Clegg2018-02-273-7/+0
| | | | | | | | | | | Neither the linker nor the runtime need this information anymore. We were originally using this to model BSS size but the plan is now to use the segment metadata to allow for BSS segments. Differential Revision: https://reviews.llvm.org/D41366 llvm-svn: 326267
* llvm-cvtres: Mention ARM64 as a supported machine type in the help text. NFC.Martin Storsjo2018-02-271-1/+1
| | | | llvm-svn: 326244
* [dsymutil] Skip DW_AT_sibling attributes.Jonas Devlieghere2018-02-271-2/+3
| | | | | | | | | | Following DW_AT_sibling attributes completely defeats the pruning pass. Although clang doesn't generate the DW_AT_sibling attribute we should still handle it correctly. Differential revision: https://reviews.llvm.org/D43439 llvm-svn: 326231
* [opt-viewer] Kill parser processes before moving onto renderingAdam Nemet2018-02-261-0/+2
| | | | | | The main benefit is that they release the memory they were holding onto. llvm-svn: 326127
* opt-diff: Support splitting to multiple output filesAdam Nemet2018-02-261-4/+11
| | | | | | | When reading the resulting files back with opt-viewer, they will be parsed in parallel. llvm-svn: 326126
* [opt-viewer] Set title for the source pagesAdam Nemet2018-02-261-1/+3
| | | | llvm-svn: 326125
* opt-viewer: also find thinlto opt.yaml filesAdam Nemet2018-02-261-1/+1
| | | | llvm-svn: 326124
* opt-viewer: output index firstAdam Nemet2018-02-261-7/+9
| | | | | | One can start looking at the index while the pages are still generating llvm-svn: 326123
* Fix build breakage from r326003Pavel Labath2018-02-241-2/+2
| | | | | | | | | | - an ambiguous reference to Optional<T> in llvm-dwarfdump.cpp (fixed with an explicit prefix). - a missing base class initialization in Entry copy constructor (fixed by using the implicitly default constructor, which is possible after some changes which were done during review). llvm-svn: 326006
* [llvm-objcopy] Fix typo in setSymTabAlexander Shaposhnikov2018-02-241-2/+3
| | | | | | | | | | | | This diff fixes the name of the argument of setSymTab and makes setSymTab/setStrTab private (to make the public interface a bit cleaner). Test plan: make check-all Differential revision: https://reviews.llvm.org/D43661 llvm-svn: 326005
* Implement equal_range for the DWARF v5 accelerator tablePavel Labath2018-02-241-12/+14
| | | | | | | | | | | | | | | | | | | Summary: This patch implements the name lookup functionality of the .debug_names accelerator table and hooks it up to "llvm-dwarfdump -find". To make the interface of the two kinds of accelerator tables more consistent, I've created an abstract "DWARFAcceleratorTable::Entry" class, which provides a consistent interface to access the common functionality of the table entries (such as getting the die offset, die tag, etc.). I've also modified the apple table to vend entries conforming to this interface. Reviewers: JDevlieghere, aprantl, probinson, dblaikie Subscribers: vleschuk, clayborg, echristo, llvm-commits Differential Revision: https://reviews.llvm.org/D43067 llvm-svn: 326003
* [DebugInfo] Support DWARF v5 source code embedding extensionScott Linder2018-02-231-10/+16
| | | | | | | | | | | | | | | | | | | In DWARF v5 the Line Number Program Header is extensible, allowing values with new content types. In this extension a content type is added, DW_LNCT_LLVM_source, which contains the embedded source code of the file. Add new optional attribute for !DIFile IR metadata called source which contains source text. Use this to output the source to the DWARF line table of code objects. Analogously extend METADATA_FILE in Bitcode and .file directive in ASM to support optional source. Teach llvm-dwarfdump and llvm-objdump about the new values. Update the output format of llvm-dwarfdump to make room for the new attribute on file_names entries, and support embedded sources for the -source option in llvm-objdump. Differential Revision: https://reviews.llvm.org/D42765 llvm-svn: 325970
* [WebAssembly] NDEBUG is spelled without a leading underscore.Benjamin Kramer2018-02-231-1/+1
| | | | llvm-svn: 325893
* [WebAssembly] Add first claass symbol table to wasm objectsSam Clegg2018-02-233-24/+56
| | | | | | | | | | | | | | | | | | | | This is combination of two patches by Nicholas Wilson: 1. https://reviews.llvm.org/D41954 2. https://reviews.llvm.org/D42495 Along with a few local modifications: - One change I made was to add the UNDEFINED bit to the binary format to avoid the extra byte used when writing data symbols. Although this bit is redundant for other symbols types (i.e. undefined can be implied if a function or global is a wasm import) - I prefer to be explicit and consistent and not have derived flags. - Some field renaming. - Some reverting of unrelated minor changes. - No test output differences. Differential Revision: https://reviews.llvm.org/D43147 llvm-svn: 325860
* Fix llvm-pdbutil to handle new built-in typesAdrian McCarthy2018-02-221-0/+4
| | | | | | | | | | | | | | | | Summary: The built-in PDB types enum has been extended to include char16_t and char32_t. llvm-pdbutil was hitting an llvm_unreachable because it didn't know about these new values. The new values are not yet in the DIA documentation, but are listed in the cvconst.h header that comes as part of the DIA SDK. Reviewers: asmith, zturner, rnk Subscribers: stella.stamenova, llvm-commits, sanjoy Differential Revision: https://reviews.llvm.org/D43646 llvm-svn: 325838
* [ThinLTO/gold] Perform cache pruning when cache directory specifiedTeresa Johnson2018-02-221-1/+1
| | | | | | | | | | | | | | | Summary: As pointed out in the review for D37993, for consistency with other linkers, gold plugin should perform cache pruning whenever there is a cache directory specified, which will use the default cache policy. Reviewers: pcc Subscribers: llvm-commits, inglorion Differential Revision: https://reviews.llvm.org/D43389 llvm-svn: 325830
* [ThinLTO] Always create linked objects file for --thinlto-index-only=Vitaly Buka2018-02-222-8/+34
| | | | | | | | | | | | | | | Summary: ThinLTO indexing may decide to skip all objects. If we don't write something to the list build system may consider this as failure or linker can reuse a file from the previews build. Reviewers: pcc, tejohnson Subscribers: mehdi_amini, inglorion, eraman, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D43415 llvm-svn: 325819
* [gold] Extract runLTO to avoid exit(0) from function with non-trivial ↵Vitaly Buka2018-02-221-17/+23
| | | | | | | | | | | | objects on the stack Reviewers: tejohnson, pcc Subscribers: inglorion, llvm-commits Differential Revision: https://reviews.llvm.org/D43537 llvm-svn: 325818
* [dsymutil] Remove \brief from comments. NFCJonas Devlieghere2018-02-224-29/+23
| | | | | | | With autobrief enabled, these server no purpose anymore. Most of them were already removed but this makes everything consistent. llvm-svn: 325769
* [dsymutil] Fix typos and formatting. NFC.Jonas Devlieghere2018-02-2210-254/+238
| | | | | | | Some over-due gardening: this fixes a bunch of typos and makes the formatting consistent with LLVM's style guide. llvm-svn: 325768
* [dsymutil] Replace PATH_MAX in SmallString with fixed value.Jonas Devlieghere2018-02-221-3/+3
| | | | | | | | | | | Apparently the Windows bots don't know this define, so just going with a sensible default. Failing builds: http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/19179 http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/19263 llvm-svn: 325762
* [dsymutil] Be smarter in caching calls to realpathJonas Devlieghere2018-02-221-17/+44
| | | | | | | | | | | | | | | | | | | Calling realpath is expensive but necessary to perform the uniqueing in dsymutil. Although we already cached the results for every individual file in the line table, we had reports of it taking 40 seconds of a 3.5 minute link. This patch adds a second level of caching. When we do have to call realpath, we cache its result for its parents path. We didn't replace the existing caching, because it's fast (indexed) and saves us from reading the line table for entries we've already seen. For WebkitCore this results in a decrease of 11% in linking time: from 85.79 to 76.11 seconds (average over 3 runs). Differential revision: https://reviews.llvm.org/D43511 llvm-svn: 325757
* [NFC] fix trivial typos in commentsHiroshi Inoue2018-02-221-1/+1
| | | | | | "a a" -> "a" llvm-svn: 325752
* Revert "[IRMover] Implement name based structure type mapping"Rafael Espindola2018-02-211-8/+1
| | | | | | | | This reverts commit r325686. There was a misunderstanding and this has not been approved yet. llvm-svn: 325715
* Fix a memory leak and a cross module reference.Rafael Espindola2018-02-211-1/+2
| | | | llvm-svn: 325712
* [IRMover] Implement name based structure type mappingEugene Leviant2018-02-211-1/+8
| | | | | | Differential revision: https://reviews.llvm.org/D43199 llvm-svn: 325686
* [LTO] Remove unused Path parameter to AddBufferFnTeresa Johnson2018-02-202-4/+2
| | | | | | | | | | | | | | | Summary: With D43396, no clients use the Path parameter anymore. Depends on D43396. Reviewers: pcc Subscribers: mehdi_amini, inglorion, llvm-commits Differential Revision: https://reviews.llvm.org/D43400 llvm-svn: 325619
* [ThinLTO/gold] Avoid race with cache pruner by copying to temp filesTeresa Johnson2018-02-201-3/+1
| | | | | | | | | | | | | | | | | | | Summary: This will avoid the race condition described in the review for D37993. I believe that the Path parameter to AddBufferFn is no longer utilized. I would prefer to remove that as a follow up clean up patch to reduce the diffs in this patch. Reviewers: pcc Reviewed By: pcc Subscribers: inglorion, llvm-commits Differential Revision: https://reviews.llvm.org/D43396 llvm-svn: 325618
* [llvm-objdump] Use unique_ptr to simplify memory ownershipDavid Blaikie2018-02-201-34/+31
| | | | | | Followup to r325099/r325100 to simplify further. llvm-svn: 325612
* [dsymutil] Correctly handle DW_TAG_labelJonas Devlieghere2018-02-201-1/+28
| | | | | | | | | This patch contains logic for handling DW_TAG_label that's present in darwin's dsymutil implementation, but not yet upstream. Differential revision: https://reviews.llvm.org/D43438 llvm-svn: 325600
* Report fatal error in the case of out of memorySerge Pavlov2018-02-202-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the second part of recommit of r325224. The previous part was committed in r325426, which deals with C++ memory allocation. Solution for C memory allocation involved functions `llvm::malloc` and similar. This was a fragile solution because it caused ambiguity errors in some cases. In this commit the new functions have names like `llvm::safe_malloc`. The relevant part of original comment is below, updated for new function names. Analysis of fails in the case of out of memory errors can be tricky on Windows. Such error emerges at the point where memory allocation function fails, but manifests itself when null pointer is used. These two points may be distant from each other. Besides, next runs may not exhibit allocation error. In some cases memory is allocated by a call to some of C allocation functions, malloc, calloc and realloc. They are used for interoperability with C code, when allocated object has variable size and when it is necessary to avoid call of constructors. In many calls the result is not checked for null pointer. To simplify checks, new functions are defined in the namespace 'llvm': `safe_malloc`, `safe_calloc` and `safe_realloc`. They behave as corresponding standard functions but produce fatal error if allocation fails. This change replaces the standard functions like 'malloc' in the cases when the result of the allocation function is not checked for null pointer. Finally, there are plain C code, that uses malloc and similar functions. If the result is not checked, assert statement is added. Differential Revision: https://reviews.llvm.org/D43010 llvm-svn: 325551
* [llvm-objcopy] Use the full filename in --add-gnu-debuglinkAlexander Richardson2018-02-191-2/+2
| | | | | | | | | | | | | | | | | Summary: The current implementation was writing the file name without the extension whereas GNU objcopy writes the full filename. With this change GDB will now load the .debug file instead of silently ignoring it. Reviewers: jakehehrlich, jhenderson Reviewed By: jakehehrlich Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43474 llvm-svn: 325528
* [CodeGen] Refactor AppleAccelTablePavel Labath2018-02-191-21/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit separates the abstract accelerator table data structure from the code for writing out an on-disk representation of a specific accelerator table format. The idea is that former (now called AccelTable<T>) can be reused for the DWARF v5 accelerator tables as-is, without any further customizations. Some bits of the emission code (now living in the EmissionContext class) can be reused for DWARF v5 as well, but the subtle differences in the layout of various subtables mean the sharing is not always possible. (Also, the individual emit*** functions are fairly simple so there's a tradeoff between making a bigger general-purpose function, and two smaller targeted functions.) Another advantage of this setup is that more of the serialization logic can be hidden in the .cpp file -- I have moved declarations of the header and all the emission functions there. Reviewers: JDevlieghere, aprantl, probinson, dblaikie Subscribers: echristo, clayborg, vleschuk, llvm-commits Differential Revision: https://reviews.llvm.org/D43285 llvm-svn: 325516
* [ThinLTO] Allow indexing to request backend to ignore the moduleVitaly Buka2018-02-161-3/+19
| | | | | | | | | | | | | | | | | | Summary: Gold plugin does not add pass to ThinLTO modules without useful symbols. In this case ThinLTO can't create corresponding index file and some features, like CFI, cannot be processes by backed correctly without index. Given that we don't need the backed output we can request it to avoid processing the module. This is implemented by this patch using new "SkipModuleByDistributedBackend" flag. Reviewers: pcc, tejohnson Subscribers: mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D42995 llvm-svn: 325411
* AMDGPU: Bring elf flags in sync with the specKonstantin Zhuravlyov2018-02-161-4/+32
| | | | | | | | | | | - Add MACH flags - Add XNACK flag - Add reserved flags - Minor cleanups in docs Differential Revision: https://reviews.llvm.org/D43356 llvm-svn: 325399
* Fix emission of PDB string table.Zachary Turner2018-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was originally reported as a bug with the symptom being "cvdump crashes when printing an LLD-linked PDB that has an S_FILESTATIC record in it". After some additional investigation, I determined that this was a symptom of a larger problem, and in fact the real problem was in the way we emitted the global PDB string table. As evidence of this, you can take any lld-generated PDB, run cvdump -stringtable on it, and it would return no results. My hypothesis was that cvdump could not *find* the string table to begin with. Normally it would do this by looking in the "named stream map", finding the string /names, and using its value as the stream index. If this lookup fails, then cvdump would fail to load the string table. To test this hypothesis, I looked at the name stream map generated by a link.exe PDB, and I emitted exactly those bytes into an LLD-generated PDB. Suddenly, cvdump could read our string table! This code has always been hacky and we knew there was something we didn't understand. After all, there were some comments to the effect of "we have to emit strings in a specific order, otherwise things don't work". The key to fixing this was finally understanding this. The way it works is that it makes use of a generic serializable hash map that maps integers to other integers. In this case, the "key" is the offset into a buffer, and the value is the stream number. If you index into the buffer at the offset specified by a given key, you find the name. The underlying cause of all these problems is that we were using the identity function for the hash. i.e. if a string's offset in the buffer was 12, the hash value was 12. Instead, we need to hash the string *at that offset*. There is an additional catch, in that we have to compute the hash as a uint32 and then truncate it to uint16. Making this work is a little bit annoying, because we use the same hash table in other places as well, and normally just using the identity function for the hash function is actually what's desired. I'm not totally happy with the template goo I came up with, but it works in any case. The reason we never found this bug through our own testing is because we were building a /parallel/ hash table (in the form of an llvm::StringMap<>) and doing all of our lookups and "real" hash table work against that. I deleted all of that code and now everything goes through the real hash table. Then, to test it, I added a unit test which adds 7 strings and queries the associated values. I test every possible insertion order permutation of these 7 strings, to verify that it really does work as expected. Differential Revision: https://reviews.llvm.org/D43326 llvm-svn: 325386
* Allow 0 to be a valid value pruning interval in C LTO API. Value 0 will ↵Ekaterina Romanova2018-02-151-1/+2
| | | | | | cause garbage collector to run. This matches the behavior in C++ LTO API. llvm-svn: 325303
* [Debugify] Don't check functions which were skippedVedant Kumar2018-02-151-1/+11
| | | | | | | If no debug info was applied to a function, its debug info shouldn't be checked (it doesn't have any :). llvm-svn: 325297
* [opt] Port the debugify passes to the new pass managerVedant Kumar2018-02-155-7/+53
| | | | llvm-svn: 325294
* Revert r325224 "Report fatal error in the case of out of memory"Serge Pavlov2018-02-152-5/+1
| | | | | | It caused fails on some buildbots. llvm-svn: 325227
* Report fatal error in the case of out of memorySerge Pavlov2018-02-152-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis of fails in the case of out of memory errors can be tricky on Windows. Such error emerges at the point where memory allocation function fails, but manifests itself when null pointer is used. These two points may be distant from each other. Besides, next runs may not exhibit allocation error. Usual programming practice does not require checking result of 'operator new' because it throws 'std::bad_alloc' in the case of allocation error. However, LLVM is usually built with exceptions turned off, so 'new' can return null pointer. This change installs custom new handler, which causes fatal error in the case of out of memory. The handler is installed automatically prior to call to 'main' during construction of a static object defined in 'lib/Support/ErrorHandling.cpp'. If the application does not use this file, the handler may be installed manually by a call to 'llvm::install_out_of_memory_new_handler', declared in 'include/llvm/Support/ErrorHandling.h". There are calls to C allocation functions, malloc, calloc and realloc. They are used for interoperability with C code, when allocated object has variable size and when it is necessary to avoid call of constructors. In many calls the result is not checked against null pointer. To simplify checks, new functions are defined in the namespace 'llvm' with the same names as these C function. These functions produce fatal error if allocation fails. User should use 'llvm::malloc' instead of 'std::malloc' in order to use the safe variant. This change replaces 'std::malloc' in the cases when the result of allocation function is not checked against null pointer. Finally, there are plain C code, that uses malloc and similar functions. If the result is not checked, assert statements are added. Differential Revision: https://reviews.llvm.org/D43010 llvm-svn: 325224
* [llvm-objcopy] Fix handling of zero-size segments in llvm-objcopyJake Ehrlich2018-02-142-28/+70
| | | | | | | | | | | | | | | | | Some ELF files produced by lld may have zero-size segment placeholders as shown below. Since GNU_STACK Offset is 0, the current code makes it the lowest used offset, and relocates all the segments over the ELF header. The resulting binary is total garbage. This change fixes how llvm-objcopy handles PT_PHDR properlly by treating ELF headers and the program header table as segments to allow the layout algorithm decide where those should go. Author: vit9696 Differential Revision: https://reviews.llvm.org/D42872 llvm-svn: 325189
* [ThinLTO/CFI] Include TYPE_ID summaries into GLOBALVAL_SUMMARY_BLOCKVitaly Buka2018-02-141-0/+1
| | | | | | | | | | | | | | Summary: TypeID summaries are used by CFI and need to be serialized by ThinLTO indexing for later use by LTO Backend. Reviewers: tejohnson, pcc Subscribers: mehdi_amini, inglorion, eraman, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D42611 llvm-svn: 325182
* [ORC] Consolidate RTDyldObjectLinkingLayer GetMemMgr and GetResolver into aLang Hames2018-02-141-5/+4
| | | | | | | | | unified GetResources callback. Having a single 'GetResources' callback will simplify adding new resources in the future. llvm-svn: 325180
* [ORC] Switch to shared_ptr ownership for AsynchronousSymbolQueries.Lang Hames2018-02-141-2/+2
| | | | | | | Queries need to stay alive until each owner has set the values they are responsible for. llvm-svn: 325179
* Change the BugDriver to store the current module with std::unique_ptr.Rafael Espindola2018-02-148-207/+185
| | | | | | | | | While there, change a bunch of helper functions to take references to avoid adding calls to get(). This should conclude the bugpoint yak shaving. llvm-svn: 325177
* Use std::uniue_ptr. NFC.Rafael Espindola2018-02-141-4/+4
| | | | llvm-svn: 325176
* Use std::unique_ptr. NFC.Rafael Espindola2018-02-141-12/+6
| | | | llvm-svn: 325174
* Use std::unique_ptr. NFC.Rafael Espindola2018-02-141-6/+5
| | | | llvm-svn: 325173
OpenPOWER on IntegriCloud