summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2017-09-28 18:10:52 +0000
committerAdrian Prantl <aprantl@apple.com>2017-09-28 18:10:52 +0000
commit99fdb9d9270c9df61e29a926787c8aa4317187ba (patch)
tree03a860b1d8ad7c3f574c66ebead70d9ae18e1e74 /llvm/lib/CodeGen/AsmPrinter
parent705db63ce1544c6618a95c4fbf28bc9e994c091a (diff)
downloadbcm5719-llvm-99fdb9d9270c9df61e29a926787c8aa4317187ba.tar.gz
bcm5719-llvm-99fdb9d9270c9df61e29a926787c8aa4317187ba.zip
llvm-dwarfdump: implement --find for .apple_names
This patch implements the dwarfdump option --find=<name>. This option looks for a DIE in the accelerator tables and dumps it if found. This initial patch only adds support for .apple_names to keep the review small, adding the other sections and pubnames support should be trivial though. Differential Revision: https://reviews.llvm.org/D38282 llvm-svn: 314439
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h b/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h
index 92b3d50cd2f..f56199dc8e7 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h
@@ -68,13 +68,6 @@ class AsmPrinter;
class DwarfDebug;
class DwarfAccelTable {
- static uint32_t HashDJB(StringRef Str) {
- uint32_t h = 5381;
- for (unsigned i = 0, e = Str.size(); i != e; ++i)
- h = ((h << 5) + h) + Str[i];
- return h;
- }
-
// Helper function to compute the number of buckets needed based on
// the number of unique hashes.
void ComputeBucketCount();
@@ -199,7 +192,7 @@ private:
HashData(StringRef S, DwarfAccelTable::DataArray &Data)
: Str(S), Data(Data) {
- HashValue = DwarfAccelTable::HashDJB(S);
+ HashValue = dwarf::djbHash(S);
}
#ifndef NDEBUG
OpenPOWER on IntegriCloud