summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Test commit, as per the LLVM Developer Policy.Michael Trent2017-12-051-0/+1
| | | | | | | Commit message, as per the same policy. I added a blank space to the end of the file. Excelsior. llvm-svn: 319743
* [llvm-readobj] Remove redundant local variables to reduce the code. NFCSimon Atanasyan2017-12-021-9/+5
| | | | llvm-svn: 319617
* [llvm-readobj] Print static MIPS GOTSimon Atanasyan2017-12-021-30/+55
| | | | | | | | | | 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`. llvm-svn: 319616
* [llvm-readobj] Delete unused method argument. NFCSimon Atanasyan2017-12-021-8/+9
| | | | llvm-svn: 319615
* [llvm] Add stripped installation targetsShoaib Meenai2017-11-301-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 319480
* [llvm-objcopy] Add support for --only-keep/-j and --keepJake Ehrlich2017-11-302-0/+55
| | | | | | | | | | | | | 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 llvm-svn: 319467
* Split TypeTableBuilder into two classes.Zachary Turner2017-11-304-21/+24
| | | | llvm-svn: 319456
* [llvm-readobj] Fix mismatched line endingsZachary Turner2017-11-301-7/+7
| | | | llvm-svn: 319453
* [dsymutil] Exclude namespace from ifdef in CFBundleJonas Devlieghere2017-11-301-0/+2
| | | | | | Should fix build failure introduced by r319416 on non-darwin hosts. llvm-svn: 319417
* [dsymutil] Upstream getBundleInfo implementationJonas Devlieghere2017-11-304-17/+255
| | | | | | | | | | | | | 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 llvm-svn: 319416
* Make TypeTableBuilder inherit from TypeCollection.Zachary Turner2017-11-292-6/+6
| | | | | | | | | | | | | | 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. llvm-svn: 319345
* Fix line endings in llvm-pdbutil.cppZachary Turner2017-11-291-11/+11
| | | | llvm-svn: 319340
* Add opt-viewer testingAdam Nemet2017-11-293-24/+44
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 319324
* llvm-dwarfdump: honor the --show-children option when dumping a specific DIE.Adrian Prantl2017-11-291-1/+8
| | | | llvm-svn: 319271
* Revert "Add opt-viewer testing"Adam Nemet2017-11-291-19/+10
| | | | | | | | This reverts commit r319188. Breaks when c++filt is not available. llvm-svn: 319262
* [CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder.Zachary Turner2017-11-282-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 319198
* Add opt-viewer testingAdam Nemet2017-11-281-10/+19
| | | | | | | | | | | | | | | 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 llvm-svn: 319188
* Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular ↵David Blaikie2017-11-274-4/+4
| | | | | | header as much as it is for stamping out some global/static variables llvm-svn: 319086
* Rename CommandFlags.h -> CommandFlags.defDavid Blaikie2017-11-279-10/+10
| | | | | | | | | 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. llvm-svn: 319082
* [opt-viewer] Fix option nameAdam Nemet2017-11-271-1/+1
| | | | llvm-svn: 319072
* [llvm-objcopy] Add --strip-all-gnu and change --strip-allJake Ehrlich2017-11-271-3/+19
| | | | | | | | | | | | | | 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. llvm-svn: 319071
* Remove unnecessary code.Rafael Espindola2017-11-221-3/+0
| | | | | | There is already an RAII in place to discard the temporary. llvm-svn: 318868
* xray-record-yaml.h: Remove unused fileDavid Blaikie2017-11-211-102/+0
| | | | llvm-svn: 318715
* llvm-rc/ResourceScriptTokenList.h: Turns this into a .def file to imply that ↵David Blaikie2017-11-215-16/+9
| | | | | | | | it's non-modular Also undef the macros at the end of the file to make it easier to use. llvm-svn: 318714
* [llvm-profdata] Don't treat non-fatal merge errors as fatalVedant Kumar2017-11-171-7/+43
| | | | | | | | | 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. llvm-svn: 318555
* llvm-demangle-fuzzer: Link in SupportJonas Hahnfeld2017-11-171-0/+1
| | | | | | | | | | 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 llvm-svn: 318553
* Try to fix the windows build.Rafael Espindola2017-11-171-2/+2
| | | | llvm-svn: 318535
* Use TempFile in dsymutil.Rafael Espindola2017-11-171-60/+49
| | | | | | | I don't think there is any functionality change, but the code is easier to understand IMHO. llvm-svn: 318534
* [llvm-profdata] Fix a dangling reference to an error stringVedant Kumar2017-11-171-3/+11
| | | | llvm-svn: 318502
* Fix a bunch more layering of CodeGen headers that are in TargetDavid Blaikie2017-11-171-2/+1
| | | | | | | | All these headers already depend on CodeGen headers so moving them into CodeGen fixes the layering (since CodeGen depends on Target, not the other way around). llvm-svn: 318490
* Don't #include MemoryBuffer.h from Host.h.Zachary Turner2017-11-174-0/+6
| | | | | | | | | | It turns out this #include isn't used from Host.h anyway, but by having it it causes circular include dependencies. This issues only surfaced while I was working on a separate patch, so I'm submitting this first so that it's independent of the other, unrelated patch. llvm-svn: 318489
* [Support] Support NetBSD PaX MPROTECT in sys::Memory.Lang Hames2017-11-161-12/+26
| | | | | | | | | Removes AllocateRWX, setWritable and setExecutable from sys::Memory and standardizes on allocateMappedMemory / protectMappedMemory. The allocateMappedMemory method is updated to request full permissions for memory blocks so that they can be marked executable later. llvm-svn: 318464
* Attempt to fix inscrutible build break...David Blaikie2017-11-161-1/+1
| | | | llvm-svn: 318463
* llvm-readobj/ARMEHABIPrinter.h: Make this a real/modular headerDavid Blaikie2017-11-161-62/+79
| | | | | | | Had several non-inline/strong function definitions that needed to be marked inline, etc. llvm-svn: 318461
* Convert the last use of sys::fs::createUniqueFile in bugpoint.Rafael Espindola2017-11-161-14/+8
| | | | llvm-svn: 318459
* Convert another use of createUniqueFile to TempFile::create.Rafael Espindola2017-11-164-12/+25
| | | | | | | This one requires a new small feature in TempFile: the ability to keep the temporary file with the temporary name. llvm-svn: 318458
* Add ELF dynamic symbol support to yaml2obj/obj2yamlDave Lee2017-11-163-40/+92
| | | | | | | | | | | | | | | | | | Summary: This change introduces a `DynamicSymbols` field to the ELF specific YAML supported by `yaml2obj` and `obj2yaml`. This grouping of symbols provides a way to represent ELF dynamic symbols. The `DynamicSymbols` structure is identical to the existing `Symbols`. Reviewers: compnerd, jakehehrlich, silvas Reviewed By: silvas Subscribers: silvas, jakehehrlich, llvm-commits Differential Revision: https://reviews.llvm.org/D39582 llvm-svn: 318433
* make exitDsymutil static.Rafael Espindola2017-11-163-17/+23
| | | | | | | | | The objective is to remove it completelly. This first patch removes the last use outside dsymutil.cpp and makes it static. llvm-svn: 318429
* Convert another use of createUniqueFile to TempFile::create.Rafael Espindola2017-11-164-22/+22
| | | | llvm-svn: 318427
* [FuzzMutate] NFC. Move parseModule and writeModule from llvm-isel-fuzzer ↵Igor Laevsky2017-11-162-63/+0
| | | | | | | | into FuzzMutate. This is to be able to reuse them in the llvm-opt-fuzzer. llvm-svn: 318407
* Convert a use of createUniqueFile to TempFile::create.Rafael Espindola2017-11-161-19/+20
| | | | llvm-svn: 318361
* Simplify file handling in dsymutil.Rafael Espindola2017-11-153-33/+27
| | | | | | | | | | | This moves the file handling out of DwarfLinker.cpp. This fixes what is at least an oddity if not a bug. DwarfLinker.cpp was using ToolOutputFile, which uses RemoveFileOnSignal. The issue is that dsymutil.cpp uses that too. It is now clear from the interface that only dsymutil.cpp is responsible for creating and deleting files. llvm-svn: 318334
* [llvm-objcopy] Change -O binary to respect section removal and behave like ↵Jake Ehrlich2017-11-151-63/+129
| | | | | | | | | | | | | | | | GNU objcopy The original -O binary implementation just copied segment data from the object and dumped it into a file. This doesn't take into account any operations performed on objects such as section removal. GNU objcopy has some specific behavior that we'd also like to respect. For instance using -O binary and -j <some_section> will dump <some_section> to a file. This change implements GNU objcopy style -O binary to as close of an approximation as I can determine. Differential Revision: https://reviews.llvm.org/D39713 llvm-svn: 318324
* [cfi-verify] Validate there are no register clobbers between CFI-check and ↵Mitch Phillips2017-11-154-0/+57
| | | | | | | | | | | | | | | | | | | instruction execution. Summary: This patch adds another failure mode for `validateCFIProtection(..)`, wherein any register that affects the indirect control flow instruction is clobbered to between the CFI-check and the instruction's execution. Also includes a modification to make MCInstrDesc::hasDefOfPhysReg public. Reviewers: vlad.tsyrklevich Reviewed By: vlad.tsyrklevich Subscribers: llvm-commits, pcc, kcc Differential Revision: https://reviews.llvm.org/D39820 llvm-svn: 318238
* [cfi-verify] Add DOT graph printing for GraphResult objects.Mitch Phillips2017-11-145-4/+46
| | | | | | | | | | | | | | Allows users to view GraphResult objects in a DOT directed-graph format. This feature can be turned on through the --print-graphs flag. Also enabled pretty-printing of instructions in output. Together these features make analysis of unprotected CF instructions much easier by providing a visual control flow graph. Reviewers: pcc Subscribers: llvm-commits, kcc, vlad.tsyrklevich Differential Revision: https://reviews.llvm.org/D39819 llvm-svn: 318211
* Rename CountingFunctionInserter and use for both mcount and cygprofile ↵Hans Wennborg2017-11-142-2/+4
| | | | | | | | | | | | | | | | | | | | | | calls, before and after inlining Clang implements the -finstrument-functions flag inherited from GCC, which inserts calls to __cyg_profile_func_{enter,exit} on function entry and exit. This is useful for getting a trace of how the functions in a program are executed. Normally, the calls remain even if a function is inlined into another function, but it is useful to be able to turn this off for users who are interested in a lower-level trace, i.e. one that reflects what functions are called post-inlining. (We use this to generate link order files for Chromium.) LLVM already has a pass for inserting similar instrumentation calls to mcount(), which it does after inlining. This patch renames and extends that pass to handle calls both to mcount and the cygprofile functions, before and/or after inlining as controlled by function attributes. Differential Revision: https://reviews.llvm.org/D39287 llvm-svn: 318195
* [llvm-objcopy] Improve command line option help messagesJake Ehrlich2017-11-141-5/+6
| | | | | | | | | | I was being inconsistent with the way I was capitalizing help messages for command line options. Additionally --remove-section wasn't using value_desc even though it benefited from it. Differential Revision: https://reviews.llvm.org/D39978 llvm-svn: 318190
* [llvm-strings] Add support for the -a/--all optionsMartin Storsjo2017-11-141-0/+6
| | | | | | | | | | | | They don't actually change nay behaviour, as llvm-strings currently checks the whole object without looking at individual sections anyway. This allows using llvm-strings in a context that explicitly passes the -a option. Differential Revision: https://reviews.llvm.org/D40020 llvm-svn: 318185
* [llvm-objcopy] Add -strip-non-alloc option to remove all non-allocated sectionsJake Ehrlich2017-11-141-0/+11
| | | | | | | | | This change adds a new flag not present in GNU objcopy that we call --strip-non-alloc. Differential Revision: https://reviews.llvm.org/D39926 llvm-svn: 318168
* [llvm-objcopy] Support the rest of the ELF formatsJake Ehrlich2017-11-141-6/+19
| | | | | | | | | | | | We haven't been supporting anything but ELF64LE since the start. Luckily this was always accounted for and the change is pretty trivial. B35281 requests this change for ELF32LE. This change adds support for ELF32LE, ELF64BE, and ELF32BE with all supported features that already existed for ELF64LE. Differential Revision: https://reviews.llvm.org/D39977 llvm-svn: 318166
OpenPOWER on IntegriCloud