#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
-#include "llvm/IR/LeakDetector.h"
#include "llvm/IR/Type.h"
#include <algorithm>
using namespace llvm;
BasicBlock *InsertBefore)
: Value(Type::getLabelTy(C), Value::BasicBlockVal), Parent(nullptr) {
- // Make sure that we get added to a function
- LeakDetector::addGarbageObject(this);
-
if (NewParent)
insertInto(NewParent, InsertBefore);
else
}
void BasicBlock::setParent(Function *parent) {
- if (getParent())
- LeakDetector::addGarbageObject(this);
-
// Set Parent=parent, updating instruction symtab entries as appropriate.
InstList.setSymTabObject(&Parent, parent);
-
- if (getParent())
- LeakDetector::removeGarbageObject(this);
}
void BasicBlock::removeFromParent() {