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; }
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);
}
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.