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 | ded1bf8cd8e5e289e038b8f2b30801d25fab6875 (patch) | |
tree | 345b0821f3e23d4a23aadfabc0fcfde905ae90ce /lib/CodeGen | |
parent | e4e4d4e2f9d49855712f6dc9e785d5d9416f0dab (diff) | |
download | external_llvm-ded1bf8cd8e5e289e038b8f2b30801d25fab6875.zip external_llvm-ded1bf8cd8e5e289e038b8f2b30801d25fab6875.tar.gz external_llvm-ded1bf8cd8e5e289e038b8f2b30801d25fab6875.tar.bz2 |
Re-fix bug: Put back MachineCodeForInstruction::dropAllReferences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1970 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/MachineCodeForInstruction.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/lib/CodeGen/MachineCodeForInstruction.cpp b/lib/CodeGen/MachineCodeForInstruction.cpp index 97a5375..a4ebbec 100644 --- a/lib/CodeGen/MachineCodeForInstruction.cpp +++ b/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]; |