diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h --- a/llvm/include/llvm/Analysis/MemorySSA.h +++ b/llvm/include/llvm/Analysis/MemorySSA.h @@ -329,7 +329,8 @@ /*NumOperands=*/1) {} // allocate space for exactly one operand - void *operator new(size_t s) { return User::operator new(s, 1); } + void *operator new(size_t S) { return User::operator new(S, 1); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 1); } static bool classof(const Value *MA) { return MA->getValueID() == MemoryUseVal; @@ -389,7 +390,8 @@ ID(Ver) {} // allocate space for exactly two operands - void *operator new(size_t s) { return User::operator new(s, 2); } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 2); } static bool classof(const Value *MA) { return MA->getValueID() == MemoryDefVal; @@ -484,9 +486,11 @@ /// issue. class MemoryPhi final : public MemoryAccess { // allocate space for exactly zero operands - void *operator new(size_t s) { return User::operator new(s); } + void *operator new(size_t S) { return User::operator new(S); } public: + void operator delete(void *Ptr) { User::operator delete(Ptr); } + /// Provide fast operand accessors DECLARE_TRANSPARENT_OPERAND_ACCESSORS(MemoryAccess); diff --git a/llvm/include/llvm/IR/Constants.h b/llvm/include/llvm/IR/Constants.h --- a/llvm/include/llvm/IR/Constants.h +++ b/llvm/include/llvm/IR/Constants.h @@ -58,9 +58,11 @@ protected: explicit ConstantData(Type *Ty, ValueTy VT) : Constant(Ty, VT, nullptr, 0) {} - void *operator new(size_t s) { return User::operator new(s, 0); } + void *operator new(size_t S) { return User::operator new(S, 0); } public: + void operator delete(void *Ptr) { User::operator delete(Ptr, 0); } + ConstantData(const ConstantData &) = delete; /// Methods to support type inquiry through isa, cast, and dyn_cast. @@ -849,12 +851,14 @@ BlockAddress(Function *F, BasicBlock *BB); - void *operator new(size_t s) { return User::operator new(s, 2); } + void *operator new(size_t S) { return User::operator new(S, 2); } void destroyConstantImpl(); Value *handleOperandChangeImpl(Value *From, Value *To); public: + void operator delete(void *Ptr) { User::operator delete(Ptr, 2); } + /// Return a BlockAddress for the specified function and basic block. static BlockAddress *get(Function *F, BasicBlock *BB); @@ -893,12 +897,14 @@ DSOLocalEquivalent(GlobalValue *GV); - void *operator new(size_t s) { return User::operator new(s, 1); } + void *operator new(size_t S) { return User::operator new(S, 1); } void destroyConstantImpl(); Value *handleOperandChangeImpl(Value *From, Value *To); public: + void operator delete(void *Ptr) { User::operator delete(Ptr, 1); } + /// Return a DSOLocalEquivalent for the specified global value. static DSOLocalEquivalent *get(GlobalValue *GV); diff --git a/llvm/include/llvm/IR/GlobalIndirectSymbol.h b/llvm/include/llvm/IR/GlobalIndirectSymbol.h --- a/llvm/include/llvm/IR/GlobalIndirectSymbol.h +++ b/llvm/include/llvm/IR/GlobalIndirectSymbol.h @@ -35,9 +35,8 @@ GlobalIndirectSymbol &operator=(const GlobalIndirectSymbol &) = delete; // allocate space for exactly one operand - void *operator new(size_t s) { - return User::operator new(s, 1); - } + void *operator new(size_t S) { return User::operator new(S, 1); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 1); } /// Provide fast operand accessors DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant); diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h --- a/llvm/include/llvm/IR/InstrTypes.h +++ b/llvm/include/llvm/IR/InstrTypes.h @@ -68,9 +68,8 @@ public: // allocate space for exactly one operand - void *operator new(size_t s) { - return User::operator new(s, 1); - } + void *operator new(size_t S) { return User::operator new(S, 1); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 1); } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); @@ -203,9 +202,8 @@ public: // allocate space for exactly two operands - void *operator new(size_t s) { - return User::operator new(s, 2); - } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 2); } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); @@ -769,9 +767,8 @@ public: // allocate space for exactly two operands - void *operator new(size_t s) { - return User::operator new(s, 2); - } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 2); } /// Construct a compare instruction, given the opcode, the predicate and /// the two operands. Optionally (if InstBefore is specified) insert the diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h --- a/llvm/include/llvm/IR/Instructions.h +++ b/llvm/include/llvm/IR/Instructions.h @@ -333,9 +333,8 @@ AtomicOrdering Order, SyncScope::ID SSID, BasicBlock *InsertAtEnd); // allocate space for exactly two operands - void *operator new(size_t s) { - return User::operator new(s, 2); - } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 2); } /// Return true if this is a store to a volatile memory location. bool isVolatile() const { return getSubclassData(); } @@ -463,9 +462,8 @@ BasicBlock *InsertAtEnd); // allocate space for exactly zero operands - void *operator new(size_t s) { - return User::operator new(s, 0); - } + void *operator new(size_t S) { return User::operator new(S, 0); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 0); } /// Returns the ordering constraint of this fence instruction. AtomicOrdering getOrdering() const { @@ -547,9 +545,8 @@ BasicBlock *InsertAtEnd); // allocate space for exactly three operands - void *operator new(size_t s) { - return User::operator new(s, 3); - } + void *operator new(size_t S) { return User::operator new(S, 3); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 3); } using VolatileField = BoolBitfieldElementT<0>; using WeakField = BoolBitfieldElementT; @@ -792,9 +789,8 @@ BasicBlock *InsertAtEnd); // allocate space for exactly two operands - void *operator new(size_t s) { - return User::operator new(s, 2); - } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 2); } using VolatileField = BoolBitfieldElementT<0>; using AtomicOrderingField = @@ -2040,7 +2036,8 @@ ShuffleVectorInst(Value *V1, Value *V2, ArrayRef Mask, const Twine &NameStr, BasicBlock *InsertAtEnd); - void *operator new(size_t s) { return User::operator new(s, 2); } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { return User::operator delete(Ptr, 2); } /// Swap the operands and adjust the mask to preserve the semantics /// of the instruction. @@ -2497,9 +2494,8 @@ public: // allocate space for exactly two operands - void *operator new(size_t s) { - return User::operator new(s, 2); - } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 2); } static InsertValueInst *Create(Value *Agg, Value *Val, ArrayRef Idxs, @@ -2875,9 +2871,7 @@ const Twine &NameStr, BasicBlock *InsertAtEnd); // Allocate space for exactly zero operands. - void *operator new(size_t s) { - return User::operator new(s); - } + void *operator new(size_t S) { return User::operator new(S); } void growOperands(unsigned Size); void init(unsigned NumReservedValues, const Twine &NameStr); @@ -2889,6 +2883,8 @@ LandingPadInst *cloneImpl() const; public: + void operator delete(void *Ptr) { User::operator delete(Ptr); } + /// Constructors - NumReservedClauses is a hint for the number of incoming /// clauses that this landingpad will have (use 0 if you really have no idea). static LandingPadInst *Create(Type *RetTy, unsigned NumReservedClauses, @@ -3207,9 +3203,7 @@ BasicBlock *InsertAtEnd); // allocate space for exactly zero operands - void *operator new(size_t s) { - return User::operator new(s); - } + void *operator new(size_t S) { return User::operator new(S); } void init(Value *Value, BasicBlock *Default, unsigned NumReserved); void growOperands(); @@ -3221,6 +3215,8 @@ SwitchInst *cloneImpl() const; public: + void operator delete(void *Ptr) { User::operator delete(Ptr); } + // -2 static const unsigned DefaultPseudoIndex = static_cast(~0L-1); @@ -3605,9 +3601,7 @@ IndirectBrInst(Value *Address, unsigned NumDests, BasicBlock *InsertAtEnd); // allocate space for exactly zero operands - void *operator new(size_t s) { - return User::operator new(s); - } + void *operator new(size_t S) { return User::operator new(S); } void init(Value *Address, unsigned NumDests); void growOperands(); @@ -3619,6 +3613,8 @@ IndirectBrInst *cloneImpl() const; public: + void operator delete(void *Ptr) { User::operator delete(Ptr); } + /// Iterator type that casts an operand to a basic block. /// /// This only makes sense because the successors are stored as adjacent @@ -4256,7 +4252,7 @@ BasicBlock *InsertAtEnd); // allocate space for exactly zero operands - void *operator new(size_t s) { return User::operator new(s); } + void *operator new(size_t S) { return User::operator new(S); } void init(Value *ParentPad, BasicBlock *UnwindDest, unsigned NumReserved); void growOperands(unsigned Size); @@ -4268,6 +4264,8 @@ CatchSwitchInst *cloneImpl() const; public: + void operator delete(void *Ptr) { return User::operator delete(Ptr); } + static CatchSwitchInst *Create(Value *ParentPad, BasicBlock *UnwindDest, unsigned NumHandlers, const Twine &NameStr = "", @@ -4696,9 +4694,8 @@ explicit UnreachableInst(LLVMContext &C, BasicBlock *InsertAtEnd); // allocate space for exactly zero operands - void *operator new(size_t s) { - return User::operator new(s, 0); - } + void *operator new(size_t S) { return User::operator new(S, 0); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 0); } unsigned getNumSuccessors() const { return 0; } diff --git a/llvm/lib/IR/ConstantsContext.h b/llvm/lib/IR/ConstantsContext.h --- a/llvm/lib/IR/ConstantsContext.h +++ b/llvm/lib/IR/ConstantsContext.h @@ -51,9 +51,8 @@ } // allocate space for exactly one operand - void *operator new(size_t s) { - return User::operator new(s, 1); - } + void *operator new(size_t S) { return User::operator new(S, 1); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 1); } DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); @@ -79,9 +78,8 @@ } // allocate space for exactly two operands - void *operator new(size_t s) { - return User::operator new(s, 2); - } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 2); } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); @@ -106,9 +104,8 @@ } // allocate space for exactly three operands - void *operator new(size_t s) { - return User::operator new(s, 3); - } + void *operator new(size_t S) { return User::operator new(S, 3); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 3); } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); @@ -134,9 +131,8 @@ } // allocate space for exactly two operands - void *operator new(size_t s) { - return User::operator new(s, 2); - } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 2); } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); @@ -163,9 +159,8 @@ } // allocate space for exactly three operands - void *operator new(size_t s) { - return User::operator new(s, 3); - } + void *operator new(size_t S) { return User::operator new(S, 3); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 3); } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); @@ -200,7 +195,8 @@ SmallVector ShuffleMask; Constant *ShuffleMaskForBitcode; - void *operator new(size_t s) { return User::operator new(s, 2); } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { return User::operator delete(Ptr, 2); } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); @@ -226,9 +222,8 @@ } // allocate space for exactly one operand - void *operator new(size_t s) { - return User::operator new(s, 1); - } + void *operator new(size_t S) { return User::operator new(S, 1); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 1); } /// Indices - These identify which value to extract. const SmallVector Indices; @@ -258,9 +253,8 @@ } // allocate space for exactly one operand - void *operator new(size_t s) { - return User::operator new(s, 2); - } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { User::operator delete(Ptr, 2); } /// Indices - These identify the position for the insertion. const SmallVector Indices; @@ -323,9 +317,8 @@ } // allocate space for exactly two operands - void *operator new(size_t s) { - return User::operator new(s, 2); - } + void *operator new(size_t S) { return User::operator new(S, 2); } + void operator delete(void *Ptr) { return User::operator delete(Ptr, 2); } /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);