summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/BasicBlock.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2008-04-06 20:25:17 +0000
committerGabor Greif <ggreif@gmail.com>2008-04-06 20:25:17 +0000
commite9ecc68d8f7cce18cfce7e9806f924fc65aa4281 (patch)
tree8207de151e5a737ad20754cfb761a885901bb9d3 /llvm/lib/VMCore/BasicBlock.cpp
parent5ed17b67d2814be6d7b008b76c91f15a75e5a141 (diff)
downloadbcm5719-llvm-e9ecc68d8f7cce18cfce7e9806f924fc65aa4281.tar.gz
bcm5719-llvm-e9ecc68d8f7cce18cfce7e9806f924fc65aa4281.zip
API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
Diffstat (limited to 'llvm/lib/VMCore/BasicBlock.cpp')
-rw-r--r--llvm/lib/VMCore/BasicBlock.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp
index 1288fdf32c4..16aa7faa085 100644
--- a/llvm/lib/VMCore/BasicBlock.cpp
+++ b/llvm/lib/VMCore/BasicBlock.cpp
@@ -35,6 +35,10 @@ namespace {
/// DummyInst - An instance of this class is used to mark the end of the
/// instruction list. This is not a real instruction.
struct VISIBILITY_HIDDEN DummyInst : public Instruction {
+ // allocate space for exactly zero operands
+ void *operator new(size_t s) {
+ return User::operator new(s, 0);
+ }
DummyInst() : Instruction(Type::VoidTy, OtherOpsEnd, 0, 0) {
// This should not be garbage monitored.
LeakDetector::removeGarbageObject(this);
@@ -71,7 +75,7 @@ template class SymbolTableListTraits<Instruction, BasicBlock>;
BasicBlock::BasicBlock(const std::string &Name, Function *NewParent,
BasicBlock *InsertBefore, BasicBlock *Dest)
- : User(Type::LabelTy, Value::BasicBlockVal, &unwindDest, 0), Parent(0) {
+ : User(Type::LabelTy, Value::BasicBlockVal, &unwindDest, 0/*FIXME*/), Parent(0) {
// Make sure that we get added to a function
LeakDetector::addGarbageObject(this);
@@ -283,14 +287,14 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const std::string &BBName) {
assert(I != InstList.end() &&
"Trying to get me to create degenerate basic block!");
- BasicBlock *New = new BasicBlock(BBName, getParent(), getNext());
+ BasicBlock *New = new(0/*FIXME*/) BasicBlock(BBName, getParent(), getNext());
// Move all of the specified instructions from the original basic block into
// the new basic block.
New->getInstList().splice(New->end(), this->getInstList(), I, end());
// Add a branch instruction to the newly formed basic block.
- new BranchInst(New, this);
+ BranchInst::Create(New, this);
// Now we must loop through all of the successors of the New block (which
// _were_ the successors of the 'this' block), and update any PHI nodes in
OpenPOWER on IntegriCloud