mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-04 01:42:09 +00:00
Implement remove/eraseFromParent methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b92f50fe60
commit
4b83380f33
@ -105,6 +105,15 @@ void BasicBlock::setName(const std::string &name, SymbolTable *ST) {
|
|||||||
if (P && hasName()) P->getSymbolTable().insert(this);
|
if (P && hasName()) P->getSymbolTable().insert(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BasicBlock::removeFromParent() {
|
||||||
|
getParent()->getBasicBlockList().remove(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BasicBlock::eraseFromParent() {
|
||||||
|
getParent()->getBasicBlockList().erase(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
TerminatorInst *BasicBlock::getTerminator() {
|
TerminatorInst *BasicBlock::getTerminator() {
|
||||||
if (InstList.empty()) return 0;
|
if (InstList.empty()) return 0;
|
||||||
return dyn_cast<TerminatorInst>(&InstList.back());
|
return dyn_cast<TerminatorInst>(&InstList.back());
|
||||||
|
@ -147,6 +147,14 @@ const Type *Function::getReturnType() const {
|
|||||||
return getFunctionType()->getReturnType();
|
return getFunctionType()->getReturnType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Function::removeFromParent() {
|
||||||
|
getParent()->getFunctionList().remove(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Function::eraseFromParent() {
|
||||||
|
getParent()->getFunctionList().erase(this);
|
||||||
|
}
|
||||||
|
|
||||||
// dropAllReferences() - This function causes all the subinstructions to "let
|
// dropAllReferences() - This function causes all the subinstructions to "let
|
||||||
// go" of all references that they are maintaining. This allows one to
|
// go" of all references that they are maintaining. This allows one to
|
||||||
// 'delete' a whole class at a time, even though there may be circular
|
// 'delete' a whole class at a time, even though there may be circular
|
||||||
|
@ -106,9 +106,16 @@ void GlobalVariable::setName(const std::string &name, SymbolTable *ST) {
|
|||||||
if (P && hasName()) P->getSymbolTable().insert(this);
|
if (P && hasName()) P->getSymbolTable().insert(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GlobalVariable::removeFromParent() {
|
||||||
|
getParent()->getGlobalList().remove(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GlobalVariable::eraseFromParent() {
|
||||||
|
getParent()->getGlobalList().erase(this);
|
||||||
|
}
|
||||||
|
|
||||||
void GlobalVariable::replaceUsesOfWithOnConstant(Value *From, Value *To,
|
void GlobalVariable::replaceUsesOfWithOnConstant(Value *From, Value *To,
|
||||||
bool DisableChecking )
|
bool DisableChecking) {
|
||||||
{
|
|
||||||
// If you call this, then you better know this GVar has a constant
|
// If you call this, then you better know this GVar has a constant
|
||||||
// initializer worth replacing. Enforce that here.
|
// initializer worth replacing. Enforce that here.
|
||||||
assert(getNumOperands() == 1 &&
|
assert(getNumOperands() == 1 &&
|
||||||
|
@ -72,6 +72,13 @@ void Instruction::setName(const std::string &name, SymbolTable *ST) {
|
|||||||
if (PP && hasName()) PP->getSymbolTable().insert(this);
|
if (PP && hasName()) PP->getSymbolTable().insert(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Instruction::removeFromParent() {
|
||||||
|
getParent()->getInstList().remove(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Instruction::eraseFromParent() {
|
||||||
|
getParent()->getInstList().erase(this);
|
||||||
|
}
|
||||||
|
|
||||||
const char *Instruction::getOpcodeName(unsigned OpCode) {
|
const char *Instruction::getOpcodeName(unsigned OpCode) {
|
||||||
switch (OpCode) {
|
switch (OpCode) {
|
||||||
|
Loading…
Reference in New Issue
Block a user