From 429c8221cc2ec64ba617636a6dd0c0a26ee85c9d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 10 Dec 2007 01:48:29 +0000 Subject: [PATCH] Fix a big problem in the recent dtor refactoring work, now it passes 2007-11-19-InlineAsm.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44755 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Value.cpp | 64 ++++++++++---------------------------------- 1 file changed, 14 insertions(+), 50 deletions(-) diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index 9b5100c8f9a..be53ed2584e 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -137,41 +137,7 @@ Value::~Value() if (BinaryOperator *BO = dyn_cast(this)) BinaryOperator::destroyThis(BO); else if (CallInst *CI = dyn_cast(this)) - { - if(IntrinsicInst* II = dyn_cast(this)) - { - if(DbgInfoIntrinsic* DII = dyn_cast(this)) - { - if(DbgDeclareInst* DDI = dyn_cast(this)) - DbgDeclareInst::destroyThis(DDI); - else if(DbgFuncStartInst* DFSI = dyn_cast(this)) - DbgFuncStartInst::destroyThis(DFSI); - else if(DbgRegionEndInst* DREI = dyn_cast(this)) - DbgRegionEndInst::destroyThis(DREI); - else if(DbgRegionStartInst* DRSI = dyn_cast(this)) - DbgRegionStartInst::destroyThis(DRSI); - else if(DbgStopPointInst* DSPI = dyn_cast(this)) - DbgStopPointInst::destroyThis(DSPI); - else - assert(0 && "Unknown DbgInfo-inherited class in ~Value."); - } - else if(MemIntrinsic* MI = dyn_cast(this)) - { - if(MemCpyInst* MCI = dyn_cast(this)) - MemCpyInst::destroyThis(MCI); - else if(MemMoveInst* MMI = dyn_cast(this)) - MemMoveInst::destroyThis(MMI); - else if(MemSetInst* MSI = dyn_cast(this)) - MemSetInst::destroyThis(MSI); - else - assert(0 && "Unknown MemIntrinsic-inherited class in ~Value."); - } - else - assert(0 && "Unknown IntrinsicInst-inherited class in ~Value."); - } - else - assert(0 && "Unknown CallInst-inherited class in ~Value."); - } + CallInst::destroyThis(CI); else if (CmpInst *CI = dyn_cast(this)) { if (FCmpInst *FCI = dyn_cast(this)) @@ -222,32 +188,30 @@ Value::~Value() MallocInst::destroyThis(MI); else assert(0 && "Unknown AllocationInst-inherited class in ~Value."); - } - else if(CastInst* CI = dyn_cast(this)) - { - if(BitCastInst* BCI = dyn_cast(this)) + } else if(CastInst* CI = dyn_cast(this)) { + if(BitCastInst* BCI = dyn_cast(CI)) BitCastInst::destroyThis(BCI); - else if(FPExtInst* FPEI = dyn_cast(this)) + else if(FPExtInst* FPEI = dyn_cast(CI)) FPExtInst::destroyThis(FPEI); - else if(FPToSIInst* FPSII = dyn_cast(this)) + else if(FPToSIInst* FPSII = dyn_cast(CI)) FPToSIInst::destroyThis(FPSII); - else if(FPToUIInst* FPUII = dyn_cast(this)) + else if(FPToUIInst* FPUII = dyn_cast(CI)) FPToUIInst::destroyThis(FPUII); - else if(FPTruncInst* FPTI = dyn_cast(this)) + else if(FPTruncInst* FPTI = dyn_cast(CI)) FPTruncInst::destroyThis(FPTI); - else if(IntToPtrInst* I2PI = dyn_cast(this)) + else if(IntToPtrInst* I2PI = dyn_cast(CI)) IntToPtrInst::destroyThis(I2PI); - else if(PtrToIntInst* P2II = dyn_cast(this)) + else if(PtrToIntInst* P2II = dyn_cast(CI)) PtrToIntInst::destroyThis(P2II); - else if(SExtInst* SEI = dyn_cast(this)) + else if(SExtInst* SEI = dyn_cast(CI)) SExtInst::destroyThis(SEI); - else if(SIToFPInst* SIFPI = dyn_cast(this)) + else if(SIToFPInst* SIFPI = dyn_cast(CI)) SIToFPInst::destroyThis(SIFPI); - else if(TruncInst* TI = dyn_cast(this)) + else if(TruncInst* TI = dyn_cast(CI)) TruncInst::destroyThis(TI); - else if(UIToFPInst* UIFPI = dyn_cast(this)) + else if(UIToFPInst* UIFPI = dyn_cast(CI)) UIToFPInst::destroyThis(UIFPI); - else if(ZExtInst* ZEI = dyn_cast(this)) + else if(ZExtInst* ZEI = dyn_cast(CI)) ZExtInst::destroyThis(ZEI); else assert(0 && "Unknown CastInst-inherited class in ~Value.");