diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-09-27 07:38:41 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-09-27 07:38:41 +0000 |
commit | c94270c382320cb3fe9c4dc7bf31d56c94e9643d (patch) | |
tree | 4c1c1178faea69663c9960feb71cf5c5e5e39ff4 /lib | |
parent | ebb9633af0245a3eaf03d2a9f4ceb6375cc8769e (diff) | |
download | external_llvm-c94270c382320cb3fe9c4dc7bf31d56c94e9643d.tar.gz external_llvm-c94270c382320cb3fe9c4dc7bf31d56c94e9643d.tar.bz2 external_llvm-c94270c382320cb3fe9c4dc7bf31d56c94e9643d.zip |
Instruction::clone does not need to take an LLVMContext&. Remove that and
update all the callers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Instrumentation/RSProfiling.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/JumpThreading.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/LICM.cpp | 7 | ||||
-rw-r--r-- | lib/Transforms/Scalar/LoopRotation.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Scalar/TailDuplication.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Utils/BasicBlockUtils.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Utils/CloneFunction.cpp | 6 | ||||
-rw-r--r-- | lib/Transforms/Utils/InlineFunction.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 12 | ||||
-rw-r--r-- | lib/VMCore/Instructions.cpp | 86 |
13 files changed, 61 insertions, 70 deletions
diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp index 9997d9dca9..3b72260db8 100644 --- a/lib/Transforms/Instrumentation/RSProfiling.cpp +++ b/lib/Transforms/Instrumentation/RSProfiling.cpp @@ -397,7 +397,7 @@ Value* ProfilerRS::Translate(Value* v) { return i; } else { //translate this - Instruction* i2 = i->clone(v->getContext()); + Instruction* i2 = i->clone(); if (i->hasName()) i2->setName("dup_" + i->getName()); TransCache[i] = i2; diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index a2d210a36f..f490a6d7f2 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -2059,7 +2059,7 @@ bool GVN::performPRE(Function& F) { // will be available in the predecessor by the time we need them. Any // that weren't original present will have been instantiated earlier // in this loop. - Instruction *PREInstr = CurInst->clone(CurInst->getContext()); + Instruction *PREInstr = CurInst->clone(); bool success = true; for (unsigned i = 0, e = CurInst->getNumOperands(); i != e; ++i) { Value *Op = PREInstr->getOperand(i); diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 158b0d7f18..e2d9e0b9ec 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -292,7 +292,7 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L, if (NumPreds != 1) { // Clone the PHI and delete the original one. This lets IVUsers and // any other maps purge the original user from their records. - PHINode *NewPN = PN->clone(PN->getContext()); + PHINode *NewPN = PN->clone(); NewPN->takeName(PN); NewPN->insertBefore(PN); PN->replaceAllUsesWith(NewPN); diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp index 559b8cb72a..21b6cebca5 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/lib/Transforms/Scalar/JumpThreading.cpp @@ -934,7 +934,7 @@ bool JumpThreading::ThreadEdge(BasicBlock *BB, BasicBlock *PredBB, // Clone the non-phi instructions of BB into NewBB, keeping track of the // mapping and using it to remap operands in the cloned instructions. for (; !isa<TerminatorInst>(BI); ++BI) { - Instruction *New = BI->clone(BI->getContext()); + Instruction *New = BI->clone(); New->setName(BI->getName()); NewBB->getInstList().push_back(New); ValueMapping[BI] = New; diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 1c298785da..fe37ab4caa 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -36,7 +36,6 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" #include "llvm/Target/TargetData.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/LoopPass.h" @@ -476,8 +475,6 @@ void LICM::sink(Instruction &I) { ++NumSunk; Changed = true; - LLVMContext &Context = I.getContext(); - // The case where there is only a single exit node of this loop is common // enough that we handle it as a special (more efficient) case. It is more // efficient to handle because there are no PHI nodes that need to be placed. @@ -573,7 +570,7 @@ void LICM::sink(Instruction &I) { ExitBlock->getInstList().insert(InsertPt, &I); New = &I; } else { - New = I.clone(Context); + New = I.clone(); CurAST->copyValue(&I, New); if (!I.getName().empty()) New->setName(I.getName()+".le"); @@ -596,7 +593,7 @@ void LICM::sink(Instruction &I) { if (AI) { std::vector<AllocaInst*> Allocas; Allocas.push_back(AI); - PromoteMemToReg(Allocas, *DT, *DF, Context, CurAST); + PromoteMemToReg(Allocas, *DT, *DF, I.getContext(), CurAST); } } } diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp index ca394bdc46..34ba48c6b0 100644 --- a/lib/Transforms/Scalar/LoopRotation.cpp +++ b/lib/Transforms/Scalar/LoopRotation.cpp @@ -237,7 +237,7 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) { // This is not a PHI instruction. Insert its clone into original pre-header. // If this instruction is using a value from same basic block then // update it to use value from cloned instruction. - Instruction *C = In->clone(In->getContext()); + Instruction *C = In->clone(); C->setName(In->getName()); OrigPreHeader->getInstList().push_back(C); diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 82eb14fb2a..d8f6cc18a1 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -24,7 +24,6 @@ #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/IntrinsicInst.h" -#include "llvm/LLVMContext.h" #include "llvm/Type.h" #include "llvm/DerivedTypes.h" #include "llvm/Analysis/Dominators.h" @@ -2303,7 +2302,6 @@ void LoopStrengthReduce::OptimizeLoopTermCond(Loop *L) { // one register value. BasicBlock *LatchBlock = L->getLoopLatch(); BasicBlock *ExitingBlock = L->getExitingBlock(); - LLVMContext &Context = LatchBlock->getContext(); if (!ExitingBlock) // Multiple exits, just look at the exit in the latch block if there is one. @@ -2394,7 +2392,7 @@ void LoopStrengthReduce::OptimizeLoopTermCond(Loop *L) { Cond->moveBefore(TermBr); } else { // Otherwise, clone the terminating condition and insert into the loopend. - Cond = cast<ICmpInst>(Cond->clone(Context)); + Cond = cast<ICmpInst>(Cond->clone()); Cond->setName(L->getHeader()->getName() + ".termcond"); LatchBlock->getInstList().insert(TermBr, Cond); diff --git a/lib/Transforms/Scalar/TailDuplication.cpp b/lib/Transforms/Scalar/TailDuplication.cpp index 8345175e13..ee45231c1e 100644 --- a/lib/Transforms/Scalar/TailDuplication.cpp +++ b/lib/Transforms/Scalar/TailDuplication.cpp @@ -306,7 +306,7 @@ void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) { // keeping track of the mapping... // for (; BI != DestBlock->end(); ++BI) { - Instruction *New = BI->clone(BI->getContext()); + Instruction *New = BI->clone(); New->setName(BI->getName()); SourceBlock->getInstList().push_back(New); ValueMapping[BI] = New; diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp index 736d26e75f..4931ab3f7f 100644 --- a/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -663,7 +663,7 @@ void llvm::CopyPrecedingStopPoint(Instruction *I, if (I != I->getParent()->begin()) { BasicBlock::iterator BBI = I; --BBI; if (DbgStopPointInst *DSPI = dyn_cast<DbgStopPointInst>(BBI)) { - CallInst *newDSPI = DSPI->clone(I->getContext()); + CallInst *newDSPI = DSPI->clone(); newDSPI->insertBefore(InsertPos); } } diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp index fd72ca1d91..f042bc9f22 100644 --- a/lib/Transforms/Utils/CloneFunction.cpp +++ b/lib/Transforms/Utils/CloneFunction.cpp @@ -43,7 +43,7 @@ BasicBlock *llvm::CloneBasicBlock(const BasicBlock *BB, // Loop over all instructions, and copy them over. for (BasicBlock::const_iterator II = BB->begin(), IE = BB->end(); II != IE; ++II) { - Instruction *NewInst = II->clone(BB->getContext()); + Instruction *NewInst = II->clone(); if (II->hasName()) NewInst->setName(II->getName()+NameSuffix); NewBB->getInstList().push_back(NewInst); @@ -248,7 +248,7 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB, continue; } - Instruction *NewInst = II->clone(BB->getContext()); + Instruction *NewInst = II->clone(); if (II->hasName()) NewInst->setName(II->getName()+NameSuffix); NewBB->getInstList().push_back(NewInst); @@ -296,7 +296,7 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB, } if (!TerminatorDone) { - Instruction *NewInst = OldTI->clone(BB->getContext()); + Instruction *NewInst = OldTI->clone(); if (OldTI->hasName()) NewInst->setName(OldTI->getName()+NameSuffix); NewBB->getInstList().push_back(NewInst); diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index 4b133fd5e8..f9efc34dd9 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/lib/Transforms/Utils/InlineFunction.cpp @@ -374,7 +374,7 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD, BI != BE; ++BI) { if (DbgStopPointInst *DSPI = dyn_cast<DbgStopPointInst>(BI)) { if (DbgRegionEndInst *NewDREI = - dyn_cast<DbgRegionEndInst>(DREI->clone(Context))) + dyn_cast<DbgRegionEndInst>(DREI->clone())) NewDREI->insertAfter(DSPI); break; } diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 0938c44c96..92b1335843 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -16,7 +16,6 @@ #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/IntrinsicInst.h" -#include "llvm/LLVMContext.h" #include "llvm/Type.h" #include "llvm/DerivedTypes.h" #include "llvm/GlobalVariable.h" @@ -911,7 +910,7 @@ HoistTerminator: return true; // Okay, it is safe to hoist the terminator. - Instruction *NT = I1->clone(BB1->getContext()); + Instruction *NT = I1->clone(); BIParent->getInstList().insert(BI, NT); if (NT->getType() != Type::getVoidTy(BB1->getContext())) { I1->replaceAllUsesWith(NT); @@ -1151,7 +1150,6 @@ static bool BlockIsSimpleEnoughToThreadThrough(BasicBlock *BB) { /// ultimate destination. static bool FoldCondBranchOnPHI(BranchInst *BI) { BasicBlock *BB = BI->getParent(); - LLVMContext &Context = BB->getContext(); PHINode *PN = dyn_cast<PHINode>(BI->getCondition()); // NOTE: we currently cannot transform this case if the PHI node is used // outside of the block. @@ -1205,7 +1203,7 @@ static bool FoldCondBranchOnPHI(BranchInst *BI) { TranslateMap[PN] = PN->getIncomingValueForBlock(PredBB); } else { // Clone the instruction. - Instruction *N = BBI->clone(Context); + Instruction *N = BBI->clone(); if (BBI->hasName()) N->setName(BBI->getName()+".c"); // Update operands due to translation. @@ -1218,7 +1216,7 @@ static bool FoldCondBranchOnPHI(BranchInst *BI) { } // Check for trivial simplification. - if (Constant *C = ConstantFoldInstruction(N, Context)) { + if (Constant *C = ConstantFoldInstruction(N, BB->getContext())) { TranslateMap[BBI] = C; delete N; // Constant folded away, don't need actual inst } else { @@ -1554,7 +1552,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI) { // Clone Cond into the predecessor basic block, and or/and the // two conditions together. - Instruction *New = Cond->clone(BB->getContext()); + Instruction *New = Cond->clone(); PredBlock->getInstList().insert(PBI, New); New->takeName(Cond); Cond->setName(New->getName()+".old"); @@ -1814,7 +1812,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { << "INTO UNCOND BRANCH PRED: " << *Pred); Instruction *UncondBranch = Pred->getTerminator(); // Clone the return and add it to the end of the predecessor. - Instruction *NewRet = RI->clone(BB->getContext()); + Instruction *NewRet = RI->clone(); Pred->getInstList().push_back(NewRet); BasicBlock::iterator BBI = RI; diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index b7acce71e3..1300e5fa25 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -2999,7 +2999,7 @@ void SwitchInst::setSuccessorV(unsigned idx, BasicBlock *B) { // Define these methods here so vtables don't get emitted into every translation // unit that uses these classes. -GetElementPtrInst *GetElementPtrInst::clone(LLVMContext&) const { +GetElementPtrInst *GetElementPtrInst::clone() const { GetElementPtrInst *New = new(getNumOperands()) GetElementPtrInst(*this); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3009,7 +3009,7 @@ GetElementPtrInst *GetElementPtrInst::clone(LLVMContext&) const { return New; } -BinaryOperator *BinaryOperator::clone(LLVMContext&) const { +BinaryOperator *BinaryOperator::clone() const { BinaryOperator *New = Create(getOpcode(), Op<0>(), Op<1>()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3019,7 +3019,7 @@ BinaryOperator *BinaryOperator::clone(LLVMContext&) const { return New; } -FCmpInst* FCmpInst::clone(LLVMContext &Context) const { +FCmpInst* FCmpInst::clone() const { FCmpInst *New = new FCmpInst(getPredicate(), Op<0>(), Op<1>()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3028,7 +3028,7 @@ FCmpInst* FCmpInst::clone(LLVMContext &Context) const { } return New; } -ICmpInst* ICmpInst::clone(LLVMContext &Context) const { +ICmpInst* ICmpInst::clone() const { ICmpInst *New = new ICmpInst(getPredicate(), Op<0>(), Op<1>()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3038,7 +3038,7 @@ ICmpInst* ICmpInst::clone(LLVMContext &Context) const { return New; } -ExtractValueInst *ExtractValueInst::clone(LLVMContext&) const { +ExtractValueInst *ExtractValueInst::clone() const { ExtractValueInst *New = new ExtractValueInst(*this); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3047,7 +3047,7 @@ ExtractValueInst *ExtractValueInst::clone(LLVMContext&) const { } return New; } -InsertValueInst *InsertValueInst::clone(LLVMContext&) const { +InsertValueInst *InsertValueInst::clone() const { InsertValueInst *New = new InsertValueInst(*this); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3057,7 +3057,7 @@ InsertValueInst *InsertValueInst::clone(LLVMContext&) const { return New; } -MallocInst *MallocInst::clone(LLVMContext&) const { +MallocInst *MallocInst::clone() const { MallocInst *New = new MallocInst(getAllocatedType(), (Value*)getOperand(0), getAlignment()); @@ -3069,7 +3069,7 @@ MallocInst *MallocInst::clone(LLVMContext&) const { return New; } -AllocaInst *AllocaInst::clone(LLVMContext&) const { +AllocaInst *AllocaInst::clone() const { AllocaInst *New = new AllocaInst(getAllocatedType(), (Value*)getOperand(0), getAlignment()); @@ -3081,7 +3081,7 @@ AllocaInst *AllocaInst::clone(LLVMContext&) const { return New; } -FreeInst *FreeInst::clone(LLVMContext&) const { +FreeInst *FreeInst::clone() const { FreeInst *New = new FreeInst(getOperand(0)); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3091,7 +3091,7 @@ FreeInst *FreeInst::clone(LLVMContext&) const { return New; } -LoadInst *LoadInst::clone(LLVMContext&) const { +LoadInst *LoadInst::clone() const { LoadInst *New = new LoadInst(getOperand(0), Twine(), isVolatile(), getAlignment()); @@ -3103,7 +3103,7 @@ LoadInst *LoadInst::clone(LLVMContext&) const { return New; } -StoreInst *StoreInst::clone(LLVMContext&) const { +StoreInst *StoreInst::clone() const { StoreInst *New = new StoreInst(getOperand(0), getOperand(1), isVolatile(), getAlignment()); New->SubclassOptionalData = SubclassOptionalData; @@ -3114,7 +3114,7 @@ StoreInst *StoreInst::clone(LLVMContext&) const { return New; } -TruncInst *TruncInst::clone(LLVMContext&) const { +TruncInst *TruncInst::clone() const { TruncInst *New = new TruncInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3124,7 +3124,7 @@ TruncInst *TruncInst::clone(LLVMContext&) const { return New; } -ZExtInst *ZExtInst::clone(LLVMContext&) const { +ZExtInst *ZExtInst::clone() const { ZExtInst *New = new ZExtInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3134,7 +3134,7 @@ ZExtInst *ZExtInst::clone(LLVMContext&) const { return New; } -SExtInst *SExtInst::clone(LLVMContext&) const { +SExtInst *SExtInst::clone() const { SExtInst *New = new SExtInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3144,7 +3144,7 @@ SExtInst *SExtInst::clone(LLVMContext&) const { return New; } -FPTruncInst *FPTruncInst::clone(LLVMContext&) const { +FPTruncInst *FPTruncInst::clone() const { FPTruncInst *New = new FPTruncInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3154,7 +3154,7 @@ FPTruncInst *FPTruncInst::clone(LLVMContext&) const { return New; } -FPExtInst *FPExtInst::clone(LLVMContext&) const { +FPExtInst *FPExtInst::clone() const { FPExtInst *New = new FPExtInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3164,7 +3164,7 @@ FPExtInst *FPExtInst::clone(LLVMContext&) const { return New; } -UIToFPInst *UIToFPInst::clone(LLVMContext&) const { +UIToFPInst *UIToFPInst::clone() const { UIToFPInst *New = new UIToFPInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3174,7 +3174,7 @@ UIToFPInst *UIToFPInst::clone(LLVMContext&) const { return New; } -SIToFPInst *SIToFPInst::clone(LLVMContext&) const { +SIToFPInst *SIToFPInst::clone() const { SIToFPInst *New = new SIToFPInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3184,7 +3184,7 @@ SIToFPInst *SIToFPInst::clone(LLVMContext&) const { return New; } -FPToUIInst *FPToUIInst::clone(LLVMContext&) const { +FPToUIInst *FPToUIInst::clone() const { FPToUIInst *New = new FPToUIInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3194,7 +3194,7 @@ FPToUIInst *FPToUIInst::clone(LLVMContext&) const { return New; } -FPToSIInst *FPToSIInst::clone(LLVMContext&) const { +FPToSIInst *FPToSIInst::clone() const { FPToSIInst *New = new FPToSIInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3204,7 +3204,7 @@ FPToSIInst *FPToSIInst::clone(LLVMContext&) const { return New; } -PtrToIntInst *PtrToIntInst::clone(LLVMContext&) const { +PtrToIntInst *PtrToIntInst::clone() const { PtrToIntInst *New = new PtrToIntInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3214,7 +3214,7 @@ PtrToIntInst *PtrToIntInst::clone(LLVMContext&) const { return New; } -IntToPtrInst *IntToPtrInst::clone(LLVMContext&) const { +IntToPtrInst *IntToPtrInst::clone() const { IntToPtrInst *New = new IntToPtrInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3224,7 +3224,7 @@ IntToPtrInst *IntToPtrInst::clone(LLVMContext&) const { return New; } -BitCastInst *BitCastInst::clone(LLVMContext&) const { +BitCastInst *BitCastInst::clone() const { BitCastInst *New = new BitCastInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3234,7 +3234,7 @@ BitCastInst *BitCastInst::clone(LLVMContext&) const { return New; } -CallInst *CallInst::clone(LLVMContext&) const { +CallInst *CallInst::clone() const { CallInst *New = new(getNumOperands()) CallInst(*this); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3244,7 +3244,7 @@ CallInst *CallInst::clone(LLVMContext&) const { return New; } -SelectInst *SelectInst::clone(LLVMContext&) const { +SelectInst *SelectInst::clone() const { SelectInst *New = SelectInst::Create(getOperand(0), getOperand(1), getOperand(2)); @@ -3256,7 +3256,7 @@ SelectInst *SelectInst::clone(LLVMContext&) const { return New; } -VAArgInst *VAArgInst::clone(LLVMContext&) const { +VAArgInst *VAArgInst::clone() const { VAArgInst *New = new VAArgInst(getOperand(0), getType()); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3266,7 +3266,7 @@ VAArgInst *VAArgInst::clone(LLVMContext&) const { return New; } -ExtractElementInst *ExtractElementInst::clone(LLVMContext&) const { +ExtractElementInst *ExtractElementInst::clone() const { ExtractElementInst *New = ExtractElementInst::Create(getOperand(0), getOperand(1)); New->SubclassOptionalData = SubclassOptionalData; @@ -3277,7 +3277,7 @@ ExtractElementInst *ExtractElementInst::clone(LLVMContext&) const { return New; } -InsertElementInst *InsertElementInst::clone(LLVMContext&) const { +InsertElementInst *InsertElementInst::clone() const { InsertElementInst *New = InsertElementInst::Create(getOperand(0), getOperand(1), getOperand(2)); @@ -3289,7 +3289,7 @@ InsertElementInst *InsertElementInst::clone(LLVMContext&) const { return New; } -ShuffleVectorInst *ShuffleVectorInst::clone(LLVMContext&) const { +ShuffleVectorInst *ShuffleVectorInst::clone() const { ShuffleVectorInst *New = new ShuffleVectorInst(getOperand(0), getOperand(1), getOperand(2)); @@ -3301,7 +3301,7 @@ ShuffleVectorInst *ShuffleVectorInst::clone(LLVMContext&) const { return New; } -PHINode *PHINode::clone(LLVMContext&) const { +PHINode *PHINode::clone() const { PHINode *New = new PHINode(*this); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3311,7 +3311,7 @@ PHINode *PHINode::clone(LLVMContext&) const { return New; } -ReturnInst *ReturnInst::clone(LLVMContext&) const { +ReturnInst *ReturnInst::clone() const { ReturnInst *New = new(getNumOperands()) ReturnInst(*this); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3321,7 +3321,7 @@ ReturnInst *ReturnInst::clone(LLVMContext&) const { return New; } -BranchInst *BranchInst::clone(LLVMContext&) const { +BranchInst *BranchInst::clone() const { unsigned Ops(getNumOperands()); BranchInst *New = new(Ops, Ops == 1) BranchInst(*this); New->SubclassOptionalData = SubclassOptionalData; @@ -3332,7 +3332,7 @@ BranchInst *BranchInst::clone(LLVMContext&) const { return New; } -SwitchInst *SwitchInst::clone(LLVMContext&) const { +SwitchInst *SwitchInst::clone() const { SwitchInst *New = new SwitchInst(*this); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3342,7 +3342,7 @@ SwitchInst *SwitchInst::clone(LLVMContext&) const { return New; } -InvokeInst *InvokeInst::clone(LLVMContext&) const { +InvokeInst *InvokeInst::clone() const { InvokeInst *New = new(getNumOperands()) InvokeInst(*this); New->SubclassOptionalData = SubclassOptionalData; if (hasMetadata()) { @@ -3352,22 +3352,20 @@ InvokeInst *InvokeInst::clone(LLVMContext&) const { return New; } -UnwindInst *UnwindInst::clone(LLVMContext &C) const { - UnwindInst *New = new UnwindInst(C); +UnwindInst *UnwindInst::clone() const { + LLVMContext &Context = getContext(); + UnwindInst *New = new UnwindInst(Context); New->SubclassOptionalData = SubclassOptionalData; - if (hasMetadata()) { - LLVMContext &Context = getContext(); + if (hasMetadata()) Context.pImpl->TheMetadata.ValueIsCloned(this, New); - } return New; } -UnreachableInst *UnreachableInst::clone(LLVMContext &C) const { - UnreachableInst *New = new UnreachableInst(C); +UnreachableInst *UnreachableInst::clone() const { + LLVMContext &Context = getContext(); + UnreachableInst *New = new UnreachableInst(Context); New->SubclassOptionalData = SubclassOptionalData; - if (hasMetadata()) { - LLVMContext &Context = getContext(); + if (hasMetadata()) Context.pImpl->TheMetadata.ValueIsCloned(this, New); - } return New; } |