From: Reid Kleckner Date: Thu, 16 Mar 2017 22:58:56 +0000 (+0000) Subject: Remove dead F parameter from Argument constructor X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d207f385a77f9fa8e08908278458b9537fbe6dc;p=llvm 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298009 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/IR/Argument.h b/include/llvm/IR/Argument.h index 9236cdc879d..84d5d7b1a6f 100644 --- a/include/llvm/IR/Argument.h +++ b/include/llvm/IR/Argument.h @@ -38,10 +38,8 @@ class Argument : public Value, public ilist_node { void setParent(Function *parent); public: - /// If \p F is specified, the argument is inserted at the end of the argument - /// list for \p F. - explicit Argument(Type *Ty, const Twine &Name = "", Function *F = nullptr, - unsigned ArgNo = 0); + /// Argument constructor. + explicit Argument(Type *Ty, const Twine &Name = "", unsigned ArgNo = 0); inline const Function *getParent() const { return Parent; } inline Function *getParent() { return Parent; } diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp index 228152e99fb..6e1b4765270 100644 --- a/lib/IR/Function.cpp +++ b/lib/IR/Function.cpp @@ -39,12 +39,8 @@ template class llvm::SymbolTableListTraits; void Argument::anchor() { } -Argument::Argument(Type *Ty, const Twine &Name, Function *Par, unsigned ArgNo) - : Value(Ty, Value::ArgumentVal), ArgNo(ArgNo) { - Parent = nullptr; - - if (Par) - Par->getArgumentList().push_back(this); +Argument::Argument(Type *Ty, const Twine &Name, unsigned ArgNo) + : Value(Ty, Value::ArgumentVal), Parent(nullptr), ArgNo(ArgNo) { setName(Name); } @@ -233,7 +229,7 @@ void Function::BuildLazyArguments() const { assert(!FT->getParamType(i)->isVoidTy() && "Cannot have void typed arguments!"); ArgumentList.push_back( - new Argument(FT->getParamType(i), "", nullptr, i)); + new Argument(FT->getParamType(i), "", i)); } // Clear the lazy arguments bit.