summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix some Clang-tidy modernize warnings, other minor fixes.Eugene Zelenko2015-11-041-1/+1
| | | | | | | | Fixed warnings are: modernize-use-override, modernize-use-nullptr and modernize-redundant-void-arg. Differential revision: http://reviews.llvm.org/D14312 llvm-svn: 252087
* MC: Clean up MCExpr naming. NFC.Jim Grosbach2015-05-301-3/+3
| | | | llvm-svn: 238634
* AsmPrinter: Avoid EmitLabelDifference() in DwarfAccelTableDuncan P. N. Exon Smith2015-05-241-1/+1
| | | | | | | | | | | | | | | | | | Mint a new function, `AsmPrinter::emitDwarfStringOffset()`, which takes a `DwarfStringPoolEntryRef`. When DWARF is relocatable across sections, this defers to `emitSectionOffset()` and emits the `MCSymbol`; otherwise, just emit the offset directly, without using any intermediate symbols. `EmitLabelDifference()` is already optimized to emit absolute label differences cheaply when possible, so there aren't any major memory savings here (853 MB down to 851 MB, or 0.2%). However, it prepares for making the `MCSymbol`s in the `DwarfStringPool` optional. (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) llvm-svn: 238119
* AsmPrinter: Use DwarfStringPoolEntry in DwarfAccelTable, NFCDuncan P. N. Exon Smith2015-05-241-5/+5
| | | | | | | This is just an API change, but it prepares to stop using `EmitLabelDifference()` when possible. llvm-svn: 238118
* [AsmPrinter] Make AsmPrinter's OutStreamer member a unique_ptr.Lang Hames2015-04-241-18/+18
| | | | | | | AsmPrinter owns the OutStreamer, so an owning pointer makes sense here. Using a reference for this is crufty. llvm-svn: 235752
* Centralize the handling of unique ids for temporary labels.Rafael Espindola2015-03-171-1/+1
| | | | | | | | | | | | | | | | Before this patch code wanting to create temporary labels for a given entity (function, cu, exception range, etc) had to keep its own counter to have stable symbol names. createTempSymbol would still add a suffix to make sure a new symbol was always returned, but it kept a single counter. Because of that, if we were to use just createTempSymbol("cu_begin"), the label could change from cu_begin42 to cu_begin43 because some other code started using temporary labels. Simplify this by just keeping one counter per prefix and removing the various specialized counters. llvm-svn: 232535
* Convert the easy cases of GetTempSymbol to createTempSymbol.Rafael Espindola2015-03-171-1/+1
| | | | | | | In these cases no code was depending on GetTempSymbol finding an existing symbol. llvm-svn: 232478
* Store an optional section start label in MCSection.Rafael Espindola2015-03-101-8/+7
| | | | | | | | | | | | This makes code that uses section relative expressions (debug info) simpler and less brittle. This is still a bit awkward as the symbol is created late and has to be stored in a mutable field. I will move the symbol creation earlier in the next patch. llvm-svn: 231802
* DwarfAccelTable: remove unneeded bucket terminators.Frederic Riss2015-03-101-2/+3
| | | | | | | | | | | Last commit fixed the handling of hash collisions, but it introdcuced unneeded bucket terminators in some places. The generated table was correct, it can just be a tiny bit smaller. As the previous table was correct, the test doesn't need updating. If we really wanted to test this, I could add the section size to the dwarf dump and test for a precise value there. IMO the correctness test is sufficient. llvm-svn: 231748
* DwarfAccelTable: Fix handling of hash collisions.Frederic Riss2015-03-101-5/+35
| | | | | | | | | | | | | | | | | It turns out accelerator tables where totally broken if they contained entries with colliding hashes. The failure mode is pretty bad, as it not only impacted the colliding entries, but would basically make all the entries after the first hash collision pointing in the wrong place. The testcase uses the symbol names that where found to collide during a clang build. From a performance point of view, the patch adds a sort and a linear walk over each bucket contents. While it has a measurable impact on the accelerator table emission, it's not showing up significantly in clang profiles (and I'd argue that correctness is priceless :-)). llvm-svn: 231732
* DwarfAccelTable: fix obvious typo.Frederic Riss2015-03-091-1/+1
| | | | | | | | | | | | I have a test for that issue, but I didn't include it in the commit as it's a 200KB file for a pretty minor issue. (The reason the file is so big is that it needs > 1024 variables/functions to trigger and that with debug information. The issue/fix on the other side is totally trivial. If poeple want the test commited, I can do that. It just didn't seem worth it to me. llvm-svn: 231701
* DwarfAccelTable: We know how many hashes we have in the output, just reserve ↵Benjamin Kramer2015-02-281-0/+1
| | | | | | the precise number llvm-svn: 230865
* Make DIE.h a public CodeGen header.Frederic Riss2015-01-051-1/+1
| | | | | | | | | | | | | | dsymutil would like to use all the AsmPrinter/MCStreamer infrastructure to stream out the DWARF. In order to do so, it will reuse the DIE object and so this header needs to be public. The interface exposed here has some corners that cannot be used without a DwarfDebug object, but clients that want to stream Dwarf can just avoid these. Differential Revision: http://reviews.llvm.org/D6695 llvm-svn: 225208
* Fix emission of Dwarf accelerator table when there are multiple CUs.Frederic Riss2014-11-121-3/+6
| | | | | | | | The DIE offset in the accel tables is an offset relative to the start of the debug_info section, but we were encoding the offset to the start of the containing CU. llvm-svn: 221837
* Remove the unused string section symbol parameter from DwarfFile::emitStringsDavid Blaikie2014-09-111-5/+6
| | | | | | | | | | | | | | | | | | | And since it /looked/ like the DwarfStrSectionSym was unused, I tried removing it - but then it turned out that DwarfStringPool was reconstructing the same label (and expecting it to have already been emitted) and uses that. So I kept it around, but wanted to pass it in to users - since it seemed a bit silly for DwarfStringPool to have it passed in and returned but itself have no use for it. The only two users don't handle strings in both .dwo and .o files so they only ever need the one symbol - no need to keep it (and have an unused symbol) in the DwarfStringPool used for fission/.dwo. Refactor a bunch of accelerator table usage to remove duplication so I didn't have to touch 4-5 callers. llvm-svn: 217628
* DwarfAccelTable: Store the string symbol in the accelerator table to avoid ↵David Blaikie2014-04-251-18/+17
| | | | | | | | | | duplicate lookup. This also avoids the need for subtly side-effecting calls to manifest strings in the string table at the point where items are added to the accelerator tables. llvm-svn: 207281
* Encapsulate the DWARF string pool in a separate type.David Blaikie2014-04-251-2/+2
| | | | | | | | | Pulls out some more code from some of the rather monolithic DWARF classes. Unlike the address table, the string table won't move up into DwarfDebug - each DWARF file has its own string table (but there can be only one address table). llvm-svn: 207277
* DwarfAccelTable: Remove trivial dtor and simplify construction with an array.David Blaikie2014-04-231-2/+0
| | | | llvm-svn: 207044
* Rename DwarfUnits to DwarfFile to help avoid some naming confusion.Eric Christopher2013-12-051-2/+2
| | | | llvm-svn: 196519
* DebugInfo: Constify accelerator table handling, and separate type ↵David Blaikie2013-11-191-1/+1
| | | | | | accelarator insertion in preparation for a second use of this code from type units. llvm-svn: 195164
* Move accelerator table defines and constants to Dwarf.h sinceEric Christopher2013-09-051-19/+1
| | | | | | | | we're proposing it for DWARF5. No functional change intended. llvm-svn: 190074
* Reformat.Eric Christopher2013-09-051-39/+50
| | | | llvm-svn: 190064
* StringRefize some debug accel table bits.Benjamin Kramer2013-05-111-1/+1
| | | | llvm-svn: 181663
* Last in the series of removing unnecessary '0' arguments forEric Christopher2013-01-091-1/+1
| | | | | | | address space. Reordered the EmitULEB128IntValue arguments to make this easier. llvm-svn: 171949
* Whitespace and 80-column cleanup.Eric Christopher2012-12-201-3/+3
| | | | llvm-svn: 170771
* Start splitting out the debug string section handling by moving itEric Christopher2012-12-201-3/+3
| | | | | | into the DwarfUnits class. llvm-svn: 170770
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-2/+2
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Fix up comment to be more clear.Eric Christopher2012-10-081-2/+2
| | | | llvm-svn: 165463
* Reduce malloc traffic in DwarfAccelTableBenjamin Kramer2012-04-131-36/+13
| | | | | | | | | - Don't copy offsets into HashData, the underlying vector won't change once the table is finalized. - Allocate HashData and HashDataContents in a BumpPtrAllocator. - Allocate string map entries in the same allocator. - Random cleanups. llvm-svn: 154694
* No need to do an expensive stable sort for a bunch of integers.Benjamin Kramer2012-03-261-3/+3
| | | | llvm-svn: 153438
* Prune some includes and forward declarations.Craig Topper2012-03-261-3/+4
| | | | llvm-svn: 153429
* Removing unused default switch cases in switches over enums that already ↵David Blaikie2012-01-161-1/+1
| | | | | | | | account for all enumeration values explicitly. (This time I believe I've checked all the -Wreturn-type warnings from GCC & added the couple of llvm_unreachables necessary to silence them. If I've missed any, I'll happily fix them as soon as I know about them) llvm-svn: 148262
* Use -> instead of (*iter).Eric Christopher2012-01-061-10/+10
| | | | llvm-svn: 147693
* Fix a leak I noticed while reviewing the accelerator table changes. PassesEric Christopher2012-01-061-0/+5
| | | | | | | | lldb testsuite. rdar://10652330 llvm-svn: 147673
* As part of the ongoing work in finalizing the accelerator tables, extendEric Christopher2012-01-061-15/+29
| | | | | | | | | the debug type accelerator tables to contain the tag and a flag stating whether or not a compound type is a complete type. rdar://10652330 llvm-svn: 147651
* Stabilize the output of the dwarf accelerator tables. Fixes a comparisonEric Christopher2011-11-151-2/+11
| | | | | | failure during bootstrap with it turned on. llvm-svn: 144731
* Rework adding function names to the dwarf accelerator tables, allowEric Christopher2011-11-101-1/+7
| | | | | | multiple dies per function and support C++ basenames. llvm-svn: 144304
* A few more places where we can avoid multiple size queries.Eric Christopher2011-11-081-7/+7
| | | | llvm-svn: 144099
* Don't evaluate Data.size() on every iteration.Eric Christopher2011-11-081-1/+1
| | | | llvm-svn: 144095
* Simple destructor to delete the hash data we created earlier.Eric Christopher2011-11-071-0/+5
| | | | llvm-svn: 144023
* Avoid the use of a local temporary for comment twines.Eric Christopher2011-11-071-6/+3
| | | | llvm-svn: 143974
* Remove unnecessary addition to API. Replace with something much simpler.Eric Christopher2011-11-071-1/+1
| | | | llvm-svn: 143925
* Add a new dwarf accelerator table prototype with the goal of replacingEric Christopher2011-11-071-0/+250
the pubnames and pubtypes tables. LLDB can currently use this format and a full spec is forthcoming and submission for standardization is planned. A basic summary: The dwarf accelerator tables are an indirect hash table optimized for null lookup rather than access to known data. They are output into an on-disk format that looks like this: .-------------. | HEADER | |-------------| | BUCKETS | |-------------| | HASHES | |-------------| | OFFSETS | |-------------| | DATA | `-------------' where the header contains a magic number, version, type of hash function, the number of buckets, total number of hashes, and room for a special struct of data and the length of that struct. The buckets contain an index (e.g. 6) into the hashes array. The hashes section contains all of the 32-bit hash values in contiguous memory, and the offsets contain the offset into the data area for the particular hash. For a lookup example, we could hash a function name and take it modulo the number of buckets giving us our bucket. From there we take the bucket value as an index into the hashes table and look at each successive hash as long as the hash value is still the same modulo result (bucket value) as earlier. If we have a match we look at that same entry in the offsets table and grab the offset in the data for our final match. llvm-svn: 143921
OpenPOWER on IntegriCloud