summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-08-13 01:21:55 +0000
committerEric Christopher <echristo@gmail.com>2013-08-13 01:21:55 +0000
commitd29614f98db4a31bcb1a76b0bad691a016cc035f (patch)
tree3dbba5f17b1ea1705154fdf3e63062bf6a7cef38 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent75f9aa9993acc7e611cde614fdb71c8c2d5bbdaa (diff)
downloadbcm5719-llvm-d29614f98db4a31bcb1a76b0bad691a016cc035f.tar.gz
bcm5719-llvm-d29614f98db4a31bcb1a76b0bad691a016cc035f.zip
Add the start of DIE hashing for DWARF4 type units and split dwarf
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
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index d3f6ec661e5..e81b933ee59 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -67,6 +67,11 @@ GenerateODRHash("generate-odr-hash", cl::Hidden,
cl::desc("Add an ODR hash to external type DIEs."),
cl::init(false));
+static cl::opt<bool>
+GenerateCUHash("generate-cu-hash", cl::Hidden,
+ cl::desc("Add the CU hash as the dwo_id."),
+ cl::init(false));
+
namespace {
enum DefaultOnOff {
Default,
@@ -1024,14 +1029,19 @@ void DwarfDebug::finalizeModuleInfo() {
// If we're splitting the dwarf out now that we've got the entire
// CU then construct a skeleton CU based upon it.
if (useSplitDwarf()) {
+ uint64_t ID = 0;
+ if (GenerateCUHash) {
+ DIEHash CUHash;
+ ID = CUHash.computeCUSignature(TheCU->getCUDie());
+ }
// This should be a unique identifier when we want to build .dwp files.
TheCU->addUInt(TheCU->getCUDie(), dwarf::DW_AT_GNU_dwo_id,
- dwarf::DW_FORM_data8, 0);
+ dwarf::DW_FORM_data8, ID);
// Now construct the skeleton CU associated.
CompileUnit *SkCU = constructSkeletonCU(CUI->first);
// This should be a unique identifier when we want to build .dwp files.
SkCU->addUInt(SkCU->getCUDie(), dwarf::DW_AT_GNU_dwo_id,
- dwarf::DW_FORM_data8, 0);
+ dwarf::DW_FORM_data8, ID);
}
}
OpenPOWER on IntegriCloud