diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-03-24 03:40:11 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-03-24 03:40:11 +0000 |
commit | 31a5d3a4754d55757ff7f2ef3889655ebe0f4f08 (patch) | |
tree | 99b32314accbe7914a3f0fda5c306e687c6c195a /llvm/lib/CodeGen/MachineCodeForInstruction.cpp | |
parent | 377646fcfdac435f09371b8c81e02443a395950e (diff) | |
download | bcm5719-llvm-31a5d3a4754d55757ff7f2ef3889655ebe0f4f08.tar.gz bcm5719-llvm-31a5d3a4754d55757ff7f2ef3889655ebe0f4f08.zip |
Re-fix bug: Put back MachineCodeForInstruction::dropAllReferences.
llvm-svn: 1970
Diffstat (limited to 'llvm/lib/CodeGen/MachineCodeForInstruction.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineCodeForInstruction.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineCodeForInstruction.cpp b/llvm/lib/CodeGen/MachineCodeForInstruction.cpp index 97a53752e13..a4ebbec187f 100644 --- a/llvm/lib/CodeGen/MachineCodeForInstruction.cpp +++ b/llvm/lib/CodeGen/MachineCodeForInstruction.cpp @@ -18,6 +18,7 @@ #include "llvm/CodeGen/MachineCodeForInstruction.h" #include "llvm/CodeGen/MachineInstr.h" +#include "llvm/CodeGen/InstrSelection.h" #include "llvm/Instruction.h" static AnnotationID MCFI_AID( @@ -35,18 +36,37 @@ static struct Initializer { } } RegisterAID; -MachineCodeForInstruction &MachineCodeForInstruction::get(const Instruction *I){ + +MachineCodeForInstruction& +MachineCodeForInstruction::get(const Instruction *I){ return *(MachineCodeForInstruction*)I->getOrCreateAnnotation(MCFI_AID); } -void MachineCodeForInstruction::destroy(const Instruction *I) { + +void +MachineCodeForInstruction::destroy(const Instruction *I) { I->deleteAnnotation(MCFI_AID); } -MachineCodeForInstruction::MachineCodeForInstruction() : Annotation(MCFI_AID) {} +void +MachineCodeForInstruction::dropAllReferences() +{ + for (unsigned i=0, N=tempVec.size(); i < N; i++) + cast<TmpInstruction>(tempVec[i])->dropAllReferences(); +} + + +MachineCodeForInstruction::MachineCodeForInstruction() + : Annotation(MCFI_AID) +{} -MachineCodeForInstruction::~MachineCodeForInstruction() { + +MachineCodeForInstruction::~MachineCodeForInstruction() +{ + // Let go of all uses in temp. instructions + dropAllReferences(); + // Free the Value objects created to hold intermediate values for (unsigned i=0, N=tempVec.size(); i < N; i++) delete tempVec[i]; |