From f249dd14dedcc7626eaa71e76b0cdb5078f77200 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Wed, 23 Oct 2013 22:52:22 +0000 Subject: [PATCH] Debug Info: code clean up. Unifying the argument ordering of private construct functions in CompileUnit to follow constructTypeDIE(DIE &, DIBasicType), constructTypeDIE(DIE &, DIDerivedType), constructTypeDIE(DIE &, DICompositeType), constructSubrangeDIE and constructArrayTypeDIE. llvm-svn: 193284 --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 24 ++++++++++----------- lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 12 +++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index d8ef1232f2c..ba4c2766b14 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -796,11 +796,11 @@ void CompileUnit::addTemplateParams(DIE &Buffer, DIArray TParams) { for (unsigned i = 0, e = TParams.getNumElements(); i != e; ++i) { DIDescriptor Element = TParams.getElement(i); if (Element.isTemplateTypeParameter()) - getOrCreateTemplateTypeParameterDIE(DITemplateTypeParameter(Element), - Buffer); + getOrCreateTemplateTypeParameterDIE(Buffer, + DITemplateTypeParameter(Element)); else if (Element.isTemplateValueParameter()) - getOrCreateTemplateValueParameterDIE(DITemplateValueParameter(Element), - Buffer); + getOrCreateTemplateValueParameterDIE(Buffer, + DITemplateValueParameter(Element)); } } @@ -1096,7 +1096,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) { for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIDescriptor Enum(Elements.getElement(i)); if (Enum.isEnumerator()) - constructEnumTypeDIE(DIEnumerator(Enum), Buffer); + constructEnumTypeDIE(Buffer, DIEnumerator(Enum)); } DIType DTy = resolve(CTy.getTypeDerivedFrom()); if (DTy) { @@ -1167,7 +1167,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) { } else if (DDTy.isStaticMember()) { ElemDie = getOrCreateStaticMemberDIE(DDTy); } else { - ElemDie = createMemberDIE(DDTy, Buffer); + ElemDie = createMemberDIE(Buffer, DDTy); } } else if (Element.isObjCProperty()) { DIObjCProperty Property(Element); @@ -1270,8 +1270,8 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) { /// getOrCreateTemplateTypeParameterDIE - Find existing DIE or create new DIE /// for the given DITemplateTypeParameter. DIE * -CompileUnit::getOrCreateTemplateTypeParameterDIE(DITemplateTypeParameter TP, - DIE &Buffer) { +CompileUnit::getOrCreateTemplateTypeParameterDIE(DIE &Buffer, + DITemplateTypeParameter TP) { DIE *ParamDIE = getDIE(TP); if (ParamDIE) return ParamDIE; @@ -1289,8 +1289,8 @@ CompileUnit::getOrCreateTemplateTypeParameterDIE(DITemplateTypeParameter TP, /// getOrCreateTemplateValueParameterDIE - Find existing DIE or create new DIE /// for the given DITemplateValueParameter. DIE * -CompileUnit::getOrCreateTemplateValueParameterDIE(DITemplateValueParameter VP, - DIE &Buffer) { +CompileUnit::getOrCreateTemplateValueParameterDIE(DIE &Buffer, + DITemplateValueParameter VP) { DIE *ParamDIE = getDIE(VP); if (ParamDIE) return ParamDIE; @@ -1687,7 +1687,7 @@ void CompileUnit::constructArrayTypeDIE(DIE &Buffer, DICompositeType *CTy) { } /// constructEnumTypeDIE - Construct enum type DIE from DIEnumerator. -DIE *CompileUnit::constructEnumTypeDIE(DIEnumerator ETy, DIE &Buffer) { +DIE *CompileUnit::constructEnumTypeDIE(DIE &Buffer, DIEnumerator ETy) { DIE *Enumerator = new DIE(dwarf::DW_TAG_enumerator); Buffer.addChild(Enumerator); StringRef Name = ETy.getName(); @@ -1788,7 +1788,7 @@ DIE *CompileUnit::constructVariableDIE(DbgVariable *DV, bool isScopeAbstract) { } /// createMemberDIE - Create new member DIE. -DIE *CompileUnit::createMemberDIE(DIDerivedType DT, DIE &Buffer) { +DIE *CompileUnit::createMemberDIE(DIE &Buffer, DIDerivedType DT) { DIE *MemberDie = new DIE(DT.getTag()); Buffer.addChild(MemberDie); StringRef Name = DT.getName(); diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index b5d9d20c663..2b8c8a35c98 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -328,20 +328,20 @@ private: void constructArrayTypeDIE(DIE &Buffer, DICompositeType *CTy); /// constructEnumTypeDIE - Construct enum type DIE from DIEnumerator. - DIE *constructEnumTypeDIE(DIEnumerator ETy, DIE &Buffer); + DIE *constructEnumTypeDIE(DIE &Buffer, DIEnumerator ETy); /// createMemberDIE - Create new member DIE. - DIE *createMemberDIE(DIDerivedType DT, DIE &Buffer); + DIE *createMemberDIE(DIE &Buffer, DIDerivedType DT); /// getOrCreateTemplateTypeParameterDIE - Find existing DIE or create new DIE /// for the given DITemplateTypeParameter. - DIE *getOrCreateTemplateTypeParameterDIE(DITemplateTypeParameter TP, - DIE &Buffer); + DIE *getOrCreateTemplateTypeParameterDIE(DIE &Buffer, + DITemplateTypeParameter TP); /// getOrCreateTemplateValueParameterDIE - Find existing DIE or create /// new DIE for the given DITemplateValueParameter. - DIE *getOrCreateTemplateValueParameterDIE(DITemplateValueParameter TVP, - DIE &Buffer); + DIE *getOrCreateTemplateValueParameterDIE(DIE &Buffer, + DITemplateValueParameter TVP); /// getOrCreateStaticMemberDIE - Create new static data member DIE. DIE *getOrCreateStaticMemberDIE(DIDerivedType DT);