[llvm] r298009 - Remove dead F parameter from Argument constructor
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 16 15:58:57 PDT 2017
Author: rnk
Date: Thu Mar 16 17:58:56 2017
New Revision: 298009
URL: http://llvm.org/viewvc/llvm-project?rev=298009&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/IR/Argument.h
llvm/trunk/lib/IR/Function.cpp
Modified: llvm/trunk/include/llvm/IR/Argument.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Argument.h?rev=298009&r1=298008&r2=298009&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Argument.h (original)
+++ llvm/trunk/include/llvm/IR/Argument.h Thu Mar 16 17:58:56 2017
@@ -38,10 +38,8 @@ class Argument : public Value, public il
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; }
Modified: llvm/trunk/lib/IR/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Function.cpp?rev=298009&r1=298008&r2=298009&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Function.cpp (original)
+++ llvm/trunk/lib/IR/Function.cpp Thu Mar 16 17:58:56 2017
@@ -39,12 +39,8 @@ template class llvm::SymbolTableListTrai
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() cons
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.
More information about the llvm-commits
mailing list