mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188243 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user