- Apr 06, 2017
-
-
Mehdi Amini authored
Module::getOrInsertFunction is using C-style vararg instead of variadic templates. From a user prospective, it forces the use of an annoying nullptr to mark the end of the vararg, and there's not type checking on the arguments. The variadic template is an obvious solution to both issues. Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu> Differential Revision: https://reviews.llvm.org/D31070 llvm-svn: 299699
-
Bryant Wong authored
Moving Modules into `testMergedProgram` is incorrect (and causes segmentation faults) since all callers expect to retain ownership. This is evidenced by the later calls to `unique_ptr<Module>::get` in the same function. Differential Revision: https://reviews.llvm.org/D31727 llvm-svn: 299596
-
- Apr 05, 2017
-
-
Petr Hosek authored
Note payloads are padded to a multiple of 4 bytes in size, but the size of the string that should be print can be smaller e.g. the n_descsz field in gold's version note is 9, so that's the whole size of the string that should be printed. The padding is part of the format of a SHT_NOTE section or PT_NOTE segment, but it's not part of the note itself. Printing the extra null bytes may confuse some tools, e.g. when the llvm-readobj is sent to grep, it treats the output as binary because it contains a null byte. Differential Revision: https://reviews.llvm.org/D30804 llvm-svn: 299576
-
Davide Italiano authored
llvm-svn: 299551
-
Davide Italiano authored
This makes it more consistent with other exit() calls in llvm-ar (and the tools in general). llvm-svn: 299549
-
Davide Italiano authored
llvm-svn: 299548
-
Davide Italiano authored
Patch by Sam Clegg! Differential Revision: https://reviews.llvm.org/D31351 llvm-svn: 299546
-
- Apr 04, 2017
-
-
Reid Kleckner authored
Summary: The TypeTableBuilder provides stable storage for type records. We don't need to copy all of the bytes into a flat vector before adding it to the TpiStreamBuilder. This makes addTypeRecord take an ArrayRef<uint8_t> and a hash code to go with it, which seems like a simplification. Reviewers: ruiu, zturner, inglorion Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31634 llvm-svn: 299406
-
Reid Kleckner authored
Summary: MASM can produce type streams that are not topologically sorted. It can even produce type streams with circular references, but those are not common in practice. Reviewers: inglorion, ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31629 llvm-svn: 299403
-
- Apr 03, 2017
-
-
Reid Kleckner authored
MASM can produce these type records. llvm-svn: 299388
-
Peter Collingbourne authored
Support for writing this module code was removed in r73220, which was well before the LLVM 3.0 release, so we do not need to be able to understand it for backwards compatibility. Differential Revision: https://reviews.llvm.org/D31563 llvm-svn: 299370
-
- Apr 01, 2017
-
-
Quentin Colombet authored
This reverts commit r299282. Didn't intend to commit this :( llvm-svn: 299288
-
Quentin Colombet authored
This patch refactors the code used in llc such that all the users of the addPassesToEmitFile API have access to a homogeneous way of handling start/stop-after/before options right out of the box. Previously each user would have needed to duplicate this logic and set up its own options. NFC llvm-svn: 299282
-
Konstantin Zhuravlyov authored
match the new metadata. NFC. llvm-svn: 299275
-
- Mar 31, 2017
-
-
Reid Kleckner authored
This is helpful when extracting objects from archives produced by MSVC's lib.exe, which users absolute paths to describe the archive members. llvm-svn: 299264
-
Peter Collingbourne authored
llvm-svn: 299184
-
Peter Collingbourne authored
Introduce symbol table data structures that can be potentially written to disk, have the LTO library build those data structures using temporarily constructed modules and redirect the LTO library implementation to go through those data structures. This allows us to remove the LLVMContext and Modules owned by InputFile. With this change I measured a peak memory consumption decrease from 5.4GB to 2.8GB in a no-op incremental ThinLTO link of Chromium on Linux. The impact on memory consumption is larger in COFF linkers where we are currently forced to materialize all metadata in order to read linker options. Peak memory consumption linking a large piece of Chromium for Windows with full LTO and debug info decreases from >64GB (OOM) to 15GB. Part of PR27551. Differential Revision: https://reviews.llvm.org/D31364 llvm-svn: 299168
-
Dean Michael Berris authored
Summary: Assertions assuming that function calls may not have zero durations do not seem to hold in the wild. There are valid cases where the conversion of the tsc counters end up becoming zero-length durations. These assertions don't really hold and the algorithms don't need those to be true for them to work. Reviewers: dblaikie, echristo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31519 llvm-svn: 299150
-
- Mar 30, 2017
-
-
Derek Schuff authored
Mostly this change adds support converting to and from YAML which will allow us to write more test cases for the WebAssembly MC and lld ports. Better support for objdump, readelf, and nm will be in followup CLs. I had to update the two wasm test binaries because they used the old style 'name' section which is no longer supported. Differential Revision: https://reviews.llvm.org/D31099 Patch by Sam Clegg llvm-svn: 299101
-
Simon Pilgrim authored
Based on corrections mentioned in patch for clang for PR27635 llvm-svn: 299072
-
- Mar 29, 2017
-
-
Adrian McCarthy authored
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
-
Dean Michael Berris authored
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
-
Peter Collingbourne authored
llvm-svn: 298960
-
Peter Collingbourne authored
This makes the predicates independent of the flag representation and makes the code a little easier to read. llvm-svn: 298951
-
- Mar 28, 2017
-
-
Mehdi Amini authored
Reviewers: tejohnson, pcc Subscribers: Prazek, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D30791 llvm-svn: 298936
-
- Mar 26, 2017
-
-
Shoaib Meenai authored
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
-
Andrew Wilkins authored
Patch by Koop Mast and Alex Arslan! Differential Revision: https://reviews.llvm.org/D28215 llvm-svn: 298798
-
- Mar 24, 2017
-
-
Reid Kleckner authored
Summary: MSVC does this when producing a PDB. Reviewers: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31316 llvm-svn: 298717
-
- Mar 23, 2017
-
-
Reid Kleckner authored
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
-
Teresa Johnson authored
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
-
Adrian McCarthy authored
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
-
- Mar 22, 2017
-
-
Konstantin Zhuravlyov authored
- 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
-
Saleem Abdulrasool authored
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
-
Serge Pavlov authored
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
-
Reid Kleckner authored
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
-
- Mar 21, 2017
-
-
Dehao Chen authored
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
-
Serge Pavlov authored
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
-
- Mar 20, 2017
-
-
Kevin Enderby authored
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
-
Maxim Ostapenko authored
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
-