diff --git a/llvm/include/llvm/ObjectYAML/DWARFEmitter.h b/llvm/include/llvm/ObjectYAML/DWARFEmitter.h index c7c307065150..eb56d1e29326 100644 --- a/llvm/include/llvm/ObjectYAML/DWARFEmitter.h +++ b/llvm/include/llvm/ObjectYAML/DWARFEmitter.h @@ -48,7 +48,8 @@ std::function getDWARFEmitterByName(StringRef SecName); Expected>> emitDebugSections(StringRef YAMLString, - bool IsLittleEndian = sys::IsLittleEndianHost); + bool IsLittleEndian = sys::IsLittleEndianHost, + bool Is64BitAddrSize = true); } // end namespace DWARFYAML } // end namespace llvm diff --git a/llvm/lib/ObjectYAML/DWARFEmitter.cpp b/llvm/lib/ObjectYAML/DWARFEmitter.cpp index deff6a68363b..1f79e3379b07 100644 --- a/llvm/lib/ObjectYAML/DWARFEmitter.cpp +++ b/llvm/lib/ObjectYAML/DWARFEmitter.cpp @@ -945,7 +945,8 @@ emitDebugSectionImpl(const DWARFYAML::Data &DI, StringRef Sec, } Expected>> -DWARFYAML::emitDebugSections(StringRef YAMLString, bool IsLittleEndian) { +DWARFYAML::emitDebugSections(StringRef YAMLString, bool IsLittleEndian, + bool Is64BitAddrSize) { auto CollectDiagnostic = [](const SMDiagnostic &Diag, void *DiagContext) { *static_cast(DiagContext) = Diag; }; @@ -956,6 +957,8 @@ DWARFYAML::emitDebugSections(StringRef YAMLString, bool IsLittleEndian) { DWARFYAML::Data DI; DI.IsLittleEndian = IsLittleEndian; + DI.Is64BitAddrSize = Is64BitAddrSize; + YIn >> DI; if (YIn.error()) return createStringError(YIn.error(), GeneratedDiag.getMessage()); diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp index 1d468a956e2b..bdf3babe81fb 100644 --- a/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp +++ b/llvm/unittests/DebugInfo/DWARF/DWARFDieTest.cpp @@ -65,7 +65,8 @@ TEST(DWARFDie, getLocations) { )"; Expected>> Sections = DWARFYAML::emitDebugSections(StringRef(yamldata), - /*IsLittleEndian=*/true); + /*IsLittleEndian=*/true, + /*Is64BitAddrSize=*/false); ASSERT_THAT_EXPECTED(Sections, Succeeded()); std::unique_ptr Ctx = DWARFContext::create(*Sections, 4, /*isLittleEndian=*/true);