summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* xray-account: Avoid std::errc::bad_message to appease mingw.NAKAMURA Takumi2017-01-131-1/+1
| | | | llvm-svn: 291863
* [llvm-pdbdump] Add a compact dump mode.Zachary Turner2017-01-126-35/+174
| | | | | | Differential Revision: https://reviews.llvm.org/D28545 llvm-svn: 291849
* [ObjectYAML] Pull yaml2dwarf out of yaml2obj for reuseChris Bieneman2017-01-124-353/+10
| | | | | | This patch pulls the yaml2dwarf code out of yaml2obj into a new set of DWARF emitter functions in the DWARFYAML namespace. This will enable the YAML->DWARF code to be used inside DWARF tests by populating the DWARFYAML structs and calling the Emitter functions. llvm-svn: 291828
* [llvm-config] Fix obviously wrong code in parsing DyLib components.Marcello Maggioni2017-01-121-1/+1
| | | | | | | | | | | | | | The code parsing the string was using the offset returned from StringRef::find() wrong, assuming it was relative to the staring offset that is passed to the function, but the returned offset is always relative to the beginning of the line. This causes odd behaviour while parsing the component string. Spotted thanks to the newly added test: tools/llvm-config/booleans.test llvm-svn: 291803
* Avoid std::errc::protocol_* to appease mingwHans Wennborg2017-01-122-2/+2
| | | | | | Like r291636 and r285261. llvm-svn: 291786
* Fix windows buildbots building llvm-xraySimon Pilgrim2017-01-122-8/+13
| | | | | | | | | | 2 issues: 1 - replaced unix-style pid_t with cross-platform llvm::sys::ProcessInfo::ProcessId 2 - fixed shadow variable warning in lambda expression Reviewed by @filcab llvm-svn: 291760
* [XRay] Include <numeric> for std::accumulate.Dean Michael Berris2017-01-121-0/+1
| | | | | | Fix-up following D24377. llvm-svn: 291750
* [XRay] Implement the `llvm-xray account` subcommandDean Michael Berris2017-01-124-0/+691
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the third of a multi-part change to implement subcommands for the `llvm-xray` tool. Here we define the `account` subcommand which does simple function call accounting, generating basic statistics on function calls we find in an XRay log/trace. We support text output and csv output for this subcommand. This change also supports sorting, summing, and filtering the top N results. Part of this tool will later be turned into a library that could be used for basic function call accounting. Depends on D24376. Reviewers: dblaikie, echristo Subscribers: mehdi_amini, dberris, beanz, llvm-commits Differential Revision: https://reviews.llvm.org/D24377 llvm-svn: 291749
* [CodeView] Finish decoupling TypeDatabase from TypeDumper.Zachary Turner2017-01-113-23/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the type dumper itself was passed around to a lot of different places and manipulated in ways that were more appropriate on the type database. For example, the entire TypeDumper was passed into the symbol dumper, when all the symbol dumper wanted to do was lookup the name of a TypeIndex so it could print it. That's what the TypeDatabase is for -- mapping type indices to names. Another example is how if the user runs llvm-pdbdump with the option to dump symbols but not types, we still have to visit all types so that we can print minimal information about the type of a symbol, but just without dumping full symbol records. The way we did this before is by hacking it up so that we run everything through the type dumper with a null printer, so that the output goes to /dev/null. But really, we don't need to dump anything, all we want to do is build the type database. Since TypeDatabaseVisitor now exists independently of TypeDumper, we can do this. We just build a custom visitor callback pipeline that includes a database visitor but not a dumper. All the hackery around printers etc goes away. After this patch, we could probably even delete the entire CVTypeDumper class since really all it is at this point is a thin wrapper that hides the details of how to build a useful visitation pipeline. It's not a priority though, so CVTypeDumper remains for now. After this patch we will be able to easily plug in a different style of type dumper by only implementing the proper visitation methods to dump one-line output and then sticking it on the pipeline. Differential Revision: https://reviews.llvm.org/D28524 llvm-svn: 291724
* Remove all variants of DWARFDie::getAttributeValueAs...() that had ↵Greg Clayton2017-01-111-16/+25
| | | | | | | | | | parameters that specified default values. Now we only support returning Optional<> values and have changed all clients over to use Optional::getValueOr(). Differential Revision: https://reviews.llvm.org/D28569 llvm-svn: 291686
* [PM] Separate the LoopAnalysisManager from the LoopPassManager and moveChandler Carruth2017-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | the latter to the Transforms library. While the loop PM uses an analysis to form the IR units, the current plan is to have the PM itself establish and enforce both loop simplified form and LCSSA. This would be a layering violation in the analysis library. Fundamentally, the idea behind the loop PM is to *transform* loops in addition to running passes over them, so it really seemed like the most natural place to sink this was into the transforms library. We can't just move *everything* because we also have loop analyses that rely on a subset of the invariants. So this patch splits the the loop infrastructure into the analysis management that has to be part of the analysis library, and the transform-aware pass manager. This also required splitting the loop analyses' printer passes out to the transforms library, which makes sense to me as running these will transform the code into LCSSA in theory. I haven't split the unittest though because testing one component without the other seems nearly intractable. Differential Revision: https://reviews.llvm.org/D28452 llvm-svn: 291662
* [XRay] Define the library for XRay trace logsDean Michael Berris2017-01-117-422/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In this change we move the definition of the log reading routines from the tools directory in LLVM to {include/llvm,lib}/XRay. We improve the documentation a little bit for the publicly accessible headers, and adjust the top-matter. This also leads to some refactoring and cleanup in the tooling code. In particular, we do the following: - Rename the class from LogReader to Trace, as it better represents the logical set of records as opposed to a log. - Use file type detection instead of asking the user to say what format the input file is. This allows us to keep the interface simple and encapsulate the logic of loading the data appropriately. In future changes we increase the API surface and write dedicated unit tests for the XRay library. Depends on D24376. Reviewers: dblaikie, echristo Subscribers: mehdi_amini, mgorny, llvm-commits, varno Differential Revision: https://reviews.llvm.org/D28345 llvm-svn: 291652
* tools/llvm-xray: Avoid std::errc::protocol_* to appease mingw, like r285261.NAKAMURA Takumi2017-01-113-3/+3
| | | | | | They are oriented from winsock and mingw doesn't import them. llvm-svn: 291636
* [CodeView/PDB] Rename a bunch of files.Zachary Turner2017-01-1123-80/+81
| | | | | | | | | | | We were starting to get some name clashes between llvm-pdbdump and the common CodeView framework, so I took this opportunity to rename a bunch of files to more accurately describe their usage. This also helps in llvm-pdbdump to distinguish between different files and whether they are used for pretty dump mode or raw dump mode. llvm-svn: 291627
* [llvm-config] Canonicalize CMake booleans to 0/1Michal Gorny2017-01-103-16/+17
| | | | | | | | | | | | | | | | | | | | Following the similar change to lit configuration, ensure that all CMake booleans are canonicalized to 0/1 when being passed to llvm-config. This fixes the incorrect interpretation of values when user passes another value than the ON/OFF, and simplifies the code by removing unnecessary string matching. Furthermore, the code for --has-rtti and --has-global-isel has been modified to print consistent values indepdently of the boolean used by passed by the user to CMake. Sadly, the code already implicitly used different values for the two (YES/NO for --has-rtti, ON/OFF for --has-global-isel). Include tests for all booleans and multi-value options in llvm-config. Differential Revision: https://reviews.llvm.org/D28366 llvm-svn: 291593
* [ObjectYAML] Support for DWARF line tablesChris Bieneman2017-01-104-1/+225
| | | | | | | | | | | | | | One more try... relanding r291541 with a fix to properly gate MaxOpsPerInst on DWARF version. Description from r291541: This patch re-lands r291470, which failed on Linux bots. The issue (I believe) was undefined behavior because the size of llvm::dwarf::LineNumberOps was not explcitly specified or consistently respected. The updated patch adds an explcit underlying type to the enum and preserves the size more correctly. Original description: This patch adds support for the DWARF debug_lines section. The line table state machine opcodes are preserved, so this can be used to test the state machine evaluation directly. llvm-svn: 291546
* Revert "[ObjectYAML] Support for DWARF line tables"Chris Bieneman2017-01-104-225/+1
| | | | | | | | | | This reverts commit r291541. Still failing on a bot: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/47224/steps/test_llvm/logs/stdio llvm-svn: 291542
* [ObjectYAML] Support for DWARF line tablesChris Bieneman2017-01-104-1/+225
| | | | | | | | | | This patch re-lands r291470, which failed on Linux bots. The issue (I believe) was undefined behavior because the size of llvm::dwarf::LineNumberOps was not explcitly specified or consistently respected. The updated patch adds an explcit underlying type to the enum and preserves the size more correctly. Original description: This patch adds support for the DWARF debug_lines section. The line table state machine opcodes are preserved, so this can be used to test the state machine evaluation directly. llvm-svn: 291541
* [XRay] Fixup includes for modules buildDean Michael Berris2017-01-101-2/+0
| | | | | | | | Remove unnecessary system header include. Follow-up to D24376. llvm-svn: 291533
* [XRay] Don't include <unistd.h> unnecessarilyDean Michael Berris2017-01-101-1/+0
| | | | | | Follow-up to D24376. llvm-svn: 291531
* [XRay] Implement `llvm-xray convert` -- trace file conversionDean Michael Berris2017-01-1010-7/+813
| | | | | | | | | | | | | | | | | | | | This is the second part of a multi-part change to define additional subcommands to the `llvm-xray` tool. This change defines a conversion subcommand to take XRay log files, and turns them from one format to another (binary or YAML). This currently only supports the first version of the log file format, defined in the compiler-rt runtime. Depends on D21987. Reviewers: dblaikie, echristo Subscribers: mehdi_amini, dberris, beanz, llvm-commits Differential Revision: https://reviews.llvm.org/D24376 llvm-svn: 291529
* Revert "[ObjectYAML] Support for DWARF line tables"Chris Bieneman2017-01-094-225/+1
| | | | | | | | This reverts commit r291470 due to failing bots: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/47209/steps/test_llvm/logs/stdio llvm-svn: 291471
* [ObjectYAML] Support for DWARF line tablesChris Bieneman2017-01-094-1/+225
| | | | | | This patch adds support for the DWARF debug_lines section. The line table state machine opcodes are preserved, so this can be used to test the state machine evaluation directly. llvm-svn: 291470
* llvm-objdump: speed up -objc-meta-dataSaleem Abdulrasool2017-01-081-26/+5
| | | | | | | | | | | | | | | | | | Running a Debug build of objdump -objc-meta-data with a large Mach-O file is currently unnecessarily slow. With some local test input, this change reduces the run time from 75-85s down to 15-20s. The two changes are: Assert on pointer equality not array equality Replace vector<pair<address, symbol>> with DenseMap<address, symbol> Additionally, use a std::unique_ptr rather than handling the memory manually. Patch by Dave Lee! llvm-svn: 291398
* [llvm-opt-report] Fix context-sensitive lines where nothing happenedHal Finkel2017-01-071-3/+11
| | | | | | | | | | | | | | | | | Don't print a line multiple times, each for different inlining contexts, if nothing happened in any context. This prevents situations like this: [[ > main: 65 | if ((i * ni + j) % 20 == 0) fprintf > print_array: 65 | if ((i * ni + j) % 20 == 0) fprintf ]] which could happen if different optimizations were missed in different inlining contexts. llvm-svn: 291361
* [llvm-config] Print --system-libs only when static linkingMichal Gorny2017-01-061-2/+6
| | | | | | | | | | | | | | | Modify the --system-libs option in llvm-config to print system libs only when using static linking. The system libraries are irrelevant when linking to a shared library since the library has appropriate library dependencies embedded. Modify the --system-libs test appropriately to force static linking, and disable it if static libs are not available (i.e. BUILD_SHARED_LIBS is enabled). Differential Revision: https://reviews.llvm.org/D27805 llvm-svn: 291285
* [llvm-config] Add --cmakedir to obtain CMake module locationMichal Gorny2017-01-061-1/+9
| | | | | | | | | | | | Add a --cmakedir option to llvm-config that returns the correct path to built/installed CMake modules (i.e. lib/cmake/llvm). This is mostly intended as a convenience option for stand-alone builds of other LLVM projects that frequently reconstruct LLVM_CMAKE_PATH after querying llvm-config. Differential Revision: https://reviews.llvm.org/D26894 llvm-svn: 291218
* Add iterator support to DWARFDie to allow child DIE iteration.Greg Clayton2017-01-051-8/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D28303 llvm-svn: 291194
* MC: support passing search paths to the IASSaleem Abdulrasool2017-01-051-0/+3
| | | | | | | This is needed to support inclusion in inline assembly via the `.include` directive. llvm-svn: 291085
* [ThinLTO] Rework llvm-link to use the FunctionImporterTeresa Johnson2017-01-043-36/+18
| | | | | | | | | | | | | | | | | | | | Summary: Change llvm-link to use the FunctionImporter handling, instead of manually invoking the Linker. We still need to load the module in llvm-link to do the desired testing for invalid import requests (weak functions), and to get the GUID (in case the function is local). Also change the drop-debug-info test to use llvm-link so that importing is forced (in order to test debug info handling) and independent of import logic changes. Reviewers: mehdi_amini Subscribers: mgorny, llvm-commits, aprantl Differential Revision: https://reviews.llvm.org/D28277 llvm-svn: 290964
* Add llvm-bcanalyzer support for new metadata node types.Adrian Prantl2017-01-031-5/+9
| | | | | | Also sort the existing list by value. llvm-svn: 290901
* DebugInfo: change the PDB UniqueId type to uint8_tSaleem Abdulrasool2016-12-301-1/+1
| | | | | | | Since we type-erase the Windows GUID structure, use unsigned bytes rather than char, which may be signed (-fsigned-char). NFC llvm-svn: 290765
* Change Metadata Index emission in the bitcode to use 2x32 bits for the ↵Mehdi Amini2016-12-281-1/+6
| | | | | | | | | | placeholder The Bitstream reader and writer are limited to handle a "size_t" at most, which means that we can't backpatch and read back a 64bits value on 32 bits platform. llvm-svn: 290693
* Add an index for Module Metadata record in the bitcodeMehdi Amini2016-12-281-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | This index record the position for each metadata record in the bitcode, so that the reader will be able to lazy-load on demand each individual record. We also make sure that every abbrev is emitted upfront so that the block can be skipped while reading. I don't plan to commit this before having the reader counterpart, but I figured this can be reviewed mostly independently. Recommit r290684 (was reverted in r290686 because a test was broken) after adding a threshold to avoid emitting the index when unnecessary (little amount of metadata). This optimization "hides" a limitation of the ability to backpatch in the bitstream: we can only backpatch safely when the position has been flushed. So if we emit an index for one metadata, it is possible that (part of) the offset placeholder hasn't been flushed and the backpatch will fail. Differential Revision: https://reviews.llvm.org/D28083 llvm-svn: 290690
* Revert "Add an index for Module Metadata record in the bitcode"Saleem Abdulrasool2016-12-281-21/+0
| | | | | | | This reverts commit a0ca6ae2d38339e4ede0dfa588086fc23d87e836. Revert at Mehdi's request as it is breaking bots. llvm-svn: 290686
* Add an index for Module Metadata record in the bitcodeMehdi Amini2016-12-281-0/+21
| | | | | | | | | | | | | | | | | | | | | | Summary: This index record the position for each metadata record in the bitcode, so that the reader will be able to lazy-load on demand each individual record. We also make sure that every abbrev is emitted upfront so that the block can be skipped while reading. I don't plan to commit this before having the reader counterpart, but I figured this can be reviewed mostly independently. Reviewers: pcc, tejohnson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28083 llvm-svn: 290684
* [ThinLTO] Honor -O{0,1,2,4} passed through the libLTO interface for ThinLTOMehdi Amini2016-12-281-0/+19
| | | | | | | This was hardcoded to be O3 till now, without any way to change it without changing the code. llvm-svn: 290682
* llvm-readobj: ELF: Make DT tags machine awareHemant Kulkarni2016-12-271-13/+24
| | | | llvm-svn: 290623
* llvm-objdump: sort phdr type strings in advance of adding new onesEd Maste2016-12-241-7/+7
| | | | llvm-svn: 290494
* llvm-size: remove leading dash in '-radix' optionMehdi Amini2016-12-231-1/+1
| | | | | | cl::opt does not accept such option llvm-svn: 290466
* llvm-readobj: remove leading dash in '-a' option (ARMAttributesShort)Mehdi Amini2016-12-231-1/+1
| | | | | | cl::opt does not accept such option llvm-svn: 290465
* llvm-lto2: remove leading '-' for cl::opt declarationMehdi Amini2016-12-231-1/+1
| | | | llvm-svn: 290464
* llvm-lto2: Print diagnostics before exiting (NFC)Mehdi Amini2016-12-231-1/+5
| | | | llvm-svn: 290463
* llvm-lto: pass errs() to the module verifier (NFC)Mehdi Amini2016-12-231-1/+1
| | | | | | | It is more friendly to have the actual diagnostic when the verifier fails. llvm-svn: 290462
* [ObjectYAML] Fixing a compiler warningChris Bieneman2016-12-221-1/+1
| | | | | | Accidentally re-defined the variable instead of setting it. Oops! llvm-svn: 290388
* [ObjectYAML] Support for DWARF debug_info sectionChris Bieneman2016-12-224-4/+246
| | | | | | | | | | This patch adds support for YAML<->DWARF for debug_info sections. This re-lands r290147, reverted in 290148, re-landed in r290204 after fixing the issue that caused bots to fail (thank you UBSan!), and reverted again in r290209 due to failures on big endian systems. After adding support for preserving endianness, this should be good now. llvm-svn: 290386
* [ObjectYAML] Fixing big endian bots from r290381Chris Bieneman2016-12-221-1/+1
| | | | | | | Bot URL: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2505 llvm-svn: 290383
* [ObjectYAML] MachO support for endiannessChris Bieneman2016-12-224-89/+119
| | | | | | This patch adds support to the macho<->yaml tools for preserving endianness in MachO structures and DWARF data. llvm-svn: 290381
* IR: Function summary representation for type tests.Peter Collingbourne2016-12-211-0/+1
| | | | | | | | | | | Each function summary has an attached list of type identifier GUIDs. The idea is that during the regular LTO phase we would match these GUIDs to type identifiers defined by the regular LTO module and store the resolutions in a top-level "type identifier summary" (which will be implemented separately). Differential Revision: https://reviews.llvm.org/D27967 llvm-svn: 290280
* [sancov] skip duplicated pointsMike Aizatsky2016-12-211-0/+5
| | | | llvm-svn: 290278
OpenPOWER on IntegriCloud