From 208cc6f48975320da1a71cf7f7eff497f4f43b75 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 5 Feb 2013 07:31:55 +0000 Subject: Add support for emitting a stub DW_AT_GNU_dwo_id as part of the DWARF5 split dwarf proposal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174350 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 13ad353..6b19c5a 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -685,6 +685,11 @@ CompileUnit *DwarfDebug::constructCompileUnit(const MDNode *N) { if (!FirstCU) FirstCU = NewCU; + + // This should be a unique identifier when we want to build .dwp files. + if (useSplitDwarf()) + NewCU->addUInt(Die, dwarf::DW_AT_GNU_dwo_id, dwarf::DW_FORM_data8, 0); + if (useSplitDwarf() && !SkeletonCU) SkeletonCU = constructSkeletonCU(N); @@ -2450,7 +2455,8 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const MDNode *N) { StringRef FN = sys::path::filename(T); NewCU->addLocalString(Die, dwarf::DW_AT_GNU_dwo_name, FN); - // FIXME: We also need DW_AT_dwo_id. + // This should be a unique identifier when we want to build .dwp files. + NewCU->addUInt(Die, dwarf::DW_AT_GNU_dwo_id, dwarf::DW_FORM_data8, 0); // FIXME: The addr base should be relative for each compile unit, however, // this one is going to be 0 anyhow. -- cgit v1.1