summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2017-12-15Don't crash in llvm-pdbutil when dumping TypeIndexes with high bit set.Zachary Turner
This is a special code that indicates that it's a function id. While I'm still not certain how to interpret these, we definitely should *not* be using these values as indices into an array directly. For now, when we encounter one of these, just print the numeric value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320775 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[WebAssembly] Add support for init functions linking metadataSam Clegg
Summary: This change lays the groundwork lowering of @llvm.global_ctors and @llvm.global_dtors for the wasm object format. Some parts of this patch are subset of: https://reviews.llvm.org/D40759 See https://github.com/WebAssembly/tool-conventions/issues/25 Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish Differential Revision: https://reviews.llvm.org/D41208 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320742 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[opt-viewer] Render utf-8 characters properly in the generated HTMLAdam Nemet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320729 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[opt-viewer] Support unicode characters in function namesAdam Nemet
This is a Swift feature. The output stream for the index page and the source HTML page is utf-8 now. The next patch will add the HTML magic to properly render these characters in the browser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320725 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13Recover some overzealously removed includes.Michael Zolotukhin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320648 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[WebAssembly] Add linking metatdata test coverage for wasm2yamlSam Clegg
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish Differential Revision: https://reviews.llvm.org/D41196 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13Remove redundant includes from tools.Michael Zolotukhin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320631 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[dsymutil] Re-enable threadingJonas Devlieghere
Threading was disabled in r317263 because it broke a test in combination with `-DLLVM_ENABLE_THREADS=OFF`. This was because a ThreadPool warning was piped to llvm-dwarfdump which was expecting to read an object from stdin. This patch re-enables threading and fixes the offending test. Unfortunately this required more than just moving the ThreadPool out of the for loop because of the TempFile refactoring that took place in the meantime. Differential revision: https://reviews.llvm.org/D41180 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320601 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13reverting out -r320532 because a warning is breaking the lld buildMichael Trent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent
Summary: llvm-objdump's Mach-O parser was updated in r306037 to display external relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O parser to display local relocations for MH_PRELOAD files. When used with the -macho option relocations will be displayed in a historical format. rdar://35778019 Reviewers: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41061 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320532 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12[dsymutil] Accept line tables up to DWARFv5.Jonas Devlieghere
This patch removes the hard-coded check for DWARFv2 line tables. Now dsymutil accepts line tables for DWARF versions 2 to 5 (inclusive). Differential revision: https://reviews.llvm.org/D41084 rdar://35968319 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320469 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11[llvm-cov] Add an option for "export" command to emit only file summary data.Max Moroz
Summary: That allows to get the same data as produced by "llvm-cov report", but in JSON format, which is better for further processing by end users. Reviewers: vsk Reviewed By: vsk Differential Revision: https://reviews.llvm.org/D41085 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320435 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08dwarfdump: Add support for the --diff option.Adrian Prantl
--diff Emit the output in a diff-friendly way by omitting offsets and addresses. <rdar://problem/34502625> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320214 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08[Debugify] Add a pass to test debug info preservationVedant Kumar
The Debugify pass synthesizes debug info for IR. It's paired with a CheckDebugify pass which determines how much of the original debug info is preserved. These passes make it easier to create targeted tests for debug info preservation. Here is the Debugify algorithm: NextLine = 1 for (Instruction &I : M) attach DebugLoc(NextLine++) to I NextVar = 1 for (Instruction &I : M) if (canAttachDebugValue(I)) attach dbg.value(NextVar++) to I The CheckDebugify pass expects contiguous ranges of DILocations and DILocalVariables. If it fails to find all of the expected debug info, it prints a specific error to stderr which can be FileChecked. This was discussed on llvm-dev in the thread: "Passes to add/validate synthetic debug info" Differential Revision: https://reviews.llvm.org/D40512 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320202 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08Reverting r320166 to fix test failures.Michael Trent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320174 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent
Summary: llvm-objdump's Mach-O parser was updated in r306037 to display external relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O parser to display local relocations for MH_PRELOAD files. When used with the -macho option relocations will be displayed in a historical format. rdar://35778019 Reviewers: enderby Reviewed By: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40867 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07[dsymutil] Add -verify option to run DWARF verifier after linking.Jonas Devlieghere
This patch adds support for running the DWARF verifier on the linked debug info files. If the -verify options is specified and verification fails, dsymutil exists with abort with non-zero exit code. This behavior is *not* enabled by default. Differential revision: https://reviews.llvm.org/D40777 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320033 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06Update obj2yaml and yaml2obj for .debug$H section.Zachary Turner
Differential Revision: https://reviews.llvm.org/D40842 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06[opt-viewer] Suppress noisy Swift remarksAdam Nemet
Most likely, this is not how we want to handle this in the long term. This code should probably be in the Swift repo and somehow plugged into the opt-viewer. This is still however very experimental at this point so I don't want to over-engineer it at this point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319902 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06Fix error in llvm-pdbutil.Zachary Turner
A recent change made this print the wrong value, breaking some tests. This is now fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05Teach llvm-pdbutil to dump types from object files.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05[CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai
We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05Test commit, as per the LLVM Developer Policy.Michael Trent
Commit message, as per the same policy. I added a blank space to the end of the file. Excelsior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319743 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-02[llvm-readobj] Remove redundant local variables to reduce the code. NFCSimon Atanasyan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-02[llvm-readobj] Print static MIPS GOTSimon Atanasyan
If a linked binary file contains a dynamic section, the GOT layout defined by the dynamic section entries. In a statically linked file the GOT is just a series of entries. This change teaches `llvm-readobj` to print the GOT in that case. That provides a feature parity with GNU `readelf`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319616 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-02[llvm-readobj] Delete unused method argument. NFCSimon Atanasyan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319615 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30[llvm] Add stripped installation targetsShoaib Meenai
CMake's generated installation scripts support `CMAKE_INSTALL_DO_STRIP` to enable stripping the installed binaries. LLVM's build system doesn't expose this option to the `install-` targets, but it's useful in conjunction with `install-distribution`. Add a new function to create the install targets, which creates both the regular install target and a second install target that strips during installation. Change the creation of all installation targets to use this new function. Stripping doesn't make a whole lot of sense for some installation targets (e.g. the LLVM headers), but consistency doesn't hurt. I'll make other repositories (e.g. clang, compiler-rt) use this in a follow-up, and then add an `install-distribution-stripped` target to actually accomplish the end goal of creating a stripped distribution. I don't want to do that step yet because the creation of that target would depend on the presence of the `install-*-stripped` target for each distribution component, and the distribution components from other repositories will be missing that target right now. Differential Revision: https://reviews.llvm.org/D40620 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319480 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30[llvm-objcopy] Add support for --only-keep/-j and --keepJake Ehrlich
This change adds support for the --only-keep option and the -j alias as well. A common use case for these being used together is to dump a specific section's data. Additionally the --keep option is added (GNU objcopy doesn't have this) to avoid removing a bunch of things. This allows people to err on the side of stripping aggressively and then to keep the specific bits that they need for their application. Differential Revision: https://reviews.llvm.org/D39021 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319467 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30Split TypeTableBuilder into two classes.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319456 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30[llvm-readobj] Fix mismatched line endingsZachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319453 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30[dsymutil] Exclude namespace from ifdef in CFBundleJonas Devlieghere
Should fix build failure introduced by r319416 on non-darwin hosts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30[dsymutil] Upstream getBundleInfo implementationJonas Devlieghere
This patch implements `getBundleInfo`, which uses CoreFoundation to obtain information about the CFBundle. This information is needed to populate the Plist in the dSYM bundle. This change only applies to darwin and is an NFC as far as other platforms are concerned. Differential revision: https://reviews.llvm.org/D40244 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319416 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29Make TypeTableBuilder inherit from TypeCollection.Zachary Turner
A couple of places in LLD were passing references to TypeTableCollections around, which makes it hard to change the implementation at runtime. However, these cases only needed to iterate over the types in the collection, and TypeCollection already provides a handy abstract interface for this purpose. By implementing this interface, we can get rid of the need to pass TypeTableBuilder references around, which should allow us to swap the implementation at runtime in subsequent patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319345 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29Fix line endings in llvm-pdbutil.cppZachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319340 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29Add opt-viewer testingAdam Nemet
Detects whether we have the Python modules (pygments, yaml) required by opt-viewer and hooks this up to REQUIRES. This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer testing). It's also related to https://github.com/apple/swift/pull/12938 and the idea is to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake. Differential Revision: https://reviews.llvm.org/D40202 Fixes since the first commit: 1. Disable syntax highlighting as different versions of pygments generate different HTML 2. Use llvm-cxxfilt from the build git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319324 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29llvm-dwarfdump: honor the --show-children option when dumping a specific DIE.Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319271 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-29Revert "Add opt-viewer testing"Adam Nemet
This reverts commit r319188. Breaks when c++filt is not available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319262 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-28[CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder.Zachary Turner
The motivation behind this patch is that future directions require us to be able to compute the hash value of records independently of actually using them for de-duplication. The current structure of TypeSerializer / TypeTableBuilder being a single entry point that takes an unserialized type record, and then hashes and de-duplicates it is not flexible enough to allow this. At the same time, the existing TypeSerializer is already extremely complex for this very reason -- it tries to be too many things. In addition to serializing, hashing, and de-duplicating, ti also supports splitting up field list records and adding continuations. All of this functionality crammed into this one class makes it very complicated to work with and hard to maintain. To solve all of these problems, I've re-written everything from scratch and split the functionality into separate pieces that can easily be reused. The end result is that one class TypeSerializer is turned into 3 new classes SimpleTypeSerializer, ContinuationRecordBuilder, and TypeTableBuilder, each of which in isolation is simple and straightforward. A quick summary of these new classes and their responsibilities are: - SimpleTypeSerializer : Turns a non-FieldList leaf type into a series of bytes. Does not do any hashing. Every time you call it, it will re-serialize and return bytes again. The same instance can be re-used over and over to avoid re-allocations, and in exchange for this optimization the bytes returned by the serializer only live until the caller attempts to serialize a new record. - ContinuationRecordBuilder : Turns a FieldList-like record into a series of fragments. Does not do any hashing. Like SimpleTypeSerializer, returns references to privately owned bytes, so the storage is invalidated as soon as the caller tries to re-use the instance. Works equally well for LF_FIELDLIST as it does for LF_METHODLIST, solving a long-standing theoretical limitation of the previous implementation. - TypeTableBuilder : Accepts sequences of bytes that the user has already serialized, and inserts them by de-duplicating with a hash table. For the sake of convenience and efficiency, this class internally stores a SimpleTypeSerializer so that it can accept unserialized records. The same is not true of ContinuationRecordBuilder. The user is required to create their own instance of ContinuationRecordBuilder. Differential Revision: https://reviews.llvm.org/D40518 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319198 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-28Add opt-viewer testingAdam Nemet
Detects whether we have the Python modules (pygments, yaml) required by opt-viewer and hooks this up to REQUIRES. This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer testing). It's also related to https://github.com/apple/swift/pull/12938 and the idea is to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake. Differential Revision: https://reviews.llvm.org/D40202 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319188 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular ↵David Blaikie
header as much as it is for stamping out some global/static variables git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319086 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27Rename CommandFlags.h -> CommandFlags.defDavid Blaikie
Since this isn't a real header - it includes static functions and had external linkage variables (though this change makes them static, since that's what they should be) so can't be included more than once in a program. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319082 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27[opt-viewer] Fix option nameAdam Nemet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319072 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27[llvm-objcopy] Add --strip-all-gnu and change --strip-allJake Ehrlich
GNU's --strip-all doesn't strip as aggressively as it could in general. Currently llvm-objcopy copies the exact behavoir of GNU's --strip-all. eu-strip is used as a drop in replacement for GNU strip/objcopy in many many places without issue. eu-strip removes non-allocated sections and keeps .gnu.warning* sections. Because --strip-all will likely be the most widely used stripping option we should make --strip-all as aggressive as it can safely be. Since we have evidence from eu-strip that this is a safe option we should allow it. For those that might still have an issue afterwards I've added --strip-all-gnu as an exact drop in replacement for GNU's --strip-all as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319071 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22Remove unnecessary code.Rafael Espindola
There is already an RAII in place to discard the temporary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-21xray-record-yaml.h: Remove unused fileDavid Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318715 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-21llvm-rc/ResourceScriptTokenList.h: Turns this into a .def file to imply that ↵David Blaikie
it's non-modular Also undef the macros at the end of the file to make it easier to use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318714 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17[llvm-profdata] Don't treat non-fatal merge errors as fatalVedant Kumar
This fixes an issue seen on the coverage bot: http://lab.llvm.org:8080/green/view/Experimental/job/clang-stage2-coverage-R/1930 Profile merging shouldn't fail if a single counter mismatch is detected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318555 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17llvm-demangle-fuzzer: Link in SupportJonas Hahnfeld
The refactoring in r318407 transiently includes abi-breaking.h which defines EnableABIBreakingChecks. This breaks my Debug build because this fuzzer did not link in Support with the symbol. Differential Revision: https://reviews.llvm.org/D40190 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318553 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17Try to fix the windows build.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318535 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17Use TempFile in dsymutil.Rafael Espindola
I don't think there is any functionality change, but the code is easier to understand IMHO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318534 91177308-0d34-0410-b5e6-96231b3b80d8