summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/StringTableBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add support for merging strings with alignment larger than one char.Rafael Espindola2016-02-191-8/+16
| | | | | | This will be used in a lld patch. llvm-svn: 261326
* Reland "[CodeView] Use assembler directives for line tables"Reid Kleckner2016-01-291-8/+47
| | | | | | | | This reverts commit r259126 and relands r259117. This time with updated library dependencies. llvm-svn: 259130
* Revert "[CodeView] Use assembler directives for line tables"Reid Kleckner2016-01-291-47/+8
| | | | | | | | | This reverts commit r259117. The LineInfo constructor is defined in the codeview library and we have to link against it now. Doing that isn't trivial, so reverting for now. llvm-svn: 259126
* [CodeView] Use assembler directives for line tablesReid Kleckner2016-01-281-8/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a new family of .cv_* directives to LLVM's variant of GAS syntax: - .cv_file: Similar to DWARF .file directives - .cv_loc: Similar to the DWARF .loc directive, but starts with a function id. CodeView line tables are emitted by function instead of by compilation unit, so we needed an extra field to communicate this. Rather than overloading the .loc direction further, we decided it was better to have our own directive. - .cv_stringtable: Emits the codeview string table at the current position. Currently this just contains the filenames as null-terminated strings. - .cv_filechecksums: Emits the file checksum table for all files used with .cv_file so far. There is currently no support for emitting actual checksums, just filenames. This moves the line table emission code down into the assembler. This is in preparation for implementing the inlined call site line table format. The inline line table format encoding algorithm requires knowing the absolute code offsets, so it must run after the assembler has laid out the code. David Majnemer collaborated on this patch. llvm-svn: 259117
* Rename qsort -> multikey_qsort. NFC.Rui Ueyama2015-10-271-4/+4
| | | | | | `qsort` as a file-scope local function name was confusing. llvm-svn: 251414
* Optimize StringTableBuilder.Rui Ueyama2015-10-261-14/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a patch to improve StringTableBuilder's performance. That class' finalize function is very hot particularly in LLD because the function does tail-merge strings in string tables or SHF_MERGE sections. Generic std::sort-style sorter is not efficient for sorting strings. The function implemented in this patch seems to be more efficient. Here's a benchmark of LLD to link Clang with or without this patch. The numbers are medians of 50 runs. -O0 real 0m0.455s real 0m0.430s (5.5% faster) -O3 real 0m0.487s real 0m0.452s (7.2% faster) Since that is a benchmark of the whole linker, the speedup of StringTableBuilder itself is much more than that. http://reviews.llvm.org/D14053 llvm-svn: 251337
* Add a RAW mode to StringTableBuilder.Rafael Espindola2015-10-231-5/+16
| | | | | | | | | | | | In this mode it just tries to tail merge the strings without imposing any other format constrains. It will not, for example, add a null byte between them. Also add support for keeping a tentative size and offset if we decide to not optimize after all. This will be used shortly in lld for merging SHF_STRINGS sections. llvm-svn: 251153
* Fix the variable names to match the LLVM style.Rafael Espindola2015-10-231-27/+27
| | | | llvm-svn: 251143
* Avoid storing a second copy of each string in StringTableBuilder.Rafael Espindola2015-10-221-9/+20
| | | | | | This was only use in the extremely uncommon case of @@@ symbols on ELF. llvm-svn: 251039
* Fix broken build under MSVC.Zachary Turner2015-10-221-0/+2
| | | | llvm-svn: 251030
* Avoid hash lookups when finalizing StringTableBuilder. NFC.Rafael Espindola2015-10-221-10/+11
| | | | llvm-svn: 251024
* Use array_pod_sort. NFC.Rafael Espindola2015-10-221-4/+7
| | | | llvm-svn: 251023
* MachObjectWriter: optimize the string table for common sufficesHans Wennborg2014-10-061-3/+17
| | | | | | | | This is a follow-up to r207670 (ELF) and r218636 (COFF). Differential Revision: http://reviews.llvm.org/D5622 llvm-svn: 219126
* WinCOFFObjectWriter: optimize the string table for common sufficesHans Wennborg2014-09-291-4/+27
| | | | | | | | This is a follow-up from r207670 which did the same for ELF. Differential Revision: http://reviews.llvm.org/D5530 llvm-svn: 218636
* Revert r218380. This was breaking Apple internal build bots.Akira Hatanaka2014-09-241-6/+14
| | | | llvm-svn: 218409
* Replace a hand-written suffix compare with std::lexicographical_compare.Benjamin Kramer2014-09-241-14/+6
| | | | | | No functionality change. llvm-svn: 218380
* Invert the MC -> Object dependency.Rafael Espindola2014-07-031-0/+51
Now that we have a lib/MC/MCAnalysis, the dependency was there just because of two helper classes. Move the two over to MC. This will allow IRObjectFile to parse inline assembly. llvm-svn: 212248
OpenPOWER on IntegriCloud