summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Spelling mistakes in comments. NFCI.Simon Pilgrim2017-03-304-6/+6
| | | | | | Based on corrections mentioned in patch for clang for PR27635 llvm-svn: 299072
* llvm-pdbdump: If we don't change the color, don't reset the color.Adrian McCarthy2017-03-292-3/+8
| | | | | | | | | The -output-color option was successful at suppressing color changes, but was still allowing color resets. Differential Revision: https://reviews.llvm.org/D31468 llvm-svn: 299006
* [XRay][tools] Handle "no subcommand" case for llvm-xrayDean Michael Berris2017-03-291-1/+9
| | | | | | | | | | | | | | | | Summary: Currently the llvm-xray commandline tool fails to handle the case for when no subcommand is provided in a graceful manner. This fixes that to print the help message explaining the subcommands and the available options. Reviewers: pcc, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31409 llvm-svn: 298975
* More accurate header inclusions. NFC.Peter Collingbourne2017-03-282-1/+3
| | | | llvm-svn: 298960
* LTO: Replace InputFile::Symbol::getFlags() with predicate accessors. NFC.Peter Collingbourne2017-03-281-6/+4
| | | | | | | This makes the predicates independent of the flag representation and makes the code a little easier to read. llvm-svn: 298951
* Add support for -fno-builtin to LTO and ThinLTO to libLTOMehdi Amini2017-03-282-3/+15
| | | | | | | | | | Reviewers: tejohnson, pcc Subscribers: Prazek, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D30791 llvm-svn: 298936
* [llvm-readobj] Prefer ILT to IAT for reading COFF importsShoaib Meenai2017-03-261-6/+12
| | | | | | | | | | | | | | | | | | | | | | | We're seeing binutils ld produce binaries where the import address table's NameRVA entry is actually a VA instead (i.e. it's already base relocated), which llvm-readobj then chokes on. Both dumpbin and the Windows loader are able to handle these binaries correctly, however, and we can make llvm-readobj handle them correctly too by iterating the import lookup table (which doesn't have a relocated NameRVA) rather than the import address table. The import lookup table and the import address table are supposed to be identical on disk, and prior to r277298 the import lookup table would be used by `llvm-readobj -coff-imports` anyway, so this shouldn't have any functional change (except in the case of our malformed binaries). The import lookup table can apparently be missing when using old Borland linkers, so fall back to the import address table in that case. Resolves PR31766. Differential Revision: https://reviews.llvm.org/D31362 llvm-svn: 298812
* Add check for BSD when setting LIB_NAMES for GNU ldAndrew Wilkins2017-03-261-1/+1
| | | | | | | | Patch by Koop Mast and Alex Arslan! Differential Revision: https://reviews.llvm.org/D28215 llvm-svn: 298798
* [PDB] Split item and type records when merging type streamsReid Kleckner2017-03-243-18/+47
| | | | | | | | | | | | Summary: MSVC does this when producing a PDB. Reviewers: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31316 llvm-svn: 298717
* [PDB] Use two DBs when dumping the IPI streamReid Kleckner2017-03-232-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When dumping these records from an object file section, we should use only one type database. However, when dumping from a PDB, we should use two: one for the type stream and one for the IPI stream. Certain type records that normally live in the .debug$T object file section get moved over to the IPI stream of the PDB file and they get new indices. So far, I've noticed that the MSVC linker always moves these records into IPI: - LF_FUNC_ID - LF_MFUNC_ID - LF_STRING_ID - LF_SUBSTR_LIST - LF_BUILDINFO - LF_UDT_MOD_SRC_LINE These records have index fields that can point into TPI or IPI. In particular, LF_SUBSTR_LIST and LF_BUILDINFO point to LF_STRING_ID records to describe compilation command lines. I've modified the dumper to have an optional pointer to the item DB, and to do type name lookup of these fields in that DB. See printItemIndex. The result is that our pdbdump-headers.test is more faithful to the PDB contents and the output is less confusing. Reviewers: ruiu Subscribers: amccarth, zturner, llvm-commits Differential Revision: https://reviews.llvm.org/D31309 llvm-svn: 298649
* [ThinLTO] Add support for emitting minimized bitcode for thin linkTeresa Johnson2017-03-232-5/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The cumulative size of the bitcode files for a very large application can be huge, particularly with -g. In a distributed build environment, all of these files must be sent to the remote build node that performs the thin link step, and this can exceed size limits. The thin link actually only needs the summary along with a bitcode symbol table. Until we have a proper bitcode symbol table, simply stripping the debug metadata results in significant size reduction. Add support for an option to additionally emit minimized bitcode modules, just for use in the thin link step, which for now just strips all debug metadata. I plan to add a cc1 option so this can be invoked easily during the compile step. However, care must be taken to ensure that these minimized thin link bitcode files produce the same index as with the original bitcode files, as these original bitcode files will be used in the backends. Specifically: 1) The module hash used for caching is typically produced by hashing the written bitcode, and we want to include the hash that would correspond to the original bitcode file. This is because we want to ensure that changes in the stripped portions affect caching. Added plumbing to emit the same module hash in the minimized thin link bitcode file. 2) The module paths in the index are constructed from the module ID of each thin linked bitcode, and typically is automatically generated from the input file path. This is the path used for finding the modules to import from, and obviously we need this to point to the original bitcode files. Added gold-plugin support to take a suffix replacement during the thin link that is used to override the identifier on the MemoryBufferRef constructed from the loaded thin link bitcode file. The assumption is that the build system can specify that the minimized bitcode file has a name that is similar but uses a different suffix (e.g. out.thinlink.bc instead of out.o). Added various tests to ensure that we get identical index files out of the thin link step. Reviewers: mehdi_amini, pcc Subscribers: Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D31027 llvm-svn: 298638
* Add option to control whether llvm-pdbdump outputs in colorAdrian McCarthy2017-03-233-7/+17
| | | | | | | | | | | | | | Adds -color-output option to llvm-pdbdump pretty commands that lets the user specify whether the output should have color. The default depends on whether the output is going to a TTY (per prior discussion in https://reviews.llvm.org/D31246). This will enable tests that pipe llvm-pdbdump output to FileCheck to work across platforms without regard to the differences in ANSI codes. Differential Revision: https://reviews.llvm.org/D31263 llvm-svn: 298610
* [AMDGPU] Restructure code object metadata creationKonstantin Zhuravlyov2017-03-223-9/+10
| | | | | | | | | | | | | | | | | - Rename runtime metadata -> code object metadata - Make metadata not flow - Switch enums to use ScalarEnumerationTraits - Cleanup and move AMDGPUCodeObjectMetadata.h to AMDGPU/MCTargetDesc - Introduce in-memory representation for attributes - Code object metadata streamer - Create metadata for isa and printf during EmitStartOfAsmFile - Create metadata for kernel during EmitFunctionBodyStart - Finalize and emit metadata to .note during EmitEndOfAsmFile - Other minor improvements/bug fixes Differential Revision: https://reviews.llvm.org/D29948 llvm-svn: 298552
* c++filt: support COFF import thunksSaleem Abdulrasool2017-03-221-0/+6
| | | | | | | The synthetic thunk for the import is prefixed with __imp_. Attempt to undecorate the names when they begin with the __imp_ prefix. llvm-svn: 298550
* [CMake] Use variable interpolation instead of string concatenationSerge Pavlov2017-03-221-3/+3
| | | | | | | String concatenation used in r298336 allowed to get rid of extra spaces but also resulted in lost delimiter spaces, so use previous method. llvm-svn: 298498
* [codeview] Use separate records for LF_SUBSTR_LIST and LF_ARGLISTReid Kleckner2017-03-221-1/+5
| | | | | | | They are structurally the same, but now we need to distinguish them because one record lives in the IPI stream and the other lives in TPI. llvm-svn: 298474
* Do not inline hot callsites for samplepgo in thinlto compile phase.Dehao Chen2017-03-212-2/+3
| | | | | | | | | | | | | | Summary: Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in profile, thus we do not want to inline hot callsites in the first phase. Reviewers: tejohnson, eraman Reviewed By: tejohnson Subscribers: mehdi_amini, llvm-commits, Prazek Differential Revision: https://reviews.llvm.org/D31201 llvm-svn: 298428
* Fix evaluation of LLVM_DEFINITIONSSerge Pavlov2017-03-211-3/+3
| | | | | | | | | | | | | | | | CMake variable LLVM_DEFINITIONS collects preprocessor definitions provided for host compiler that builds llvm components. A function add_llvm_definitions was introduced in AddLLVMDefinitions.cmake to keep track of these definitions and was intended to be a replacement for CMake command add_definitions. Actually in many cases add_definitions is still used and the content of LLVM_DEFINITIONS is not actual now. On the other hand the current version of CMake allows getting set of definitions in a more convenient way. This fix implements evaluation of the variable by reading corresponding cmake property. Differential Revision: https://reviews.llvm.org/D31125 llvm-svn: 298336
* Add the rest of the error checking for Mach-O dyld compact bind entry errorsKevin Enderby2017-03-203-156/+38
| | | | | | | | | | | | | | | | | | | | | | | | | and test cases for each of the error checks. To do this more plumbing was needed so that the segment indexes and segment offsets can be checked. Basically what was done was the SegInfo from llvm-objdump’s MachODump.cpp was moved into libObject for Mach-O objects as BindRebaseSegInfo and it is only created when an iterator for bind or rebase entries are created. This commit really only adds the error checking and test cases for the bind table entires and the checking for the lazy bind and weak bind entries are still to be fully done as well as the rebase entires. Though some of the plumbing for those are added with this commit. Those other error checks and test cases will be added in follow on commits. Note, the two llvm_unreachable() calls should now actually be unreachable with the error checks in place and would take a logic bug in the error checking code to be reached if the segment indexes and segment offsets are used from a checked bind entry. Comments have been added to the methods that require the arguments to have been checked prior to calling. llvm-svn: 298292
* [sancov] Fix broken links and displaced coloring in coverage-report-server.pyMaxim Ostapenko2017-03-201-2/+2
| | | | | | | | | | | | | | This patch fixes two issues: * Fixed relative links to source files * Enumeration of lines in source files starts from 1 instead of 0 to align with .symcov files generated by sancov -symbolize Patch by Dmitiriy Nikiforov. Differential Revision: https://reviews.llvm.org/D31038 llvm-svn: 298250
* LTO: Fix a potential race condition in the caching API.Peter Collingbourne2017-03-172-10/+9
| | | | | | | | | | | | | | | | | | | | | After the call to sys::fs::exists succeeds, indicating a cache hit, we call AddFile and the client will open the file using the supplied path. If the client is using cache pruning, there is a potential race between the pruner and the client. To avoid this, change the caching API so that it provides a MemoryBuffer to the client, and have clients use that MemoryBuffer where possible. This scheme won't work with the gold plugin because the plugin API expects a file path. So we have the gold plugin use the buffer identifier as a path and live with the race for now. (Note that the gold plugin isn't actually affected by the problem at the moment because it doesn't support cache pruning.) This effectively reverts r279883 modulo the change to use the existing path in the gold plugin. Differential Revision: https://reviews.llvm.org/D31063 llvm-svn: 298020
* Resubmit r297897: [PGO] Value profile for size of memory intrinsic callsRong Xu2017-03-161-7/+32
| | | | | | | R297897 inadvertently enabled annotation for memop profiling. This new patch fixed it. llvm-svn: 297996
* Create msbuild only when using MSVCReid Kleckner2017-03-161-1/+1
| | | | | | | | | | | | | | | | | | | Summary: I could be wrong but it seems to have no use for MinGW. Related diff: https://reviews.llvm.org/D29772 Reviewers: chandlerc, rnk Reviewed By: rnk Patch by: Mateusz Mikuła Subscribers: rnk, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D29952 llvm-svn: 297985
* [PDB] Add support for parsing Flags from PDB Stream.Zachary Turner2017-03-166-1/+59
| | | | | | | | | | | | | | | | | | | This was discovered when running `llvm-pdbdump diff` against two files, the second of which was generated by running the first one through pdb2yaml and then yaml2pdb. The second one was missing some bytes from the PDB Stream, and tracking this down showed that at the end of the PDB Stream were some additional bytes that we were ignoring. Looking back to the reference code, these seem to specify some additional flags that indicate whether the PDB supports various optional features. This patch adds support for reading, writing, and round-tripping these flags through YAML and the raw dumper, and updates the tests accordingly. llvm-svn: 297984
* [llvm-pdbdump] Add support for diffing the PDB Stream.Zachary Turner2017-03-161-23/+110
| | | | | | | | | | In doing so I discovered that we completely ignore some bytes of the PDB Stream after we "finish" loading it. These bytes seem to specify some additional information about what kind of data is present in the PDB. A subsequent patch will add code to read in those fields and store their values. llvm-svn: 297983
* [llvm-pdbdump] clang-format Diff.cppZachary Turner2017-03-161-29/+42
| | | | | | | Looks like this file did not have clang-format run on it when its initial revision was committed. llvm-svn: 297977
* Revert "[PGO] Value profile for size of memory intrinsic calls"Eric Liu2017-03-161-32/+7
| | | | | | This commit reverts r297897 and r297909. llvm-svn: 297951
* Try to fix build break due to template argument deduction.Zachary Turner2017-03-151-6/+7
| | | | llvm-svn: 297902
* [llvm-pdbdump] Add support for diffing the String Table.Zachary Turner2017-03-151-16/+136
| | | | llvm-svn: 297901
* [pdb] Write the module info and symbol record streams.Zachary Turner2017-03-155-78/+94
| | | | | | | | | | | Previously we did not have support for writing detailed module information for each module, as well as the symbol records. This patch adds support for this, and in doing so enables the ability to construct minimal PDBs from just a few lines of YAML. A test is added to illustrate this functionality. llvm-svn: 297900
* [PGO] Value profile for size of memory intrinsic callsRong Xu2017-03-151-7/+32
| | | | | | | | | This patch adds the value profile support to profile the size parameter of memory intrinsic calls: memcpy, memcmp, and memmov. Differential Revision: http://reviews.llvm.org/D28965 llvm-svn: 297897
* Introduce NativeEnumModules and NativeCompilandSymbolAdrian McCarthy2017-03-151-1/+6
| | | | | | | | | | | Together, these allow lldb-pdbdump to list all the modules from a PDB using a native reader (rather than DIA). Note that I'll probably be specializing NativeRawSymbol in a subsequent patch. Differential Revision: https://reviews.llvm.org/D30956 llvm-svn: 297883
* Add the beginning of PDB diffing support.Zachary Turner2017-03-139-131/+526
| | | | | | | | | | For now this only diffs the stream directory and the MSF Superblock. Future patches will drill down into individual streams to find out where the differences lie. Differential Revision: https://reviews.llvm.org/D30908 llvm-svn: 297689
* Remove unused lambda captureDavid Blaikie2017-03-131-1/+1
| | | | llvm-svn: 297675
* [Linker] Provide callback for internalizationJonas Devlieghere2017-03-131-3/+20
| | | | | | Differential Revision: https://reviews.llvm.org/D30738 llvm-svn: 297649
* Use the new member accessors of llvm::enumerate.Zachary Turner2017-03-131-3/+3
| | | | | | | The value_type is no longer a struct, it's a class whose members you have to access via a method. llvm-svn: 297635
* [llvm-pdbdump] Add support for dumping symbols from Yaml -> PDB.Zachary Turner2017-03-133-31/+38
| | | | | | | | Previously we could round-trip type records from PDB -> Yaml -> PDB, but for symbols we could only go from PDB -> Yaml. This completes the round-tripping for symbols as well. llvm-svn: 297625
* [llvm-readobj] Support SHT_MIPS_DWARF section type flagSimon Atanasyan2017-03-101-0/+3
| | | | llvm-svn: 297448
* [PGO] Refactor profile dumping function for ease of adding other profile kindRong Xu2017-03-091-35/+56
| | | | | | | | Refactor the dumping function so that we can add other value profile kind easily. Differential Revision: https://reviews.llvm.org/D30752 llvm-svn: 297399
* Fix bugpoint to work with swifterror valuesArnold Schwaighofer2017-03-071-2/+4
| | | | llvm-svn: 297196
* llvm-objdump: handle line numbers and source options for amdgpu objectsKonstantin Zhuravlyov2017-03-071-0/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D30679 llvm-svn: 297193
* [ObjectYAML] Add support for DWARF5 Unit headerChris Bieneman2017-03-071-0/+2
| | | | | | In DWARF5 the Unit header added a new field, UnitType, and swapped the order of the address size and abbreviation offset fields. llvm-svn: 297183
* Fix test and add missing return for llvm-lto2 error caseTeresa Johnson2017-03-071-1/+3
| | | | | | | | | | | | | | | | | Summary: This test was missing the target triple. Once I fixed that, the case with the invalid character error stopped returning 1 from llvm-lto2 and the test reported a failure. Fixed by adding the missing return from llvm-lto2. Apparently we were failing when we eventually tried to get the target. Reviewers: pcc Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D30585 llvm-svn: 297173
* [ObjectYAML] Support for DW_FORM_implicit_const DWARF5 formChris Bieneman2017-03-061-0/+2
| | | | | | | | This patch adds support to the DWARF YAML reader and writer for the new DWARF5 abbreviation form, DW_FORM_implicit_const. The attribute was added in r291599. llvm-svn: 297091
* [DWARFv5] Update definitions to match published spec.Paul Robinson2017-03-061-1/+2
| | | | | | | | | | | | | Some late additions to DWARF v5 were not in Dwarf.def; also one form was redefined. Add the new cases to relevant switches in different parts of LLVM. Replace DW_FORM_ref_sup with DW_FORM_ref_sup[4,8]. I did not add support for DW_FORM_strx3/addrx3 other that defining the constants. We don't have any infrastructure to support these. Differential Revision: http://reviews.llvm.org/D30664 llvm-svn: 297085
* [ObjectYAML] [DWARF] Abstract DWARF Initial Length valuesChris Bieneman2017-03-031-12/+14
| | | | | | | | In the DWARF 4 Spec section 7.2.2, data in many DWARF sections, and some DWARF structures start with "Initial Length Values", which are a 32-bit length, and an optional 64-bit length if the 32 bit value == UINT32_MAX. This patch abstracts the Initial Length type in YAML, and extends its use to all the DWARF structures that are supported in the DWARFYAML code that have Initial Length values. llvm-svn: 296911
* [sancov] better input parameters validationMike Aizatsky2017-03-031-4/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D30370 llvm-svn: 296900
* [Support] Move Stream library from MSF -> Support.Zachary Turner2017-03-023-3/+3
| | | | | | | | | | After several smaller patches to get most of the core improvements finished up, this patch is a straight move and header fixup of the source. Differential Revision: https://reviews.llvm.org/D30266 llvm-svn: 296810
* Allow use of spaces in Bugpoint ‘--compile-command’ argumentDavid Bozier2017-03-021-21/+46
| | | | | | | | | | | | | | | | | Bug-Point functionality needs extending due to the patch D29185 by bd1976llvm (Allow llvm's build and test systems to support paths with spaces ). It requires Bugpoint to accept the use of spaces within ‘--compile-command’ tokens. Details Bugpoint uses the argument ‘--compile-command’ to pass in a command line argument as a string, the string is tokenized by the ‘lexCommand’ function using spaces as a delimiter. Patch D29185 will cause the unit test compile-custom.ll to fail as spaces are now required within tokens and as a delimiter. This patch allows the use of escape characters as below: Two consecutive '\' evaluate to a single '\'. A space after a '\' evaluates to a space that is not interpreted as a delimiter. Any other instances of the '\' character are removed. Committed on behalf of Owen Reynolds Differential revision: https://reviews.llvm.org/D29940 llvm-svn: 296763
* LTO: When creating a local cache, create the cache directory if it does not ↵Peter Collingbourne2017-03-022-2/+2
| | | | | | | | already exist. Differential Revision: https://reviews.llvm.org/D30519 llvm-svn: 296726
OpenPOWER on IntegriCloud