[llvm] 311ff22 - [DwarfGenerator] Emit dwarf address section when dwarf version is not less than 4

Kai Luo via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 19:18:23 PST 2023


Author: Kai Luo
Date: 2023-02-10T03:18:18Z
New Revision: 311ff227b4327ed76156ce8691f56f8b8e12bf49

URL: https://github.com/llvm/llvm-project/commit/311ff227b4327ed76156ce8691f56f8b8e12bf49
DIFF: https://github.com/llvm/llvm-project/commit/311ff227b4327ed76156ce8691f56f8b8e12bf49.diff

LOG: [DwarfGenerator] Emit dwarf address section when dwarf version is not less than 4

Some targets (like AIX) might not feature dwarf address section due to low dwarf version. Check before emitting one.

Fixed DebugInfo unit test failures in https://lab.llvm.org/buildbot/#/builders/214/builds/5739.

Reviewed By: qiucf

Differential Revision: https://reviews.llvm.org/D143561

Added: 
    

Modified: 
    llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
index b683bfb2cfb23..c5b9f5cfc0d4a 100644
--- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
@@ -582,7 +582,8 @@ StringRef dwarfgen::Generator::generate() {
   StringPool->emit(*Asm, TLOF->getDwarfStrSection(),
                    TLOF->getDwarfStrOffSection());
 
-  AddressPool.emit(*Asm, TLOF->getDwarfAddrSection(), AddrTableStartSym);
+  if (Asm->getDwarfVersion() >= 5)
+    AddressPool.emit(*Asm, TLOF->getDwarfAddrSection(), AddrTableStartSym);
 
   MS->switchSection(TLOF->getDwarfInfoSection());
   for (auto &CU : CompileUnits) {


        


More information about the llvm-commits mailing list