forked from OSchip/llvm-project
Remove dead F parameter from Argument constructor
When Function creates its argument list, it does the ilist push_back itself. No other caller passes in a parent function, so this is dead, and it uses the soon-to-be-deleted getArgumentList accessor. llvm-svn: 298009
This commit is contained in:
parent
720883520d
commit
c9a392b9dd
|
@ -38,10 +38,8 @@ class Argument : public Value, public ilist_node<Argument> {
|
||||||
void setParent(Function *parent);
|
void setParent(Function *parent);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// If \p F is specified, the argument is inserted at the end of the argument
|
/// Argument constructor.
|
||||||
/// list for \p F.
|
explicit Argument(Type *Ty, const Twine &Name = "", unsigned ArgNo = 0);
|
||||||
explicit Argument(Type *Ty, const Twine &Name = "", Function *F = nullptr,
|
|
||||||
unsigned ArgNo = 0);
|
|
||||||
|
|
||||||
inline const Function *getParent() const { return Parent; }
|
inline const Function *getParent() const { return Parent; }
|
||||||
inline Function *getParent() { return Parent; }
|
inline Function *getParent() { return Parent; }
|
||||||
|
|
|
@ -39,12 +39,8 @@ template class llvm::SymbolTableListTraits<BasicBlock>;
|
||||||
|
|
||||||
void Argument::anchor() { }
|
void Argument::anchor() { }
|
||||||
|
|
||||||
Argument::Argument(Type *Ty, const Twine &Name, Function *Par, unsigned ArgNo)
|
Argument::Argument(Type *Ty, const Twine &Name, unsigned ArgNo)
|
||||||
: Value(Ty, Value::ArgumentVal), ArgNo(ArgNo) {
|
: Value(Ty, Value::ArgumentVal), Parent(nullptr), ArgNo(ArgNo) {
|
||||||
Parent = nullptr;
|
|
||||||
|
|
||||||
if (Par)
|
|
||||||
Par->getArgumentList().push_back(this);
|
|
||||||
setName(Name);
|
setName(Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +229,7 @@ void Function::BuildLazyArguments() const {
|
||||||
assert(!FT->getParamType(i)->isVoidTy() &&
|
assert(!FT->getParamType(i)->isVoidTy() &&
|
||||||
"Cannot have void typed arguments!");
|
"Cannot have void typed arguments!");
|
||||||
ArgumentList.push_back(
|
ArgumentList.push_back(
|
||||||
new Argument(FT->getParamType(i), "", nullptr, i));
|
new Argument(FT->getParamType(i), "", i));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear the lazy arguments bit.
|
// Clear the lazy arguments bit.
|
||||||
|
|
Loading…
Reference in New Issue