From ba883cebd634c877e56341c1206b8518bcf40452 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 20 Nov 2013 18:52:39 +0000 Subject: [PATCH] DwarfCompileUnit: Initialize DebugInfoOffset. While not strictly necessary (the class has an invariant that "setDebugInfoOffset" is called before "getDebugInfoOffset" - anyone client that actually gets the default zero offset is buggy/broken) this is consistent with the code as originally written and the removal of the initialization was an accident in r195166. Suggested by Manman Ren. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195263 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 688791e04ff..17740259ef8 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -41,7 +41,7 @@ static cl::opt GenerateTypeUnits("generate-type-units", cl::Hidden, CompileUnit::CompileUnit(unsigned UID, DIE *D, DICompileUnit Node, AsmPrinter *A, DwarfDebug *DW, DwarfUnits *DWU) : UniqueID(UID), Node(Node), CUDie(D), Asm(A), DD(DW), DU(DWU), - IndexTyDie(0), Language(Node.getLanguage()) { + IndexTyDie(0), Language(Node.getLanguage()), DebugInfoOffset(0) { DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1); insertDIE(Node, D); } @@ -49,7 +49,7 @@ CompileUnit::CompileUnit(unsigned UID, DIE *D, DICompileUnit Node, CompileUnit::CompileUnit(unsigned UID, DIE *D, uint16_t Language, AsmPrinter *A, DwarfDebug *DD, DwarfUnits *DU) : UniqueID(UID), Node(NULL), CUDie(D), Asm(A), DD(DD), DU(DU), - IndexTyDie(0), Language(Language) { + IndexTyDie(0), Language(Language), DebugInfoOffset(0) { DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1); } -- 2.34.1