summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [llvm-profdata] Report if profile data file is IR- or FE-levelAdam Nemet2017-11-141-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D39997 llvm-svn: 318159
* [opt-viewer] Truncate long remark text in source viewAdam Nemet2017-11-142-7/+21
| | | | | | | | | The table is changed to fixed layout[1] and the lines use ellipses if they would overflow their cell. [1] https://css-tricks.com/fixing-tables-long-strings/ llvm-svn: 318136
* [opt-viewer] With hotness only show max 1000 entries on the index pageAdam Nemet2017-11-141-3/+14
| | | | | | Adjustable with an option. llvm-svn: 318135
* Update some code.google.com linksHans Wennborg2017-11-131-1/+1
| | | | llvm-svn: 318115
* [llvm-objcopy] Add --strip-debugJake Ehrlich2017-11-131-0/+8
| | | | | | | | | | | | | | | | Many projects use this option. There are two ways to use it. You can either a) Just use --strip-debug and keep the old file with debug content or b) you can use --strip-debug, --only-keep-debug, and --add-gnu-debuglink all in conjunction to create two separate files, the stripped file and the debug file. --only-keep-debug is more complicated than --strip-debug because it keeps the section headers without keeping section contents. That's not really supported by llvm-objcopy at the moment but I plan on adding it. So this change just supports a) and options to support b) will come soon. Differential Revision: https://reviews.llvm.org/D39919 llvm-svn: 318094
* [llvm-objcopy] Add --strip-all option to llvm-objcopyJake Ehrlich2017-11-131-0/+20
| | | | | | | | | | | | | | This change adds a slightly less extreme form of stripping. It should remove any section that starts with ".debug" and should remove any symbol table or relocations. In general this strips out most of the stuff you don't need to execute but leaves a number of things around. This behavior has been designed to be compatible with GNU strip/objcopy --strip-all so that anywhere you currently use --strip-all you should be able to use llvm-objcopy as a drop in replacement. Differential Revision: https://reviews.llvm.org/D39769 llvm-svn: 318092
* [llvm-cvtres] Add support for ARM64Martin Storsjo2017-11-101-0/+4
| | | | | | | | | | | Also change some default cases into llvm_unreachable in WindowsResourceCOFFWriter, to make it easier to find if they are triggerd from within e.g. lld, which supported ARM64 earlier than llvm-cvtres did. Differential Revision: https://reviews.llvm.org/D39892 llvm-svn: 317942
* [cfi-verify] Made FileAnalysis operate on a GraphResult rather than build ↵Mitch Phillips2017-11-103-47/+76
| | | | | | | | | | | | | | | | one and validate it. Refactors the behaviour of building graphs out of FileAnalysis, allowing for analysis of the GraphResult by the callee without having to rebuild the graph. Means when we want to analyse the constructed graph (planned for later revisions), we don't do repeated work. Also makes CFI verification in FileAnalysis now return an enum that allows us to differentiate why something failed, not just that it did/didn't fail. Reviewers: vlad.tsyrklevich Subscribers: kcc, pcc, llvm-commits Differential Revision: https://reviews.llvm.org/D39764 llvm-svn: 317927
* [llvm-opt-fuzzer] Add missed library dependence. Fir for rL317883Igor Laevsky2017-11-101-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D39555 llvm-svn: 317889
* [llvm-opt-fuzzer] Fix unused variable warning after rL317883Igor Laevsky2017-11-101-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D39555 llvm-svn: 317887
* [llvm-opt-fuzzer] Introduce llvm-opt-fuzzer for fuzzing optimization passesIgor Laevsky2017-11-103-0/+304
| | | | | | | | | This change adds generic fuzzing tools capable of running libFuzzer tests on any optimization pass or combination of them. Differential Revision: https://reviews.llvm.org/D39555 llvm-svn: 317883
* Reapply: Allow yaml2obj to order implicit sections for ELFDave Lee2017-11-091-39/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows yaml input to control the order of implicitly added sections (`.symtab`, `.strtab`, `.shstrtab`). The order is controlled by adding a placeholder section of the given name to the Sections field. This change is to support changes in D39582, where it is desirable to control the location of the `.dynsym` section. This reapplied version fixes: 1. use of a function call within an assert 2. failing lld test which has an unnamed section 3. incorrect section count when given an unnamed section Additionally, one more test to cover the unnamed section failure. Reviewers: compnerd, jakehehrlich Reviewed By: jakehehrlich Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39749 llvm-svn: 317789
* [llvm-cov] Don't render empty region marker linesVedant Kumar2017-11-093-10/+13
| | | | | | | This fixes an issue where llvm-cov prints an empty line, thinking it needs to display region markers, when it actually doesn't. llvm-svn: 317762
* [Coverage] Use the wrapped segment when a line has entry segmentsVedant Kumar2017-11-092-11/+12
| | | | | | | | | We've worked around bugs in the frontend by ignoring the count from wrapped segments when a line has at least one region entry segment. Those frontend bugs are now fixed, so it's time to regenerate the checked-in covmapping files and remove the workaround. llvm-svn: 317761
* [cfi-verify] Adds blacklist blame behaviour to cfi-verify.Mitch Phillips2017-11-092-27/+37
| | | | | | | | | | | | | | Adds the blacklist behaviour to llvm-cfi-verify. Now will calculate which lines caused expected failures in the blacklist and reports the number of affected indirect CF instructions for each blacklist entry. Also moved DWARF checking after instruction analysis to improve performance significantly - unrolling the inlining stack is expensive. Reviewers: vlad.tsyrklevich Subscribers: aprantl, pcc, kcc, llvm-commits Differential Revision: https://reviews.llvm.org/D39750 llvm-svn: 317743
* Make sure an error is always handled.Rafael Espindola2017-11-081-3/+4
| | | | llvm-svn: 317724
* Convert FileOutputBuffer::commit to Error.Rafael Espindola2017-11-081-2/+2
| | | | llvm-svn: 317656
* Revert "Reapply: Allow yaml2obj to order implicit sections for ELF"Dave Lee2017-11-081-42/+37
| | | | | | This reverts commit r317646. llvm-svn: 317654
* Convert FileOutputBuffer to Expected. NFC.Rafael Espindola2017-11-083-5/+5
| | | | llvm-svn: 317649
* Reapply: Allow yaml2obj to order implicit sections for ELFDave Lee2017-11-081-37/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows yaml input to control the order of implicitly added sections (`.symtab`, `.strtab`, `.shstrtab`). The order is controlled by adding a placeholder section of the given name to the Sections field. This change is to support changes in D39582, where it is desirable to control the location of the `.dynsym` section. This reapplied version fixes: 1. use of a function call within an assert 2. failing lld test which has an unnamed section Additionally, one more test to cover the unnamed section failure. Reviewers: compnerd, jakehehrlich Reviewed By: jakehehrlich Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39749 llvm-svn: 317646
* Revert "Allow yaml2obj to order implicit sections for ELF"Dave Lee2017-11-071-41/+37
| | | | | | | | Also, revert "Fix build bots after r317622" This reverts commit r317622, r317626. llvm-svn: 317630
* Fix build bots after r317622Dave Lee2017-11-071-1/+1
| | | | | | | | | Example build failure: http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/14660 TIL that the warning flags for local builds are loose compared to what build servers use. llvm-svn: 317626
* Allow yaml2obj to order implicit sections for ELFDave Lee2017-11-071-37/+41
| | | | | | | | | | | | | | | | | | | | Summary: This change allows yaml input to control the order of implicitly added sections (`.symtab`, `.strtab`, `.shstrtab`). The order is controlled by adding a placeholder section of the given name to the Sections field. This change is to support changes in D39582, where it is desirable to control the location of the `.dynsym` section. Reviewers: compnerd, jakehehrlich Reviewed By: jakehehrlich Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39749 llvm-svn: 317622
* [DWARFv5] Support DW_FORM_strp in the .debug_line header.Paul Robinson2017-11-071-3/+3
| | | | | | | | Supporting this form in .debug_line.dwo will be done as a follow-up. Differential Revision: https://reviews.llvm.org/D33155 llvm-svn: 317607
* [XRay] Minimal tool to convert xray traces to Chrome's Trace Event Format.Keith Wyss2017-11-074-113/+375
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Minimal tool to convert xray traces to Chrome's Trace Event Format. Summary: Make use of Chrome Trace Event format's Duration events and stack frame dict to produce Json files that chrome://tracing can visualize from xray function call traces. Trace Event format is more robust and has several features like argument logging, function categorization, multi process traces, etc. that we can add as needed. Duration events cover an important base case. Part of this change is rearranging the code so that the TrieNode data structure can be used from multiple tools and can carry parameterized baggage on the nodes. I put the actual behavior changes in llvm-xray convert exclusively. Exploring the trace of instrumented llc was pretty nifty if overwhelming. I can envision this being very useful for analyzing contention scenarios or tuning parameters like batch sizes in a producer consumer queue. For more targeted traces likemthis, let's talk about how we want to approach trace pruning. Reviewers: dberris, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39362 llvm-svn: 317531
* [cfi-verify] Added a simple check that stops division-by-zero error when no ↵Mitch Phillips2017-11-061-1/+3
| | | | | | indirect CF instructions are found in the provided file. llvm-svn: 317500
* Make MCAsmBackend and MCCodeEmiiter passed by unique_ptr rvalMitch Phillips2017-11-061-2/+4
| | | | | | | | | | | | Summary: Fixes build breakage of llvm-mc-assemble-fuzzer introduced by rL315531. Reviewers: lhames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39268 llvm-svn: 317498
* Move the LLVMCFIVerify project into the Libraries folder on IDEs like Visual ↵Aaron Ballman2017-11-041-0/+1
| | | | | | Studio rather than leave it in the root directory. NFC. llvm-svn: 317415
* Fix a crash in llvm-objdump when printing a bad x86_64 relocation in a Mach-OKevin Enderby2017-11-031-2/+13
| | | | | | | | file with a bad section number. rdar://35207539 llvm-svn: 317373
* GCOV: Move GCOV from IR & Support into ProfileData to fix layeringDavid Blaikie2017-11-031-1/+1
| | | | | | | | This class was split between libIR and libSupport, which breaks under modular code generation. Move it into the one library that uses it, ProfileData, to resolve this issue. llvm-svn: 317366
* llvm-objdump: Fix unused-lambda-capture warning by removing unused lambda ↵David Blaikie2017-11-031-1/+1
| | | | | | capture llvm-svn: 317365
* [cfi-verify] Add blacklist parsing for result filtering.Mitch Phillips2017-11-037-56/+144
| | | | | | | | | | | | | | | | | | | | | Adds blacklist parsing behaviour for filtering results into four categories: - Expected Protected: Things that are not in the blacklist and are protected. - Unexpected Protected: Things that are in the blacklist and are protected. - Expected Unprotected: Things that are in the blacklist and are unprotected. - Unexpected Unprotected: Things that are not in the blacklist and are unprotected. now can optionally be invoked with a second command line argument, which specifies the blacklist file that the binary was built with. Current statistics for chromium: Reviewers: vlad.tsyrklevich Subscribers: mgorny, llvm-commits, pcc, kcc Differential Revision: https://reviews.llvm.org/D39525 llvm-svn: 317364
* [llvm-ar] Support an options string that start with a dashMartin Storsjo2017-11-031-0/+20
| | | | | | | | Some projects call $AR like "$AR -crs output input1 input2". Differential Revision: https://reviews.llvm.org/D39538 llvm-svn: 317358
* Add llvm::for_each as a range-based extensions to <algorithm> and make use ↵Aaron Ballman2017-11-037-55/+46
| | | | | | of it in some cases where it is a more clear alternative to std::for_each. llvm-svn: 317356
* [llvm-objcopy] Add support for dwarf fissionJake Ehrlich2017-11-032-15/+67
| | | | | | | | This change adds support for dwarf fission. Differential Revision: https://reviews.llvm.org/D39207 llvm-svn: 317350
* re-land [ExpandMemCmp] Split ExpandMemCmp from CodeGen into its own pass."Clement Courbet2017-11-031-0/+1
| | | | | | Fix undefined references: ExpandMemCmp belongs to CodeGen/, not Scalar/. llvm-svn: 317318
* [llvm-nm] Don't error out on multiple occurrances of the -g/--external-only flagMartin Storsjo2017-11-031-2/+4
| | | | | | | | | | | GNU binutils nm doesn't error out on this, and some projects' build systems can end up doing that in some cases. Allowing that seems like a better target than trying to avoid user projects passing multiple -g parameters to $NM. Differential Revision: https://reviews.llvm.org/D39539 llvm-svn: 317301
OpenPOWER on IntegriCloud