mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1811,39 +1811,35 @@ class PHINode : public Instruction {
|
||||
void *operator new(size_t s) {
|
||||
return User::operator new(s, 0);
|
||||
}
|
||||
explicit PHINode(const Type *Ty, const Twine &NameStr = "",
|
||||
Instruction *InsertBefore = 0)
|
||||
explicit PHINode(const Type *Ty, unsigned NumReservedValues,
|
||||
const Twine &NameStr = "", Instruction *InsertBefore = 0)
|
||||
: Instruction(Ty, Instruction::PHI, 0, 0, InsertBefore),
|
||||
ReservedSpace(0) {
|
||||
ReservedSpace(NumReservedValues * 2) {
|
||||
setName(NameStr);
|
||||
OperandList = allocHungoffUses(ReservedSpace);
|
||||
}
|
||||
|
||||
PHINode(const Type *Ty, const Twine &NameStr, BasicBlock *InsertAtEnd)
|
||||
PHINode(const Type *Ty, unsigned NumReservedValues, const Twine &NameStr,
|
||||
BasicBlock *InsertAtEnd)
|
||||
: Instruction(Ty, Instruction::PHI, 0, 0, InsertAtEnd),
|
||||
ReservedSpace(0) {
|
||||
ReservedSpace(NumReservedValues * 2) {
|
||||
setName(NameStr);
|
||||
OperandList = allocHungoffUses(ReservedSpace);
|
||||
}
|
||||
protected:
|
||||
virtual PHINode *clone_impl() const;
|
||||
public:
|
||||
static PHINode *Create(const Type *Ty, const Twine &NameStr = "",
|
||||
static PHINode *Create(const Type *Ty, unsigned NumReservedValues,
|
||||
const Twine &NameStr = "",
|
||||
Instruction *InsertBefore = 0) {
|
||||
return new PHINode(Ty, NameStr, InsertBefore);
|
||||
return new PHINode(Ty, NumReservedValues, NameStr, InsertBefore);
|
||||
}
|
||||
static PHINode *Create(const Type *Ty, const Twine &NameStr,
|
||||
BasicBlock *InsertAtEnd) {
|
||||
return new PHINode(Ty, NameStr, InsertAtEnd);
|
||||
static PHINode *Create(const Type *Ty, unsigned NumReservedValues,
|
||||
const Twine &NameStr, BasicBlock *InsertAtEnd) {
|
||||
return new PHINode(Ty, NumReservedValues, NameStr, InsertAtEnd);
|
||||
}
|
||||
~PHINode();
|
||||
|
||||
/// reserveOperandSpace - This method can be used to avoid repeated
|
||||
/// reallocation of PHI operand lists by reserving space for the correct
|
||||
/// number of operands before adding them. Unlike normal vector reserves,
|
||||
/// this method can also be used to trim the operand space.
|
||||
void reserveOperandSpace(unsigned NumValues) {
|
||||
resizeOperands(NumValues*2);
|
||||
}
|
||||
|
||||
/// Provide fast operand accessors
|
||||
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
|
||||
|
||||
|
||||
@@ -1070,8 +1070,9 @@ public:
|
||||
// Instruction creation methods: Other Instructions
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
||||
PHINode *CreatePHI(const Type *Ty, const Twine &Name = "") {
|
||||
return Insert(PHINode::Create(Ty), Name);
|
||||
PHINode *CreatePHI(const Type *Ty, unsigned NumReservedValues,
|
||||
const Twine &Name = "") {
|
||||
return Insert(PHINode::Create(Ty, NumReservedValues), Name);
|
||||
}
|
||||
|
||||
CallInst *CreateCall(Value *Callee, const Twine &Name = "") {
|
||||
|
||||
Reference in New Issue
Block a user