summaryrefslogtreecommitdiffstats
path: root/llvm/lib/BinaryFormat/Dwarf.cpp
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/BinaryFormat/Dwarf.cpp
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/BinaryFormat/Dwarf.cpp')
-rw-r--r--llvm/lib/BinaryFormat/Dwarf.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/BinaryFormat/Dwarf.cpp b/llvm/lib/BinaryFormat/Dwarf.cpp
index 37c4579ef0f..86e3b02577f 100644
--- a/llvm/lib/BinaryFormat/Dwarf.cpp
+++ b/llvm/lib/BinaryFormat/Dwarf.cpp
@@ -575,3 +575,10 @@ bool llvm::dwarf::isValidFormForVersion(Form F, unsigned Version,
}
return ExtensionsOk;
}
+
+uint32_t llvm::dwarf::djbHash(StringRef Buffer) {
+ uint32_t H = 5381;
+ for (char C : Buffer.bytes())
+ H = ((H << 5) + H) + C;
+ return H;
+}
OpenPOWER on IntegriCloud