llvm.org GIT mirror llvm / f79d253
Devirtualize Instruction::clone_impl git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240588 91177308-0d34-0410-b5e6-96231b3b80d8 Pete Cooper 4 years ago
5 changed file(s) with 206 addition(s) and 94 deletion(s). Raw diff Collapse all Expand all
138138 const Twine &Name, Instruction *InsertBefore);
139139 BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty,
140140 const Twine &Name, BasicBlock *InsertAtEnd);
141 BinaryOperator *clone_impl() const override;
141
142 // Note: Instruction needs to be a friend here to call cloneImpl.
143 friend class Instruction;
144 BinaryOperator *cloneImpl() const;
145
142146 public:
143147 // allocate space for exactly two operands
144148 void *operator new(size_t s) {
508508 Instruction *InsertBefore = nullptr);
509509 Instruction(Type *Ty, unsigned iType, Use *Ops, unsigned NumOps,
510510 BasicBlock *InsertAtEnd);
511 virtual Instruction *clone_impl() const = 0;
512
511
512 private:
513 /// Create a copy of this instruction.
514 Instruction *cloneImpl() const;
513515 };
514516
515517 inline Instruction *ilist_traits::createSentinel() const {
7575 Type *AllocatedType;
7676
7777 protected:
78 AllocaInst *clone_impl() const override;
78 // Note: Instruction needs to be a friend here to call cloneImpl.
79 friend class Instruction;
80 AllocaInst *cloneImpl() const;
81
7982 public:
8083 explicit AllocaInst(Type *Ty, Value *ArraySize = nullptr,
8184 const Twine &Name = "",
172175 class LoadInst : public UnaryInstruction {
173176 void AssertOK();
174177 protected:
175 LoadInst *clone_impl() const override;
178 // Note: Instruction needs to be a friend here to call cloneImpl.
179 friend class Instruction;
180 LoadInst *cloneImpl() const;
181
176182 public:
177183 LoadInst(Value *Ptr, const Twine &NameStr, Instruction *InsertBefore);
178184 LoadInst(Value *Ptr, const Twine &NameStr, BasicBlock *InsertAtEnd);
309315 void *operator new(size_t, unsigned) = delete;
310316 void AssertOK();
311317 protected:
312 StoreInst *clone_impl() const override;
318 // Note: Instruction needs to be a friend here to call cloneImpl.
319 friend class Instruction;
320 StoreInst *cloneImpl() const;
321
313322 public:
314323 // allocate space for exactly two operands
315324 void *operator new(size_t s) {
435444 void *operator new(size_t, unsigned) = delete;
436445 void Init(AtomicOrdering Ordering, SynchronizationScope SynchScope);
437446 protected:
438 FenceInst *clone_impl() const override;
447 // Note: Instruction needs to be a friend here to call cloneImpl.
448 friend class Instruction;
449 FenceInst *cloneImpl() const;
450
439451 public:
440452 // allocate space for exactly zero operands
441453 void *operator new(size_t s) {
504516 AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering,
505517 SynchronizationScope SynchScope);
506518 protected:
507 AtomicCmpXchgInst *clone_impl() const override;
519 // Note: Instruction needs to be a friend here to call cloneImpl.
520 friend class Instruction;
521 AtomicCmpXchgInst *cloneImpl() const;
522
508523 public:
509524 // allocate space for exactly three operands
510525 void *operator new(size_t s) {
657672 class AtomicRMWInst : public Instruction {
658673 void *operator new(size_t, unsigned) = delete;
659674 protected:
660 AtomicRMWInst *clone_impl() const override;
675 // Note: Instruction needs to be a friend here to call cloneImpl.
676 friend class Instruction;
677 AtomicRMWInst *cloneImpl() const;
678
661679 public:
662680 /// This enumeration lists the possible modifications atomicrmw can make. In
663681 /// the descriptions, 'p' is the pointer to the instruction's memory location,
826844 const Twine &NameStr, BasicBlock *InsertAtEnd);
827845
828846 protected:
829 GetElementPtrInst *clone_impl() const override;
847 // Note: Instruction needs to be a friend here to call cloneImpl.
848 friend class Instruction;
849 GetElementPtrInst *cloneImpl() const;
850
830851 public:
831852 static GetElementPtrInst *Create(Type *PointeeType, Value *Ptr,
832853 ArrayRef IdxList,
10771098 }
10781099
10791100 protected:
1101 // Note: Instruction needs to be a friend here to call cloneImpl.
1102 friend class Instruction;
10801103 /// \brief Clone an identical ICmpInst
1081 ICmpInst *clone_impl() const override;
1104 ICmpInst *cloneImpl() const;
1105
10821106 public:
10831107 /// \brief Constructor with insert-before-instruction semantics.
10841108 ICmpInst(
12091233 /// \brief Represents a floating point comparison operator.
12101234 class FCmpInst: public CmpInst {
12111235 protected:
1236 // Note: Instruction needs to be a friend here to call cloneImpl.
1237 friend class Instruction;
12121238 /// \brief Clone an identical FCmpInst
1213 FCmpInst *clone_impl() const override;
1239 FCmpInst *cloneImpl() const;
1240
12141241 public:
12151242 /// \brief Constructor with insert-before-instruction semantics.
12161243 FCmpInst(
13491376 Instruction *InsertBefore);
13501377 CallInst(Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd);
13511378 protected:
1352 CallInst *clone_impl() const override;
1379 // Note: Instruction needs to be a friend here to call cloneImpl.
1380 friend class Instruction;
1381 CallInst *cloneImpl() const;
1382
13531383 public:
13541384 static CallInst *Create(Value *Func,
13551385 ArrayRef Args,
16861716 setName(NameStr);
16871717 }
16881718 protected:
1689 SelectInst *clone_impl() const override;
1719 // Note: Instruction needs to be a friend here to call cloneImpl.
1720 friend class Instruction;
1721 SelectInst *cloneImpl() const;
1722
16901723 public:
16911724 static SelectInst *Create(Value *C, Value *S1, Value *S2,
16921725 const Twine &NameStr = "",
17411774 ///
17421775 class VAArgInst : public UnaryInstruction {
17431776 protected:
1744 VAArgInst *clone_impl() const override;
1777 // Note: Instruction needs to be a friend here to call cloneImpl.
1778 friend class Instruction;
1779 VAArgInst *cloneImpl() const;
17451780
17461781 public:
17471782 VAArgInst(Value *List, Type *Ty, const Twine &NameStr = "",
17811816 ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr,
17821817 BasicBlock *InsertAtEnd);
17831818 protected:
1784 ExtractElementInst *clone_impl() const override;
1819 // Note: Instruction needs to be a friend here to call cloneImpl.
1820 friend class Instruction;
1821 ExtractElementInst *cloneImpl() const;
17851822
17861823 public:
17871824 static ExtractElementInst *Create(Value *Vec, Value *Idx,
18421879 InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
18431880 const Twine &NameStr, BasicBlock *InsertAtEnd);
18441881 protected:
1845 InsertElementInst *clone_impl() const override;
1882 // Note: Instruction needs to be a friend here to call cloneImpl.
1883 friend class Instruction;
1884 InsertElementInst *cloneImpl() const;
18461885
18471886 public:
18481887 static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx,
18951934 ///
18961935 class ShuffleVectorInst : public Instruction {
18971936 protected:
1898 ShuffleVectorInst *clone_impl() const override;
1937 // Note: Instruction needs to be a friend here to call cloneImpl.
1938 friend class Instruction;
1939 ShuffleVectorInst *cloneImpl() const;
18991940
19001941 public:
19011942 // allocate space for exactly three operands
19962037 return User::operator new(s, 1);
19972038 }
19982039 protected:
1999 ExtractValueInst *clone_impl() const override;
2040 // Note: Instruction needs to be a friend here to call cloneImpl.
2041 friend class Instruction;
2042 ExtractValueInst *cloneImpl() const;
20002043
20012044 public:
20022045 static ExtractValueInst *Create(Value *Agg,
21102153 InsertValueInst(Value *Agg, Value *Val, unsigned Idx,
21112154 const Twine &NameStr, BasicBlock *InsertAtEnd);
21122155 protected:
2113 InsertValueInst *clone_impl() const override;
2156 // Note: Instruction needs to be a friend here to call cloneImpl.
2157 friend class Instruction;
2158 InsertValueInst *cloneImpl() const;
2159
21142160 public:
21152161 // allocate space for exactly two operands
21162162 void *operator new(size_t s) {
22512297 User::allocHungoffUses(N, /* IsPhi */ true);
22522298 }
22532299
2254 PHINode *clone_impl() const override;
2300 // Note: Instruction needs to be a friend here to call cloneImpl.
2301 friend class Instruction;
2302 PHINode *cloneImpl() const;
2303
22552304 public:
22562305 /// Constructors - NumReservedValues is a hint for the number of incoming
22572306 /// edges that this phi node will have (use 0 if you really have no idea).
24442493 const Twine &NameStr, BasicBlock *InsertAtEnd);
24452494
24462495 protected:
2447 LandingPadInst *clone_impl() const override;
2496 // Note: Instruction needs to be a friend here to call cloneImpl.
2497 friend class Instruction;
2498 LandingPadInst *cloneImpl() const;
2499
24482500 public:
24492501 /// Constructors - NumReservedClauses is a hint for the number of incoming
24502502 /// clauses that this landingpad will have (use 0 if you really have no idea).
25372589 ReturnInst(LLVMContext &C, Value *retVal, BasicBlock *InsertAtEnd);
25382590 explicit ReturnInst(LLVMContext &C, BasicBlock *InsertAtEnd);
25392591 protected:
2540 ReturnInst *clone_impl() const override;
2592 // Note: Instruction needs to be a friend here to call cloneImpl.
2593 friend class Instruction;
2594 ReturnInst *cloneImpl() const;
2595
25412596 public:
25422597 static ReturnInst* Create(LLVMContext &C, Value *retVal = nullptr,
25432598 Instruction *InsertBefore = nullptr) {
26092664 BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
26102665 BasicBlock *InsertAtEnd);
26112666 protected:
2612 BranchInst *clone_impl() const override;
2667 // Note: Instruction needs to be a friend here to call cloneImpl.
2668 friend class Instruction;
2669 BranchInst *cloneImpl() const;
2670
26132671 public:
26142672 static BranchInst *Create(BasicBlock *IfTrue,
26152673 Instruction *InsertBefore = nullptr) {
27162774 SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
27172775 BasicBlock *InsertAtEnd);
27182776 protected:
2719 SwitchInst *clone_impl() const override;
2777 // Note: Instruction needs to be a friend here to call cloneImpl.
2778 friend class Instruction;
2779 SwitchInst *cloneImpl() const;
2780
27202781 public:
27212782
27222783 // -2
30213082 /// autoinserts at the end of the specified BasicBlock.
30223083 IndirectBrInst(Value *Address, unsigned NumDests, BasicBlock *InsertAtEnd);
30233084 protected:
3024 IndirectBrInst *clone_impl() const override;
3085 // Note: Instruction needs to be a friend here to call cloneImpl.
3086 friend class Instruction;
3087 IndirectBrInst *cloneImpl() const;
3088
30253089 public:
30263090 static IndirectBrInst *Create(Value *Address, unsigned NumDests,
30273091 Instruction *InsertBefore = nullptr) {
31283192 ArrayRef Args, unsigned Values,
31293193 const Twine &NameStr, BasicBlock *InsertAtEnd);
31303194 protected:
3131 InvokeInst *clone_impl() const override;
3195 // Note: Instruction needs to be a friend here to call cloneImpl.
3196 friend class Instruction;
3197 InvokeInst *cloneImpl() const;
3198
31323199 public:
31333200 static InvokeInst *Create(Value *Func,
31343201 BasicBlock *IfNormal, BasicBlock *IfException,
34233490 explicit ResumeInst(Value *Exn, Instruction *InsertBefore=nullptr);
34243491 ResumeInst(Value *Exn, BasicBlock *InsertAtEnd);
34253492 protected:
3426 ResumeInst *clone_impl() const override;
3493 // Note: Instruction needs to be a friend here to call cloneImpl.
3494 friend class Instruction;
3495 ResumeInst *cloneImpl() const;
3496
34273497 public:
34283498 static ResumeInst *Create(Value *Exn, Instruction *InsertBefore = nullptr) {
34293499 return new(1) ResumeInst(Exn, InsertBefore);
34723542 class UnreachableInst : public TerminatorInst {
34733543 void *operator new(size_t, unsigned) = delete;
34743544 protected:
3475 UnreachableInst *clone_impl() const override;
3545 // Note: Instruction needs to be a friend here to call cloneImpl.
3546 friend class Instruction;
3547 UnreachableInst *cloneImpl() const;
34763548
34773549 public:
34783550 // allocate space for exactly zero operands
35043576 /// \brief This class represents a truncation of integer types.
35053577 class TruncInst : public CastInst {
35063578 protected:
3579 // Note: Instruction needs to be a friend here to call cloneImpl.
3580 friend class Instruction;
35073581 /// \brief Clone an identical TruncInst
3508 TruncInst *clone_impl() const override;
3582 TruncInst *cloneImpl() const;
35093583
35103584 public:
35113585 /// \brief Constructor with insert-before-instruction semantics
35403614 /// \brief This class represents zero extension of integer types.
35413615 class ZExtInst : public CastInst {
35423616 protected:
3617 // Note: Instruction needs to be a friend here to call cloneImpl.
3618 friend class Instruction;
35433619 /// \brief Clone an identical ZExtInst
3544 ZExtInst *clone_impl() const override;
3620 ZExtInst *cloneImpl() const;
35453621
35463622 public:
35473623 /// \brief Constructor with insert-before-instruction semantics
35763652 /// \brief This class represents a sign extension of integer types.
35773653 class SExtInst : public CastInst {
35783654 protected:
3655 // Note: Instruction needs to be a friend here to call cloneImpl.
3656 friend class Instruction;
35793657 /// \brief Clone an identical SExtInst
3580 SExtInst *clone_impl() const override;
3658 SExtInst *cloneImpl() const;
35813659
35823660 public:
35833661 /// \brief Constructor with insert-before-instruction semantics
36123690 /// \brief This class represents a truncation of floating point types.
36133691 class FPTruncInst : public CastInst {
36143692 protected:
3693 // Note: Instruction needs to be a friend here to call cloneImpl.
3694 friend class Instruction;
36153695 /// \brief Clone an identical FPTruncInst
3616 FPTruncInst *clone_impl() const override;
3696 FPTruncInst *cloneImpl() const;
36173697
36183698 public:
36193699 /// \brief Constructor with insert-before-instruction semantics
36483728 /// \brief This class represents an extension of floating point types.
36493729 class FPExtInst : public CastInst {
36503730 protected:
3731 // Note: Instruction needs to be a friend here to call cloneImpl.
3732 friend class Instruction;
36513733 /// \brief Clone an identical FPExtInst
3652 FPExtInst *clone_impl() const override;
3734 FPExtInst *cloneImpl() const;
36533735
36543736 public:
36553737 /// \brief Constructor with insert-before-instruction semantics
36843766 /// \brief This class represents a cast unsigned integer to floating point.
36853767 class UIToFPInst : public CastInst {
36863768 protected:
3769 // Note: Instruction needs to be a friend here to call cloneImpl.
3770 friend class Instruction;
36873771 /// \brief Clone an identical UIToFPInst
3688 UIToFPInst *clone_impl() const override;
3772 UIToFPInst *cloneImpl() const;
36893773
36903774 public:
36913775 /// \brief Constructor with insert-before-instruction semantics
37203804 /// \brief This class represents a cast from signed integer to floating point.
37213805 class SIToFPInst : public CastInst {
37223806 protected:
3807 // Note: Instruction needs to be a friend here to call cloneImpl.
3808 friend class Instruction;
37233809 /// \brief Clone an identical SIToFPInst
3724 SIToFPInst *clone_impl() const override;
3810 SIToFPInst *cloneImpl() const;
37253811
37263812 public:
37273813 /// \brief Constructor with insert-before-instruction semantics
37563842 /// \brief This class represents a cast from floating point to unsigned integer
37573843 class FPToUIInst : public CastInst {
37583844 protected:
3845 // Note: Instruction needs to be a friend here to call cloneImpl.
3846 friend class Instruction;
37593847 /// \brief Clone an identical FPToUIInst
3760 FPToUIInst *clone_impl() const override;
3848 FPToUIInst *cloneImpl() const;
37613849
37623850 public:
37633851 /// \brief Constructor with insert-before-instruction semantics
37923880 /// \brief This class represents a cast from floating point to signed integer.
37933881 class FPToSIInst : public CastInst {
37943882 protected:
3883 // Note: Instruction needs to be a friend here to call cloneImpl.
3884 friend class Instruction;
37953885 /// \brief Clone an identical FPToSIInst
3796 FPToSIInst *clone_impl() const override;
3886 FPToSIInst *cloneImpl() const;
37973887
37983888 public:
37993889 /// \brief Constructor with insert-before-instruction semantics
38443934 BasicBlock *InsertAtEnd ///< The block to insert the instruction into
38453935 );
38463936
3937 // Note: Instruction needs to be a friend here to call cloneImpl.
3938 friend class Instruction;
38473939 /// \brief Clone an identical IntToPtrInst
3848 IntToPtrInst *clone_impl() const override;
3940 IntToPtrInst *cloneImpl() const;
38493941
38503942 /// \brief Returns the address space of this instruction's pointer type.
38513943 unsigned getAddressSpace() const {
38683960 /// \brief This class represents a cast from a pointer to an integer
38693961 class PtrToIntInst : public CastInst {
38703962 protected:
3963 // Note: Instruction needs to be a friend here to call cloneImpl.
3964 friend class Instruction;
38713965 /// \brief Clone an identical PtrToIntInst
3872 PtrToIntInst *clone_impl() const override;
3966 PtrToIntInst *cloneImpl() const;
38733967
38743968 public:
38753969 /// \brief Constructor with insert-before-instruction semantics
39164010 /// \brief This class represents a no-op cast from one type to another.
39174011 class BitCastInst : public CastInst {
39184012 protected:
4013 // Note: Instruction needs to be a friend here to call cloneImpl.
4014 friend class Instruction;
39194015 /// \brief Clone an identical BitCastInst
3920 BitCastInst *clone_impl() const override;
4016 BitCastInst *cloneImpl() const;
39214017
39224018 public:
39234019 /// \brief Constructor with insert-before-instruction semantics
39534049 /// one address space to another.
39544050 class AddrSpaceCastInst : public CastInst {
39554051 protected:
4052 // Note: Instruction needs to be a friend here to call cloneImpl.
4053 friend class Instruction;
39564054 /// \brief Clone an identical AddrSpaceCastInst
3957 AddrSpaceCastInst *clone_impl() const override;
4055 AddrSpaceCastInst *cloneImpl() const;
39584056
39594057 public:
39604058 /// \brief Constructor with insert-before-instruction semantics
533533 return Opcode == Xor;
534534 }
535535
536 Instruction *Instruction::cloneImpl() const {
537 llvm_unreachable("Subclass of Instruction failed to implement cloneImpl");
538 }
539
536540 Instruction *Instruction::clone() const {
537 Instruction *New = clone_impl();
541 Instruction *New = nullptr;
542 switch (getOpcode()) {
543 default:
544 llvm_unreachable("Unhandled Opcode.");
545 #define HANDLE_INST(num, opc, clas) \
546 case Instruction::opc: \
547 New = cast(this)->cloneImpl(); \
548 break;
549 #include "llvm/IR/Instruction.def"
550 #undef HANDLE_INST
551 }
552
538553 New->SubclassOptionalData = SubclassOptionalData;
539554 if (!hasMetadata())
540555 return New;
34473447 }
34483448
34493449 //===----------------------------------------------------------------------===//
3450 // clone_impl() implementations
3450 // cloneImpl() implementations
34513451 //===----------------------------------------------------------------------===//
34523452
34533453 // Define these methods here so vtables don't get emitted into every translation
34543454 // unit that uses these classes.
34553455
3456 GetElementPtrInst *GetElementPtrInst::clone_impl() const {
3456 GetElementPtrInst *GetElementPtrInst::cloneImpl() const {
34573457 return new (getNumOperands()) GetElementPtrInst(*this);
34583458 }
34593459
3460 BinaryOperator *BinaryOperator::clone_impl() const {
3460 BinaryOperator *BinaryOperator::cloneImpl() const {
34613461 return Create(getOpcode(), Op<0>(), Op<1>());
34623462 }
34633463
3464 FCmpInst* FCmpInst::clone_impl() const {
3464 FCmpInst *FCmpInst::cloneImpl() const {
34653465 return new FCmpInst(getPredicate(), Op<0>(), Op<1>());
34663466 }
34673467
3468 ICmpInst* ICmpInst::clone_impl() const {
3468 ICmpInst *ICmpInst::cloneImpl() const {
34693469 return new ICmpInst(getPredicate(), Op<0>(), Op<1>());
34703470 }
34713471
3472 ExtractValueInst *ExtractValueInst::clone_impl() const {
3472 ExtractValueInst *ExtractValueInst::cloneImpl() const {
34733473 return new ExtractValueInst(*this);
34743474 }
34753475
3476 InsertValueInst *InsertValueInst::clone_impl() const {
3476 InsertValueInst *InsertValueInst::cloneImpl() const {
34773477 return new InsertValueInst(*this);
34783478 }
34793479
3480 AllocaInst *AllocaInst::clone_impl() const {
3480 AllocaInst *AllocaInst::cloneImpl() const {
34813481 AllocaInst *Result = new AllocaInst(getAllocatedType(),
34823482 (Value *)getOperand(0), getAlignment());
34833483 Result->setUsedWithInAlloca(isUsedWithInAlloca());
34843484 return Result;
34853485 }
34863486
3487 LoadInst *LoadInst::clone_impl() const {
3487 LoadInst *LoadInst::cloneImpl() const {
34883488 return new LoadInst(getOperand(0), Twine(), isVolatile(),
34893489 getAlignment(), getOrdering(), getSynchScope());
34903490 }
34913491
3492 StoreInst *StoreInst::clone_impl() const {
3492 StoreInst *StoreInst::cloneImpl() const {
34933493 return new StoreInst(getOperand(0), getOperand(1), isVolatile(),
34943494 getAlignment(), getOrdering(), getSynchScope());
34953495
34963496 }
34973497
3498 AtomicCmpXchgInst *AtomicCmpXchgInst::clone_impl() const {
3498 AtomicCmpXchgInst *AtomicCmpXchgInst::cloneImpl() const {
34993499 AtomicCmpXchgInst *Result =
35003500 new AtomicCmpXchgInst(getOperand(0), getOperand(1), getOperand(2),
35013501 getSuccessOrdering(), getFailureOrdering(),
35053505 return Result;
35063506 }
35073507
3508 AtomicRMWInst *AtomicRMWInst::clone_impl() const {
3508 AtomicRMWInst *AtomicRMWInst::cloneImpl() const {
35093509 AtomicRMWInst *Result =
35103510 new AtomicRMWInst(getOperation(),getOperand(0), getOperand(1),
35113511 getOrdering(), getSynchScope());
35133513 return Result;
35143514 }
35153515
3516 FenceInst *FenceInst::clone_impl() const {
3516 FenceInst *FenceInst::cloneImpl() const {
35173517 return new FenceInst(getContext(), getOrdering(), getSynchScope());
35183518 }
35193519
3520 TruncInst *TruncInst::clone_impl() const {
3520 TruncInst *TruncInst::cloneImpl() const {
35213521 return new TruncInst(getOperand(0), getType());
35223522 }
35233523
3524 ZExtInst *ZExtInst::clone_impl() const {
3524 ZExtInst *ZExtInst::cloneImpl() const {
35253525 return new ZExtInst(getOperand(0), getType());
35263526 }
35273527
3528 SExtInst *SExtInst::clone_impl() const {
3528 SExtInst *SExtInst::cloneImpl() const {
35293529 return new SExtInst(getOperand(0), getType());
35303530 }
35313531
3532 FPTruncInst *FPTruncInst::clone_impl() const {
3532 FPTruncInst *FPTruncInst::cloneImpl() const {
35333533 return new FPTruncInst(getOperand(0), getType());
35343534 }
35353535
3536 FPExtInst *FPExtInst::clone_impl() const {
3536 FPExtInst *FPExtInst::cloneImpl() const {
35373537 return new FPExtInst(getOperand(0), getType());
35383538 }
35393539
3540 UIToFPInst *UIToFPInst::clone_impl() const {
3540 UIToFPInst *UIToFPInst::cloneImpl() const {
35413541 return new UIToFPInst(getOperand(0), getType());
35423542 }
35433543
3544 SIToFPInst *SIToFPInst::clone_impl() const {
3544 SIToFPInst *SIToFPInst::cloneImpl() const {
35453545 return new SIToFPInst(getOperand(0), getType());
35463546 }
35473547
3548 FPToUIInst *FPToUIInst::clone_impl() const {
3548 FPToUIInst *FPToUIInst::cloneImpl() const {
35493549 return new FPToUIInst(getOperand(0), getType());
35503550 }
35513551
3552 FPToSIInst *FPToSIInst::clone_impl() const {
3552 FPToSIInst *FPToSIInst::cloneImpl() const {
35533553 return new FPToSIInst(getOperand(0), getType());
35543554 }
35553555
3556 PtrToIntInst *PtrToIntInst::clone_impl() const {
3556 PtrToIntInst *PtrToIntInst::cloneImpl() const {
35573557 return new PtrToIntInst(getOperand(0), getType());
35583558 }
35593559
3560 IntToPtrInst *IntToPtrInst::clone_impl() const {
3560 IntToPtrInst *IntToPtrInst::cloneImpl() const {
35613561 return new IntToPtrInst(getOperand(0), getType());
35623562 }
35633563
3564 BitCastInst *BitCastInst::clone_impl() const {
3564 BitCastInst *BitCastInst::cloneImpl() const {
35653565 return new BitCastInst(getOperand(0), getType());
35663566 }
35673567
3568 AddrSpaceCastInst *AddrSpaceCastInst::clone_impl() const {
3568 AddrSpaceCastInst *AddrSpaceCastInst::cloneImpl() const {
35693569 return new AddrSpaceCastInst(getOperand(0), getType());
35703570 }
35713571
3572 CallInst *CallInst::clone_impl() const {
3572 CallInst *CallInst::cloneImpl() const {
35733573 return new(getNumOperands()) CallInst(*this);
35743574 }
35753575
3576 SelectInst *SelectInst::clone_impl() const {
3576 SelectInst *SelectInst::cloneImpl() const {
35773577 return SelectInst::Create(getOperand(0), getOperand(1), getOperand(2));
35783578 }
35793579
3580 VAArgInst *VAArgInst::clone_impl() const {
3580 VAArgInst *VAArgInst::cloneImpl() const {
35813581 return new VAArgInst(getOperand(0), getType());
35823582 }
35833583
3584 ExtractElementInst *ExtractElementInst::clone_impl() const {
3584 ExtractElementInst *ExtractElementInst::cloneImpl() const {
35853585 return ExtractElementInst::Create(getOperand(0), getOperand(1));
35863586 }
35873587
3588 InsertElementInst *InsertElementInst::clone_impl() const {
3588 InsertElementInst *InsertElementInst::cloneImpl() const {
35893589 return InsertElementInst::Create(getOperand(0), getOperand(1), getOperand(2));
35903590 }
35913591
3592 ShuffleVectorInst *ShuffleVectorInst::clone_impl() const {
3592 ShuffleVectorInst *ShuffleVectorInst::cloneImpl() const {
35933593 return new ShuffleVectorInst(getOperand(0), getOperand(1), getOperand(2));
35943594 }
35953595
3596 PHINode *PHINode::clone_impl() const {
3597 return new PHINode(*this);
3598 }
3599
3600 LandingPadInst *LandingPadInst::clone_impl() const {
3596 PHINode *PHINode::cloneImpl() const { return new PHINode(*this); }
3597
3598 LandingPadInst *LandingPadInst::cloneImpl() const {
36013599 return new LandingPadInst(*this);
36023600 }
36033601
3604 ReturnInst *ReturnInst::clone_impl() const {
3602 ReturnInst *ReturnInst::cloneImpl() const {
36053603 return new(getNumOperands()) ReturnInst(*this);
36063604 }
36073605
3608 BranchInst *BranchInst::clone_impl() const {
3606 BranchInst *BranchInst::cloneImpl() const {
36093607 return new(getNumOperands()) BranchInst(*this);
36103608 }
36113609
3612 SwitchInst *SwitchInst::clone_impl() const {
3613 return new SwitchInst(*this);
3614 }
3615
3616 IndirectBrInst *IndirectBrInst::clone_impl() const {
3610 SwitchInst *SwitchInst::cloneImpl() const { return new SwitchInst(*this); }
3611
3612 IndirectBrInst *IndirectBrInst::cloneImpl() const {
36173613 return new IndirectBrInst(*this);
36183614 }
36193615
3620
3621 InvokeInst *InvokeInst::clone_impl() const {
3616 InvokeInst *InvokeInst::cloneImpl() const {
36223617 return new(getNumOperands()) InvokeInst(*this);
36233618 }
36243619
3625 ResumeInst *ResumeInst::clone_impl() const {
3626 return new(1) ResumeInst(*this);
3627 }
3628
3629 UnreachableInst *UnreachableInst::clone_impl() const {
3620 ResumeInst *ResumeInst::cloneImpl() const { return new (1) ResumeInst(*this); }
3621
3622 UnreachableInst *UnreachableInst::cloneImpl() const {
36303623 LLVMContext &Context = getContext();
36313624 return new UnreachableInst(Context);
36323625 }