summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-extract] Support extracting basic blocksVolkan Keles2018-01-233-0/+86
| | | | | | | | | | | | | | | | Summary: Currently, there is no way to extract a basic block from a function easily. This patch extends llvm-extract to extract the specified basic block(s). Reviewers: loladiro, rafael, bogner Reviewed By: bogner Subscribers: hintonda, mgorny, qcolombet, llvm-commits Differential Revision: https://reviews.llvm.org/D41638 llvm-svn: 323266
* [llvm-objcopy] Use physical instead of virtual address when aligning and ↵Jake Ehrlich2018-01-226-12/+100
| | | | | | | | | | | | | | | | | | | | | placing sections in binary For sections with different virtual and physical addresses, alignment and placement in the output binary should be based on the physical address. Ran into this problem with a bare metal ARM project where llvm-objcopy added a lot of zero-padding before the .data section that had differing addresses. GNU objcopy did not add the padding, and after this fix, neither does llvm-objcopy. Update a test case so a section has different physical and virtual addresses. Fixes B35708 Authored By: Owen Shaw (owenpshaw) Differential Revision: https://reviews.llvm.org/D41619 llvm-svn: 323144
* Make GlobalValues with non-default visibilility dso_local.Rafael Espindola2018-01-184-9/+9
| | | | | | | | | | | | This is similar to r322317, but for visibility. It is not as neat because we have to special case extern_weak. The idea is the same as the previous change, make the transition to explicit dso_local easier for the frontends. With this they only have to add dso_local to symbols where we need some external information to decide if it is dso_local (like it being part of an ELF executable). llvm-svn: 322806
* [WebAssembly] Remove debug names from symbol tableSam Clegg2018-01-174-18/+31
| | | | | | | | | | | | | | | | | | | | | | | | | Get rid of DEBUG_FUNCTION_NAME symbols. When we actually debug data, maybe we'll want somewhere to put it... but having a symbol that just stores the name of another symbol seems odd. It means you have multiple Symbols with the same name, one containing the actual function and another containing the name! Store the names in a vector on the WasmObjectFile when reading them in. Also stash them on the WasmFunctions themselves. The names are //not// "symbol names" or aliases or anything, they're just the name that a debugger should show against the function body itself. NB. The WasmObjectFile stores them so that they can be exported in the YAML losslessly, and hence the tests can be precise. Enforce that the CODE section has been read in before reading the "names" section. Requires minor adjustment to some tests. Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42075 llvm-svn: 322741
* [pdbutil] Replace 0 byte PDB input with correct version to fix failing unit testAaron Smith2018-01-171-0/+0
| | | | llvm-svn: 322614
* Fix pretty printing the unspecified param of a variadic functionAaron Smith2018-01-173-0/+74
| | | | | | | | | | | | | | | | | | | | | | | Summary: - Fix a bug in PrettyBuiltinDumper that returns "void" as the name for an unspecified builtin type. Since the unspecified param of a variadic function is considered a builtin of unspecified type in PDBs, we set "..." for its name. - Provide a method to determine if a PDBSymbolFunc is variadic in PrettyFunctionDumper since PDBSymbolFunc::getArgument() doesn't return the last unspecified-type param. - Add a pretty-func-dumper.test to test pretty dumping of variadic functions. Reviewers: zturner, llvm-commits Reviewed By: zturner Differential Revision: https://reviews.llvm.org/D41801 llvm-svn: 322608
* [DebugInfo] Unify dumping of address rangesJonas Devlieghere2018-01-166-36/+36
| | | | | | | | | | | | | | | Summary: This patch unifies the printing of address ranges as [0x0, 0x1). rdar://34822059 Reviewers: aprantl, dblaikie Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D42056 llvm-svn: 322543
* Make internal/private GVs implicitly dso_local.Rafael Espindola2018-01-1112-27/+27
| | | | | | | | | | | | | | | | While updating clang tests for having clang set dso_local I noticed that: - There are *a lot* of tests to update. - Many of the updates are redundant. They are redundant because a GV is "obviously dso_local". This patch starts formalizing that a bit by requiring that internal and private GVs be dso_local too. Since they all are, we don't have to print dso_local to the textual representation, making it a bit more compact and easier to read. llvm-svn: 322317
* tempJake Ehrlich2018-01-091-0/+27
| | | | llvm-svn: 322132
* [WebAssembly] Explicitly specify function/global index space in YAMLSam Clegg2018-01-093-22/+31
| | | | | | | | | | | These indexes are useful because they are not always zero based and functions and globals are referenced elsewhere by their index. This matches what we already do for the type index space. Differential Revision: https://reviews.llvm.org/D41877 llvm-svn: 322121
* Profiling tests: Endianess XFAIL for powerpc- (32-bit)Hubert Tong2018-01-095-5/+5
| | | | | | | | | | | | Add powerpc- (32-bit) as XFAIL for tests that are documented either in- line or via commit messages as expected to fail on big-endian systems. Tests not documented in-line are documented in commit messages as follows: r211172 - test/tools/llvm-cov/llvm-cov.test r247920 - test/Transforms/SampleProfile/gcc-simple.ll llvm-svn: 322114
* [lit] Implement "-r" option for builtin "diff" command + a test using that.Max Moroz2018-01-091-3/+0
| | | | | | | | | | | | | | | | Summary: That would allow to recursively compare directories in tests using "diff -r" on Windows in a similar way as it can be done on Linux or Mac. Reviewers: zturner, morehouse, vsk Reviewed By: zturner Subscribers: kcc, llvm-commits Differential Revision: https://reviews.llvm.org/D41776 llvm-svn: 322102
* [llvm-readobj] Support -needed-libs option for Mach-O filesPetr Hosek2018-01-081-0/+26
| | | | | | | | This implements the -needed-libs option in Mach-O dumper. Differential Revision: https://reviews.llvm.org/D41527 llvm-svn: 321980
* Fix some opt-viewer test issues and disable on Windows.Zachary Turner2018-01-051-0/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D41784 llvm-svn: 321905
* dwarfdump: Match the --uuid output with that of Darwin dwarfdump.Adrian Prantl2018-01-052-3/+3
| | | | | | | | This option is widely used by scripts and there is no reason to break them. rdar://problem/36032398 llvm-svn: 321901
* [llvm-cov] Change test to use FileCheck instead of grep.Douglas Yung2018-01-051-4/+6
| | | | | | Reviewed by Paul Robinson llvm-svn: 321888
* [llvm-objcopy] Add --localize-hidden optionJake Ehrlich2018-01-051-0/+164
| | | | | | | This change adds support in llvm-objcopy for GNU objcopy's --localize-hidden option. This option changes every hidden or internal symbol into a local symbol. llvm-svn: 321884
* [llvm-mt] Remove platform-specific path in testBrian Gesiak2018-01-051-1/+1
| | | | | | | | | | Summary: Remove a platform-specific path separator added to the llvm-mt help text test in https://reviews.llvm.org/D41732. Test Plan: `check-llvm` llvm-svn: 321881
* [Option] Add 'findNearest' method to catch typosBrian Gesiak2018-01-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add a method `OptTable::findNearest`, which allows users of OptTable to check user input for misspelled options. In addition, have llvm-mt check for misspelled options. For example, if a user invokes `llvm-mt /oyt:foo`, the error message will indicate that while an option named `/oyt:` does not exist, `/out:` does. The method ports the functionality of the `LookupNearestOption` method from LLVM CommandLine to libLLVMOption. This allows tools like Clang and Swift, which do not use CommandLine, to use this functionality to suggest similarly spelled options. As room for future improvement, the new method as-is cannot yet properly suggest nearby "joined" options -- that is, for an option string "-FozBar", where "-Foo" is the correct option name and "Bar" is the value being passed along with the misspelled option, this method will calculate an edit distance of 4, by deleting "Bar" and changing "z" to "o". It should instead calculate an edit distance of just 1, by changing "z" to "o" and recognizing "Bar" as a value. This commit includes a disabled test that expresses this limitation. Test Plan: `check-llvm` Reviewers: yamaguchi, v.g.vassilev, teemperor, ruiu, jroelofs Reviewed By: jroelofs Subscribers: jroelofs, llvm-commits Differential Revision: https://reviews.llvm.org/D41732 llvm-svn: 321877
* [llvm-cov] Temporarily disable multithreaded-report.test on Windows.Max Moroz2018-01-051-0/+4
| | | | | | | | | | | | Summary: The test is failing because Windows do not support "diff -r". Reviewers: Dor1s Reviewed By: Dor1s Differential Revision: https://reviews.llvm.org/D41768 llvm-svn: 321876
* [llvm-cov] Multi-threaded implementation of prepareFileReports method.Max Moroz2018-01-0510-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Local testing has demonstrated a great speed improvement, compare the following: 1) Existing version: ``` $ time llvm-cov show -format=html -output-dir=report -instr-profile=... ... The tool has been launched: 00:00:00 Loading coverage data: 00:00:00 Get unique source files: 00:00:33 Creating an index out of the source files: 00:00:34 Going into prepareFileReports: 00:00:34 Going to emit summary information for each file: 00:28:55 <-- 28:21 min! Going to emit links to files with no function: 00:28:55 Launching 32 threads for generating HTML files: 00:28:55 real 37m43.651s user 112m5.540s sys 7m39.872s ``` 2) Multi-threaded version with 32 CPUs: ``` $ time llvm-cov show -format=html -output-dir=report -instr-profile=... ... The tool has been launched: 00:00:00 Loading coverage data: 00:00:00 Get unique source files: 00:00:38 Creating an index out of the source files: 00:00:40 Going into prepareFileReports: 00:00:40 Preparing file reports using 32 threads: 00:00:40 # Creating thread tasks for the following number of files: 16422 Going to emit summary information for each file: 00:01:57 <-- 1:17 min! Going to emit links to files with no function: 00:01:58 Launching 32 threads for generating HTML files: 00:01:58 real 11m2.044s user 134m48.124s sys 7m53.388s ``` Reviewers: vsk, morehouse Reviewed By: vsk Subscribers: Dor1s, llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D41206 llvm-svn: 321871
* [llvm-cov] Refactor "export" command implementation and add support for SOURCES.Max Moroz2018-01-041-0/+14
| | | | | | | | | | | | | | Summary: Define an interface for Exporter + split JSON exporter into .h and .cpp. Reviewers: vsk, morehouse Reviewed By: vsk Subscribers: llvm-commits, Dor1s, kcc Differential Revision: https://reviews.llvm.org/D41600 llvm-svn: 321815
* Do not look up symbol names when n_strx == 0Michael Trent2018-01-032-0/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: Historical tools for working with mach-o binaries verify the nlist field n_strx has a non-zero value before using that value to retrieve symbol names. Under some cirumstances, llvm-nm will attempt to display the symbol name at position 0, even though symbol names at that position are not well defined. This change addresses this problem by returning an empty string when n_strx is zero. rdar://problem/35750548 Reviewers: enderby, davide Reviewed By: enderby, davide Subscribers: davide, llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D41657 llvm-svn: 321773
* [llvm-objcopy] Add support for visibilityJake Ehrlich2018-01-021-1/+34
| | | | | | | I have no clue how this was missed when symbol table support was added. This change ensures that the visibility of symbols is preserved by default. llvm-svn: 321681
* Fix tests after move to utohexstr.Benjamin Kramer2017-12-282-2/+2
| | | | llvm-svn: 321527
* [llvm-readobj] Support -needed-libs option for COFF filesPetr Hosek2017-12-272-0/+5
| | | | | | | | This implements the -needed-libs option in the COFF dumper. Differential Revision: https://reviews.llvm.org/D41529 llvm-svn: 321498
* [llvm-readobj] Support 'GNU' style for MIPS GOT/PLT dumpingSimon Atanasyan2017-12-212-2/+166
| | | | | | | | | | This change adds `printMipsGOT` and `printMipsPLT` methods to the `DumpStyle` class and overrides them in the `GNUStyle` and `LLVMStyle` descendants. To pass information about GOT/PLT layout into these methods, the `MipsGOTParser` class has been extended to hold all necessary data. llvm-svn: 321253
* [dwarfdump][test] Add test case for r321064Jonas Devlieghere2017-12-191-1/+6
| | | | | | Verify that -lookup takes a 64-bit address. llvm-svn: 321101
* [llvm-objcopy] Add option to add a progbits section from a fileJake Ehrlich2017-12-192-0/+73
| | | | | | | | This change adds support for adding progbits sections with contents from a file Differential Revision: https://reviews.llvm.org/D41212 llvm-svn: 321047
* Fix buffer overrun in WindowsResourceCOFFWriter::writeSymbolTable()Bob Haarman2017-12-182-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We were using sprintf(..., "$R06X", <some uint32_t>) to create strings that are expected to be exactly length 8, but this results in longer strings if the uint32_t is greater than 0xffffff. This change modifies the behavior as follows: - Uses the loop counter instead of the data offset. This gives us sequential symbol names, avoiding collisions as much as possible. - Masks the value to 0xffffff to avoid generating names longer than 8 bytes. - Uses formatv instead of sprintf. Fixes PR35581. Reviewers: ruiu, zturner Reviewed By: ruiu Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D41270 llvm-svn: 321030
* [LTO] Make processing of combined module more consistentVitaly Buka2017-12-161-1/+14
| | | | | | | | | | | | | | | | | Summary: 1. Use stream 0 only for combined module. Previously if combined module was not processes ThinLTO used the stream for own output. However small changes in input, could trigger combined module and shuffle outputs making life of llvm::LTO harder. 2. Always process combined module and write output to stream 0. Processing empty combined module is cheap and allows llvm::LTO users to avoid implementing processing which is already done in llvm::LTO. Subscribers: mehdi_amini, inglorion, eraman, hiraditya Differential Revision: https://reviews.llvm.org/D41267 llvm-svn: 320905
* Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent2017-12-154-6/+13
| | | | | | | | | | | | | | | | | | | | | | | 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. All tests are passing for llvm, clang, and lld. llvm-objdump builds without compiler warnings. rdar://35778019 Reviewers: enderby Reviewed By: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41199 llvm-svn: 320832
* [opt-viewer] Render utf-8 characters properly in the generated HTMLAdam Nemet2017-12-147-0/+7
| | | | llvm-svn: 320729
* [opt-viewer] Support unicode characters in function namesAdam Nemet2017-12-145-0/+188
| | | | | | | | | | 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. llvm-svn: 320725
* [LLVMgold] Use platform dependent extension in testsEugene Leviant2017-12-1468-104/+104
| | | | | | Differential revision: https://reviews.llvm.org/D41238 llvm-svn: 320710
* [WebAssembly] Use bitfield types in wasm YAML representationSam Clegg2017-12-131-4/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D41202 llvm-svn: 320642
* [dsymutil][test] Fix failing test when no lipo binary availableJonas Devlieghere2017-12-131-11/+0
| | | | | | | | The invocation without -no-output would try to lipo the different debug objects together. This wouldn't work on platforms that don't provide that utility. llvm-svn: 320605
* [dsymutil] Re-enable threadingJonas Devlieghere2017-12-132-1/+16
| | | | | | | | | | | | | | | | 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 llvm-svn: 320601
* reverting out -r320532 because a warning is breaking the lld buildMichael Trent2017-12-134-13/+6
| | | | llvm-svn: 320534
* Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent2017-12-124-6/+13
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 320532
* [dsymutil] Accept line tables up to DWARFv5.Jonas Devlieghere2017-12-124-0/+46
| | | | | | | | | | | 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 llvm-svn: 320469
* [llvm-cov] Simplify a test case. NFC.Vedant Kumar2017-12-111-24/+5
| | | | llvm-svn: 320439
* [llvm-cov] Add an option for "export" command to emit only file summary data.Max Moroz2017-12-111-24/+27
| | | | | | | | | | | | | | 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 llvm-svn: 320435
* dwarfdump: Add support for the --diff option.Adrian Prantl2017-12-082-0/+7
| | | | | | | | | --diff Emit the output in a diff-friendly way by omitting offsets and addresses. <rdar://problem/34502625> llvm-svn: 320214
* Reverting r320166 to fix test failures.Michael Trent2017-12-082-6/+0
| | | | llvm-svn: 320174
* Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent2017-12-082-0/+6
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 320166
* [dsymutil] Add -verify option to run DWARF verifier after linking.Jonas Devlieghere2017-12-072-0/+9
| | | | | | | | | | | 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 llvm-svn: 320033
* [COFF] Ignore semicolons in module definition identifiersRui Ueyama2017-12-061-3/+9
| | | | | | | | | | | | | | | | Patch by David Major. The NSS project's .def files make heavy use of semicolons in a frightening attempt at portability: https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/capi/nsscapi.def lld-link was treating the semicolon as part of the export name, resulting in unresolved symbols. This patch includes ';' in the list of characters to split on. Differential Revision: https://reviews.llvm.org/D39968 llvm-svn: 319933
* [opt-viewer] Suppress noisy Swift remarksAdam Nemet2017-12-065-0/+340
| | | | | | | | | 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. llvm-svn: 319902
* Simplify test.Rafael Espindola2017-12-051-11/+7
| | | | | | It can use attrib instead of icacls. llvm-svn: 319809
OpenPOWER on IntegriCloud