From 9576b15fcd384cc1c237ef11a528f4fad319d7ad Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Tue, 6 Nov 2001 05:01:54 +0000 Subject: [PATCH] Bug fix: Printing AdIBef and AdIAft outside the scope where they were declared, and in some cases when they were unintialized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1146 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/SparcV9/SparcV9RegInfo.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Target/SparcV9/SparcV9RegInfo.cpp b/lib/Target/SparcV9/SparcV9RegInfo.cpp index 9c57892392e..9f7d5c94fe6 100644 --- a/lib/Target/SparcV9/SparcV9RegInfo.cpp +++ b/lib/Target/SparcV9/SparcV9RegInfo.cpp @@ -1081,6 +1081,7 @@ void UltraSparcRegInfo::insertCallerSavingCode(const MachineInstr *MInst, MachineInstr *AdIBefCC, *AdIAftCC, *AdICpCC; + MachineInstr *AdIBef, *AdIAft; //---- Insert code for pushing the reg on stack ---------- @@ -1117,8 +1118,7 @@ void UltraSparcRegInfo::insertCallerSavingCode(const MachineInstr *MInst, } else { // for any other register type, just add the push inst - MachineInstr *AdIBef = - cpReg2MemMI(Reg, getStackPointer(), StackOff, RegType ); + AdIBef = cpReg2MemMI(Reg, getStackPointer(), StackOff, RegType ); ((PRA.AddedInstrMap[MInst])->InstrnsBefore).push_front(AdIBef); } @@ -1151,11 +1151,8 @@ void UltraSparcRegInfo::insertCallerSavingCode(const MachineInstr *MInst, } else { // for any other register type, just add the pop inst - MachineInstr *AdIAft = - cpMem2RegMI(getStackPointer(), StackOff, Reg, RegType ); - + AdIAft = cpMem2RegMI(getStackPointer(), StackOff, Reg, RegType ); ((PRA.AddedInstrMap[MInst])->InstrnsAfter).push_back(AdIAft); - } PushedRegSet.insert( Reg ); @@ -1163,7 +1160,10 @@ void UltraSparcRegInfo::insertCallerSavingCode(const MachineInstr *MInst, if(1) { cerr << "\nFor call inst:" << *MInst; cerr << "\n -inserted caller saving instrs:\n\t "; - cerr << *AdIBefCC << "\n\t" << *AdIAftCC ; + if( RegType == IntCCRegType ) + cerr << *AdIBefCC << "\n\t" << *AdIAftCC ; + else + cerr << *AdIBef << "\n\t" << *AdIAft ; } } // if not already pushed -- 2.34.1