Adjust comments regarding non-relocated abbrev offset in debug_info.dwo
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 2 Apr 2014 02:04:51 +0000 (02:04 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 2 Apr 2014 02:04:51 +0000 (02:04 +0000)
I'm not sure the comment in the implementation really adds a lot of
value (it's clear that we emit zero when no symbol is provided, but it
doesn't explain why we would do that). Happy to iterate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205386 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.cpp

index 9deb2f50f570df080c4c8a902dbde3c5a9c6f78b..11345eb288a84f72609e2de09dd822e8151c3294 100644 (file)
@@ -2709,7 +2709,9 @@ DwarfTypeUnit *DwarfDebug::constructSkeletonTU(DwarfTypeUnit *TU) {
 // compile units that would normally be in debug_info.
 void DwarfDebug::emitDebugInfoDWO() {
   assert(useSplitDwarf() && "No split dwarf debug info?");
-  InfoHolder.emitUnits(this, nullptr);
+  // Don't pass an abbrev symbol, using a constant zero instead so as not to
+  // emit relocations into the dwo file.
+  InfoHolder.emitUnits(this, /* AbbrevSymbol */nullptr);
 }
 
 // Emit the .debug_abbrev.dwo section for separated dwarf. This contains the
index dc3917b585754b41753bb12065ed5fe2d99b2839..97f251086ae947fcfabfd9783850615cba878754 100644 (file)
@@ -2040,7 +2040,7 @@ void DwarfUnit::emitHeader(const MCSymbol *ASectionSym) const {
   if (ASectionSym)
     Asm->EmitSectionOffset(ASectionSym, ASectionSym);
   else
-    // Use a constant value in the dwo file, to avoid relocations
+    // Use a constant value when no symbol is provided.
     Asm->EmitInt32(0);
   Asm->OutStreamer.AddComment("Address Size (in bytes)");
   Asm->EmitInt8(Asm->getDataLayout().getPointerSize());