summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DIEHash.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Fix -Wdocumentation warning. NFCI.Simon Pilgrim2018-07-181-1/+1
| | | | llvm-svn: 337367
* [CodeGen] Fix inconsistent declaration parameter nameFangrui Song2018-07-161-1/+1
| | | | llvm-svn: 337200
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-011-18/+18
| | | | | | | | | | | | | | | | We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46290 llvm-svn: 331272
* DebugInfo: Include .dwo file name when hashing multiple CUs in a single fileMehdi Amini2017-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This is really a workaround for ThinLTO in particular - since it can import partial CUs that may end up looking very similar/the same as the same partial import in another ThinLTO compile. An alternative fix would be to change the DICompileUnit metadata to include a "primary file" or the like - and when importing for ThinLTO set the primary file to the name of the DICompileUnit that is being imported into. This involves changing the schema and would reduce the excessive uniqueness in the hash that this change creates - allowing diagnosing of more duplicate CUs than will be caught with this change. But duplicate CUs can still be caught in non-ThinLTO builds & are mostly a nuisance rather than a particularly deliberate/effective tool for finding broken code. (arguably the hash could always include the dwo file and nothing in fission would break, I think..) Reapply of r304119 after adding a triple to the test and moving it to the X86 directory. llvm-svn: 304130
* Revert "DebugInfo: Include .dwo file name when hashing multiple CUs in a ↵Mehdi Amini2017-05-291-1/+1
| | | | | | | | single file" This reverts commit r304119 and r304118. GreenDragon is broken. llvm-svn: 304125
* DebugInfo: Include .dwo file name when hashing multiple CUs in a single fileDavid Blaikie2017-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | This is really a workaround for ThinLTO in particular - since it can import partial CUs that may end up looking very similar/the same as the same partial import in another ThinLTO compile. An alternative fix would be to change the DICompileUnit metadata to include a "primary file" or the like - and when importing for ThinLTO set the primary file to the name of the DICompileUnit that is being imported into. This involves changing the schema and would reduce the excessive uniqueness in the hash that this change creates - allowing diagnosing of more duplicate CUs than will be caught with this change. But duplicate CUs can still be caught in non-ThinLTO builds & are mostly a nuisance rather than a particularly deliberate/effective tool for finding broken code. (arguably the hash could always include the dwo file and nothing in fission would break, I think..) llvm-svn: 304119
* Refactor DWARF hashing to use a .def file to avoid repetitionDavid Blaikie2017-05-231-51/+2
| | | | llvm-svn: 303666
* Apply another batch of fixes from clang-tidy's ↵Benjamin Kramer2016-06-171-1/+1
| | | | | | | | performance-unnecessary-value-param. Contains some manual fixes. No functionality change intended. llvm-svn: 273047
* [AsmPrinter] Prune dead code. NFC.Benjamin Kramer2015-10-151-3/+0
| | | | | | I left all (dead) print and dump methods in place. llvm-svn: 250433
* AsmPrinter: Convert DIE::Values to a linked listDuncan P. N. Exon Smith2015-06-251-1/+1
| | | | | | | | | | | | | | | | Change `DIE::Values` to a singly linked list, where each node is allocated on a `BumpPtrAllocator`. In order to support `push_back()`, the list is circular, and points at the tail element instead of the head. I abstracted the core list logic out to `IntrusiveBackList` so that it can be reused for `DIE::Children`, which also cares about `push_back()`. This drops llc memory usage from 799 MB down to 735 MB, about 8%. (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) llvm-svn: 240733
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-1/+1
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-1/+1
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* AsmPrinter: Stop exposing underlying DIEValue list, NFCDuncan P. N. Exon Smith2015-05-271-1/+1
| | | | | | | Change the `DIE` API to hide the implementation of the list of `DIEValue`s. llvm-svn: 238369
* AsmPrinter: Remove DIEHash::AttrEntry, NFCDuncan P. N. Exon Smith2015-05-271-58/+50
| | | | | | Remove "the most boring struct ever" (thanks to review by Eric). llvm-svn: 238366
* AsmPrinter: Store abbreviation data directly in DIE and DIEValueDuncan P. N. Exon Smith2015-05-271-1/+2
| | | | | | | | | | | | | | | | Stop storing a `DIEAbbrev` in `DIE`, since the data fits neatly inside the `DIEValue` list. Besides being a cleaner data structure (avoiding the parallel arrays), this gives us more freedom to rearrange the `DIEValue` list. This fixes the temporary memory regression from 845 MB up to 879 MB, and drops it further to 829 MB for a net memory decrease of around 1.9% (incremental decrease around 5.7%). (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) llvm-svn: 238364
* Reapply "AsmPrinter: Change DIEValue to be stored by value"Duncan P. N. Exon Smith2015-05-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit r238350, effectively reapplying r238349 after fixing (all?) the problems, all somehow related to how I was using `AlignedArrayCharUnion<>` inside `DIEValue`: - MSVC can only handle `sizeof()` on types, not values. Change the assert. - GCC doesn't know the `is_trivially_copyable` type trait. Instead of asserting it, add destructors. - Call placement new even when constructing POD (i.e., the pointers). - Instead of copying the char buffer, copy the casted classes. I've left in a couple of `static_assert`s that I think both MSVC and GCC know how to handle. If the bots disagree with me, I'll remove them. - Check that the constructed type is either standard layout or a pointer. This protects against a programming error: we really want the "small" `DIEValue`s to be small and simple, so don't accidentally change them not to be. - Similarly, check that the size of the buffer is no bigger than a `uint64_t` or a pointer. (I thought checking against `sizeof(uint64_t)` would be good enough, but Chandler suggested that pointers might sometimes be bigger than that in the context of sanitizers.) I've also committed r238359 in the meantime, which introduces a DIEValue.def to simplify dispatching between the various types (thanks to a review comment by David Blaikie). Without that, this commit would be almost unintelligible. Here's the original commit message: -- Change `DIEValue` to be stored/passed/etc. by value, instead of reference. It's now a discriminated union, with a `Val` field storing the actual type. The classes that used to inherit from `DIEValue` no longer do. There are two categories of these: - Small values fit in a single pointer and are stored by value. - Large values require auxiliary storage, and are stored by reference. The only non-mechanical change is to tools/dsymutil/DwarfLinker.cpp. It was relying on `DIEInteger`s being passed around by reference, so I replaced that assumption with a `PatchLocation` type that stores a safe reference to where the `DIEInteger` lives instead. This commit causes a temporary regression in memory usage, since I've left merging `DIEAbbrevData` into `DIEValue` for a follow-up commit. I measured an increase from 845 MB to 879 MB, around 3.9%. The follow-up drops it lower than the starting point, and I've only recently brought the memory this low anyway, so I'm committing these changes separately to keep them incremental. (I also considered swapping the commits, but the other one first would cause a lot more code churn.) (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) -- llvm-svn: 238362
* Revert "AsmPrinter: Change DIEValue to be stored by value"Duncan P. N. Exon Smith2015-05-271-2/+2
| | | | | | | | | This reverts commit r238349, since it caused some errors on bots: - std::is_trivially_copyable isn't available until GCC 5.0. - It was complaining about strict aliasing with my use of ArrayCharUnion. llvm-svn: 238350
* AsmPrinter: Change DIEValue to be stored by valueDuncan P. N. Exon Smith2015-05-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change `DIEValue` to be stored/passed/etc. by value, instead of reference. It's now a discriminated union, with a `Val` field storing the actual type. The classes that used to inherit from `DIEValue` no longer do. There are two categories of these: - Small values fit in a single pointer and are stored by value. - Large values require auxiliary storage, and are stored by reference. The only non-mechanical change is to tools/dsymutil/DwarfLinker.cpp. It was relying on `DIEInteger`s being passed around by reference, so I replaced that assumption with a `PatchLocation` type that stores a safe reference to where the `DIEInteger` lives instead. This commit causes a temporary regression in memory usage, since I've left merging `DIEAbbrevData` into `DIEValue` for a follow-up commit. I measured an increase from 845 MB to 879 MB, around 3.9%. The follow-up drops it lower than the starting point, and I've only recently brought the memory this low anyway, so I'm committing these changes separately to keep them incremental. (I also considered swapping the commits, but the other one first would cause a lot more code churn.) (I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`; see r236629 for details.) llvm-svn: 238349
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-141-1/+1
| | | | | | | | | | | utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
* 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
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-2/+2
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* [C++] Use 'nullptr'.Craig Topper2014-04-241-1/+1
| | | | llvm-svn: 207083
* Add support for hashing location information for CU level hashes.Eric Christopher2014-03-081-0/+3
| | | | | | | Add a testcase based on sret.cpp where we can now hash the entire compile unit. llvm-svn: 203319
* Add include guards and make public a few routines that add valuesEric Christopher2014-03-071-1/+11
| | | | | | to the hash. llvm-svn: 203303
* Add support for hashing attributes with DW_FORM_block. This requiredEric Christopher2014-02-201-0/+8
| | | | | | | | | | | | | passing down an AsmPrinter instance so we could compute the size of the block which could be target specific. All of the test cases in the unittest don't have any target specific data so we can use a NULL AsmPrinter there. This also depends upon block data being added as integers. We can now hash the entire fission-cu.ll compile unit so turn the flag on there with the hash value. llvm-svn: 201752
* Formatting and 80-col.Eric Christopher2013-11-191-1/+2
| | | | llvm-svn: 195122
* DIEHash: Move header include to be first in the implementation file to flush ↵David Blaikie2013-11-131-0/+1
| | | | | | out header inclusion ordering issues llvm-svn: 194588
* DIEHash: Summary hashing of nested typesDavid Blaikie2013-10-251-0/+2
| | | | llvm-svn: 193427
* DIEHash: Const correct and use references where non-null/non-rebound.David Blaikie2013-10-241-11/+11
| | | | llvm-svn: 193363
* DIEHash: Refactor ref attribute hashing into smaller functionsDavid Blaikie2013-10-241-0/+13
| | | | llvm-svn: 193360
* DWARF type hashing: begin implementing Step 5, summary hashing in declarable ↵David Blaikie2013-10-211-2/+2
| | | | | | | | | contexts There are several other tag types that need similar handling but to ensure test coverage they'll be coming incrementally. llvm-svn: 193126
* DWARF type hashing: Handle multiple (including recursive) references to the ↵David Blaikie2013-10-211-0/+2
| | | | | | | | | | same type This uses a map, keeping the type DIE numbering separate from the DIEs themselves - alternatively we could do things the way GCC does if we want to add an integer to the DIE type to record the numbering there. llvm-svn: 193105
* DIEHash: Support for simple (non-recursive, non-reused) type referencesDavid Blaikie2013-10-171-0/+1
| | | | llvm-svn: 192924
* DIEHash: Use DW_FORM_sdata for integers, per spec.David Blaikie2013-10-161-0/+3
| | | | | | | This allows us to produce the same hash as GCC for at least some simple examples. llvm-svn: 192855
* Revert "Give internal classes hidden visibility."Benjamin Kramer2013-09-111-1/+1
| | | | | | | It works with clang, but GCC has different rules so we can't make all of those hidden. This reverts commit r190534. llvm-svn: 190536
* Give internal classes hidden visibility.Benjamin Kramer2013-09-111-1/+1
| | | | | | Worth 100k on a linux/x86_64 Release+Asserts clang. llvm-svn: 190534
* Add a hashing routine that handles hashing types. Add a test forEric Christopher2013-09-031-0/+3
| | | | | | hashing the contents of DW_FORM_data1 on top of a type with attributes. llvm-svn: 189862
* Sentences end with periods.Eric Christopher2013-09-031-2/+2
| | | | llvm-svn: 189861
* Add the rest of the stock attributes to the attribute table.Eric Christopher2013-09-031-1/+49
| | | | | | | | This won't affect the kinds of hashes we test for as we actually do hashing based on form and attribute. Change the fission-hash testcase one last time to handle DW_AT_comp_dir. llvm-svn: 189840
* Add support for DW_FORM_dataN and DW_FORM_udata to the DIE hashingEric Christopher2013-08-281-0/+1
| | | | | | | algorithm. Update the split dwarf hashing testcase accordingly - this should be the last time that the hash of an empty file changes. llvm-svn: 189427
* DebugInfo: Prefer references over pointers, pass by const reference for a ↵David Blaikie2013-08-141-2/+2
| | | | | | type that will grow in the future llvm-svn: 188422
* Pass DIEHash::collectAttributes output argument by-pointer instead of by-value.Evgeniy Stepanov2013-08-131-1/+1
| | | | | | Before this, collectAttributes() was operating on a local object. llvm-svn: 188254
* Add the start of DIE hashing for DWARF4 type units and split dwarfEric Christopher2013-08-131-3/+33
| | | | | | | | | | CUs. Currently only hashes the name of CUs and the names of any children, but it's an obvious first step to show the framework. The testcase should continue to be correct, however, as it's an empty TU. llvm-svn: 188243
* Remove empty constructor.Eric Christopher2013-08-121-3/+0
| | | | llvm-svn: 188232
* Move hash computation code into a separate class and file.Eric Christopher2013-08-081-0/+46
No functional change intended. llvm-svn: 188028
OpenPOWER on IntegriCloud