Added MachineCodeForInstruction object as an argument to

TmpInstruction constructors because every TmpInstruction object has
to be registered with a MachineCodeForInstruction to prevent leaks.
This simplifies the user's code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6469 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vikram S. Adve
2003-05-31 07:41:24 +00:00
parent 3497782f38
commit f3d3ca18b5
5 changed files with 35 additions and 15 deletions
@@ -33,9 +33,8 @@ InsertCodeToLoadConstant(Function *F,
TargetMachine& target)
{
// Create a tmp virtual register to hold the constant.
TmpInstruction* tmpReg = new TmpInstruction(opValue);
MachineCodeForInstruction &mcfi = MachineCodeForInstruction::get(vmInstr);
mcfi.addTemp(tmpReg);
TmpInstruction* tmpReg = new TmpInstruction(mcfi, opValue);
target.getInstrInfo().CreateCodeToLoadConst(target, F, opValue, tmpReg,
loadConstVec, mcfi);