summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* [PDB] Teach libpdb to write DBI Stream ECNames.Zachary Turner2017-07-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | Based strictly on the name, this seems to have something to do width edit & continue. The goal of this patch has nothing to do with supporting edit and continue though. msvc link.exe writes very basic information into this area even when *not* compiling with support for E&C, and so the goal here is to bring lld-link to parity. Since we cannot know what assumptions standard tools make about the content of PDB files, we need to be as close as possible. This ECNames data structure is a standard PDB string hash table. link.exe puts a single string into this hash table, which is the full path to the PDB file on disk. It then references this string from the module descriptor for the compiler generated `* Linker *` module. With this patch, lld-link will generate the exact same sequence of bytes as MSVC link for this subsection for a given object file input (as reported by `llvm-pdbutil bytes -ec`). llvm-svn: 307356
* [ORC] Errorize the ORC APIs.Lang Hames2017-07-072-18/+31
| | | | | | | | This patch updates the ORC layers and utilities to return and propagate llvm::Errors where appropriate. This is necessary to allow ORC to safely handle error cases in cross-process and remote JITing. llvm-svn: 307350
* Prototype: Reduce llvm-profdata merge memory usage furtherDavid Blaikie2017-07-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The InstrProfWriter already stores the name and hash of the record in the nested maps it uses for lookup while merging - this data is duplicated in the value within the maps. Refactor the InstrProfRecord to use a nested struct for the counters themselves so that InstrProfWriter can use this nested struct alone without the name or hash duplicated there. This work is incomplete, but enough to demonstrate the value (around a 50% decrease in memory usage for a large test case (10GB -> 5GB)). Though most of that decrease is probably from removing the SoftInstrProfError as well, but I haven't implemented a replacement for it yet. (it needs to go with the counters, because the operations on the counters - merging, etc, are where the failures are - unlike the name/hash which are totally unused by those counter-related operations and thus easy to split out) Ongoing discussion about removing SoftInstrProfError as a field of the InstrProfRecord is happening on the thread that added it - including the possibility of moving back towards an earlier version of that proposed patch that passed SoftInstrProfError through the various APIs, rather than as a member of InstrProfRecord. Reviewers: davidxl Differential Revision: https://reviews.llvm.org/D34838 llvm-svn: 307298
* Bitcode: Include any strings added to the string table in the module hash.Peter Collingbourne2017-07-061-1/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D35037 llvm-svn: 307286
* [opt-viewer] Move under tools, install itAdam Nemet2017-07-067-0/+885
| | | | | | | | | | | | | | | | | | | | We weren't installing opt-viewer and co before, this fixes the omission. I am also moving the tools from utils/ to tools/. I believe that this is more appropriate since these tools have matured greatly in the past year through contributions by multiple people (thanks!) so they are ready to become external tools. The tools are installed under <install>/share/opt-viewer/. I am *not* adding the llvm- prefix. If people feel strongly about adding that, this is probably a good time since the new location will require some mental adjustment anyway. Fixes PR33521 Differential Revision: https://reviews.llvm.org/D35048 llvm-svn: 307285
* Fix -Wunused-function by making function declarations in a header non-staticDavid Blaikie2017-07-061-2/+2
| | | | | | | | Also avoids ODR violations by ensuring names used in headers find the same entity, not different, file-local entities in each translation unit. llvm-svn: 307237
* Revert "Revert "Revert "Switch external cvtres.exe for llvm's own resource ↵Eric Beckmann2017-07-051-1/+0
| | | | | | | | | | | | | | library.""" This reverts commit ae21ee0b6cacbc1efaf4d42502e71da2f0eb45c3. The initial revert was done in order to prevent ongoing errors on chromium bots such as CrWinClangLLD. However, this was done haphazardly and I didn't realize there were test and compilation failures, so this revert was reverted. Now that those have been fixed, we can revert the revert of the revert. llvm-svn: 307227
* Fix std::min ambiguity between uint32 and size_t.Zachary Turner2017-07-051-1/+1
| | | | llvm-svn: 307205
* [llvm-pdbutil] Add the ability to truncate stream purpose names.Zachary Turner2017-07-054-36/+83
| | | | | | | This will be useful for aligning fields to a fixed with in subsequent patches. llvm-svn: 307204
* Revert "Revert "Switch external cvtres.exe for llvm's own resource library.""Eric Beckmann2017-07-051-10/+11
| | | | | | | | This reverts commit 165e578e47f1cd38191120aad23a9020fb5476dd. Forgot to run tests on this. llvm-svn: 307190
* Revert "Switch external cvtres.exe for llvm's own resource library."Eric Beckmann2017-07-051-11/+10
| | | | | | | | | This reverts commit 600d52c278e123dd08bee24c1f00932b55add8de. This patch still seems to break CrWinClangLLD, reverting until I can find root problem. llvm-svn: 307189
* [PDB] Add a test that verifies every known type record.Zachary Turner2017-07-052-5/+5
| | | | | | | | | | | | | | We had a lot of one-off tests for this type and that type, or "every type that happens to be generated by this program I built". Eventually I got a bug report filed where we were crashing on a type that was not covered by any of these tests. So this test carefully constructs a minimal C++ program that will cause every type we support to be emitted. This ensures full coverage for type records. Differential Revision: https://reviews.llvm.org/D34915 llvm-svn: 307187
* Fix dangling StringRefs found by clang-tidy misc-dangling-handle check.Alexander Kornienko2017-07-042-4/+8
| | | | llvm-svn: 307085
* [Orc] Remove the memory manager argument to addModule, and de-templatize theLang Hames2017-07-042-6/+5
| | | | | | | | | | | | | | | | symbol resolver argument. De-templatizing the symbol resolver is part of the ongoing simplification of ORC layer API. Removing the memory management argument (and delegating construction of memory managers for RTDyldObjectLinkingLayer to a functor passed in to the constructor) allows us to build JITs whose base object layers need not be compatible with RTDyldObjectLinkingLayer's memory mangement scheme. For example, a 'remote object layer' that sends fully relocatable objects directly to the remote does not need a memory management scheme at all (that will be handled by the remote). llvm-svn: 307058
* [ORE] Add diagnostics hotness thresholdBrian Gesiak2017-06-302-0/+16
| | | | | | | | | | | | | | | | | | | | Summary: Add an option to prevent diagnostics that do not meet a minimum hotness threshold from being output. When generating optimization remarks for large codebases with a ton of cold code paths, this option can be used to limit the optimization remark output at a reasonable size. Discussion of this change can be read here: http://lists.llvm.org/pipermail/llvm-dev/2017-June/114377.html Reviewers: anemet, davidxl, hfinkel Reviewed By: anemet Subscribers: qcolombet, javed.absar, fhahn, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D34867 llvm-svn: 306912
* Remove spurious semicolons.Zachary Turner2017-06-301-34/+0
| | | | llvm-svn: 306891
* [llvm-pdbutil] Output the symbol offset when dumping.Zachary Turner2017-06-303-46/+91
| | | | | | | | | | | | | | | | Type records have a unique type index, but symbol records do not. Instead, symbol records refer to other symbol records by referencing their offset in the symbol stream. In a sense this is the analogue of the TypeIndex, but we are not printing it in the dumper. Printing it not only gives us more useful information when manually investigating the contents of a PDB, but also allows us to write better tests by enabling us to verify that fields that reference other symbol records do so correctly. Differential Revision: https://reviews.llvm.org/D34906 llvm-svn: 306890
* Fix ODR violations due to abuse of LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTORRichard Smith2017-06-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | This is a short-term fix for PR33650 aimed to get the modules build bots green again. Remove all the places where we use the LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR macros to try to locally specialize a global template for a global type. That's not how C++ works. Instead, we now centrally define how to format vectors of fundamental types and of string (std::string and StringRef). We use flow formatting for the former cases, since that's the obvious right thing to do; in the latter case, it's less clear what the right choice is, but flow formatting is really bad for some cases (due to very long strings), so we pick block formatting. (Many of the cases that were using flow formatting for strings are improved by this change.) Other than the flow -> block formatting change for some vectors of strings, this should result in no functionality change. Differential Revision: https://reviews.llvm.org/D34907 Corresponding updates to clang, clang-tools-extra, and lld to follow. llvm-svn: 306878
* [llvm-pdbutil] Add the ability to dump the dependency tree for a typeZachary Turner2017-06-305-26/+91
| | | | | | | | | | | | | | | Previously we had the -type-index option which would dump the record of a single, but we had no way to follow the dependency graph backwards and also dump all dependent types. Having this option makes test-writing better, because we can limit the test to only those records that are of importance for the thing we're trying to test, which allows us to use things like CHECK-NEXT to reduce fragility. Differential Revision: https://reviews.llvm.org/D34899 llvm-svn: 306852
* [ORE] Unify spelling as "diagnostics hotness"Brian Gesiak2017-06-302-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: To enable profile hotness information in diagnostics output, Clang takes the option `-fdiagnostics-show-hotness` -- that's "diagnostics", with an "s" at the end. Clang also defines `CodeGenOptions::DiagnosticsWithHotness`. LLVM, on the other hand, defines `LLVMContext::getDiagnosticHotnessRequested` -- that's "diagnostic", not "diagnostics". It's a small difference, but it's confusing, typo-inducing, and frustrating. Add a new method with the spelling "diagnostics", and "deprecate" the old spelling. Reviewers: anemet, davidxl Reviewed By: anemet Subscribers: llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D34864 llvm-svn: 306848
* [llvm-readobj] Improve printouts for COFF ARM64 binariesMartin Storsjo2017-06-301-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D34835 llvm-svn: 306795
* [llvm-readobj] Include the PE magic value in printoutsMartin Storsjo2017-06-301-0/+1
| | | | | | | | This is useful for a testcase in lld. Differential Revision: https://reviews.llvm.org/D34836 llvm-svn: 306794
* Rewrite demangle memory handling.Eric Christopher2017-06-301-3/+5
| | | | | | | | The return of itaniumDemangle is allocated with malloc rather than new[] and so using unique_ptr isn't called for here. As a note for the future we should rewrite it to do this. llvm-svn: 306788
* Change the type of Undecorated to unique_ptr<char[]> since we're looking at ↵Eric Christopher2017-06-301-1/+1
| | | | | | | | a null terminated string and not a single character. Fixes an error in tcmalloc sized delete checking. llvm-svn: 306780
* llvm-nm: Add support for symbol demangling (-C/--demangle)Sam Clegg2017-06-292-7/+35
| | | | | | Differential Revision: https://reviews.llvm.org/D34668 llvm-svn: 306718
* [DWARF] NFC: DWARFDataExtractor combines relocs with DataExtractor.Paul Robinson2017-06-291-11/+12
| | | | | | | | | | | Requires callers to directly associate relocations with a DataExtractor used to read data from a DWARF section, which helps a callee not make assumptions about which section it is reading. This is the next step in reducing DWARFFormValue's dependence on DWARFUnit. Differential Revision: https://reviews.llvm.org/D34704 llvm-svn: 306699
* [NFC] Remove multiple semicolonsMandeep Singh Grang2017-06-281-1/+1
| | | | | | | | | | | | Reviewers: bogner, whitequark, mgrang Reviewed By: mgrang Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34785 llvm-svn: 306613
* Add missing library dependency to fix build break in llvm-lto2Hiroshi Inoue2017-06-282-1/+2
| | | | | | | | | error message CMakeFiles/llvm-lto2.dir/llvm-lto2.cpp.o: In function `dumpSymtab(int, char**)': llvm-lto2.cpp:(.text._ZL10dumpSymtabiPPc+0x238): undefined reference to `llvm::getBitcodeFileContents(llvm::MemoryBufferRef)' collect2: error: ld returned 1 exit status llvm-svn: 306507
* Object: Teach irsymtab::read() to try to use the irsymtab that we wrote to disk.Peter Collingbourne2017-06-271-1/+13
| | | | | | | | Fixes PR27551. Differential Revision: https://reviews.llvm.org/D33974 llvm-svn: 306488
* Bitcode: Write the irsymtab to disk.Peter Collingbourne2017-06-271-0/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D33973 llvm-svn: 306487
* [WebAssembly] Add support for printing relocations with llvm-objdumpSam Clegg2017-06-271-2/+18
| | | | | | Differential Revision: https://reviews.llvm.org/D34658 llvm-svn: 306461
* [WebAssembly] Add data size and alignement to linking sectionSam Clegg2017-06-272-16/+46
| | | | | | | | | The overal size of the data section (including BSS) is otherwise not included in the wasm binary. Differential Revision: https://reviews.llvm.org/D34657 llvm-svn: 306459
* [WebAssembly] Add more support for weak symbolsSam Clegg2017-06-261-0/+1
| | | | | | | | | Add weak symbol tests to MC Add symbol flags to output of `llvm-readobj -t`. Differential Revision: https://reviews.llvm.org/D34635 llvm-svn: 306330
* [DWARF] NFC: Collect info used by DWARFFormValue into a helper.Paul Robinson2017-06-262-7/+11
| | | | | | | | | | | Some forms have sizes that depend on the DWARF version, DWARF format (32/64-bit), or the size of an address. Collect these into a struct to simplify passing them around. Require callers to provide one when they query a form's size. Differential Revision: http://reviews.llvm.org/D34570 llvm-svn: 306315
* [llvm-pdbutil] Add a mode to `bytes` for dumping split debug chunks.Zachary Turner2017-06-263-43/+90
| | | | llvm-svn: 306309
* [llvm-stress] Add getRandom() helper that was going to be part of D34157. NFCI.Simon Pilgrim2017-06-261-27/+32
| | | | llvm-svn: 306294
* [llvm-stress] Remove Rand32 helper functionSimon Pilgrim2017-06-261-9/+5
| | | | | | To try and help avoid repeats of PR32585, remove Rand32 which is only called by Rand64 llvm-svn: 306285
* [llvm-stress] Ensure that the C++11 random device respects its min/max ↵Simon Pilgrim2017-06-261-2/+6
| | | | | | | | | | | | values (PR32585) As noted on PR32585, the change in D29780/rL295325 resulted in calls to Rand32() (values 0 -> 0xFFFFFFFF) but the min()/max() operators indicated it would be (0 -> 0x7FFFF). This patch changes the random operator to call Rand() instead which does respect the 0 -> 0x7FFFF range and asserts that the value is in range as well. Differential Revision: https://reviews.llvm.org/D34089 llvm-svn: 306281
* [bugpoint] Do not initialize disassembler passesTobias Grosser2017-06-261-1/+0
| | | | | | | | | | | We added the initilization of disassembler passes in r306208 with the goal to bring bugpoint in line with 'opt'. However, 'opt' does itself not initialize dissassembler passes. As our goal was consistency, we drop the initialization of dissassembler passes again from bugpoint. Thanks to Chandler for pointing this out! llvm-svn: 306275
* Ensure backends available in 'opt' are also available in 'bugpoint'Tobias Grosser2017-06-243-0/+11
| | | | | | | | | | | | | | | | | | | | | | This patch links LLVM back-ends into bugpoint the same way they are already available in 'opt' and 'clang'. This resolves an inconsistency that allowed the use of LLVM backends in loadable modules that run in 'opt', but that would prevent the debugging of these modules with bugpoint due to unavailable / unresolved symbols. For e.g. In D31859, Polly requires the NVPTX back-end. Reviewers: hfinkel, bogner, chandlerc, grosser, Meinersbur Subscribers: bollu, mgorny, grosser, Meinersbur Tags: #polly Contributed by: Singapuram Sanjay Differential Revision: https://reviews.llvm.org/D32003 llvm-svn: 306208
* [ORC] Re-apply r306166 and r306168 with fix for regression test.Lang Hames2017-06-232-51/+53
| | | | llvm-svn: 306182
* [llvm-pdbutil] Dump raw bytes of module symbols and debug chunks.Zachary Turner2017-06-234-0/+132
| | | | llvm-svn: 306179
* This reverts commit r306166 and r306168.Rafael Espindola2017-06-232-53/+51
| | | | | | | | | Revert "[ORC] Remove redundant semicolons from DEFINE_SIMPLE_CONVERSION_FUNCTIONS uses." Revert "[ORC] Move ORC IR layer interface from addModuleSet to addModule and fix the module type as std::shared_ptr<Module>." They broke ExecutionEngine/OrcMCJIT/test-global-ctors.ll on linux. llvm-svn: 306176
* [llvm-readobj] Fix COFF RVA table dumping bugReid Kleckner2017-06-231-1/+5
| | | | | | | | We would return an error in getVaPtr if the RVA table being dumped was the last data in the .rdata section. Avoid the issue by subtracting one from the offset and adding it back to get an open interval again. llvm-svn: 306171
* [llvm-pdbutil] Dump raw bytes of type and id records.Zachary Turner2017-06-234-0/+90
| | | | llvm-svn: 306167
* [ORC] Move ORC IR layer interface from addModuleSet to addModule and fix theLang Hames2017-06-232-51/+53
| | | | | | module type as std::shared_ptr<Module>. llvm-svn: 306166
* [llvm-pdbutil] Dump raw bytes of various DBI stream subsections.Zachary Turner2017-06-235-7/+138
| | | | llvm-svn: 306160
* [llvm-pdbutil] Show what blocks a stream occupies.Zachary Turner2017-06-233-0/+13
| | | | | | | | This is useful when you want to look at a specific chunk of a stream or look for discontinuities, and you need to know the list of blocks occupied by a stream. llvm-svn: 306150
* [llvm-pdbutil] Dump raw bytes of pdb name map.Zachary Turner2017-06-236-15/+30
| | | | | | | | This patch dumps the raw bytes of the pdb name map which contains the mapping of stream name to stream index for the string table and other reserved streams. llvm-svn: 306148
* [llvm-pdbutil] Add the ability to dump raw bytes from the file.Zachary Turner2017-06-234-20/+72
| | | | | | | | | | Normally we can only make sense of the content of a PDB in terms of streams and blocks, but in some cases it may be useful to dump bytes at a specific absolute file offset. For example, if you know that some interesting data is at a particular location and you want to see some surrounding data. llvm-svn: 306146
OpenPOWER on IntegriCloud