1 //===-- llvm/Argument.h - Definition of the Argument class ------*- C++ -*-===//
3 // This file defines the Argument class, which represents an incoming formal
4 // argument to a Function.
6 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_ARGUMENT_H
9 #define LLVM_ARGUMENT_H
11 #include "llvm/Value.h"
13 class Argument : public Value { // Defined in the Function.cpp file
16 Argument *Prev, *Next; // Next and Prev links for our intrusive linked list
17 void setNext(Argument *N) { Next = N; }
18 void setPrev(Argument *N) { Prev = N; }
19 friend class SymbolTableListTraits<Argument, Function, Function,
20 ilist_traits<Argument> >;
21 void setParent(Function *parent);
24 /// Argument ctor - If Function argument is specified, this argument is
25 /// inserted at the end of the argument list for the function.
27 Argument(const Type *Ty, const std::string &Name = "", Function *F = 0);
29 /// setName - Specialize setName to handle symbol table majik...
30 virtual void setName(const std::string &name, SymbolTable *ST = 0);
32 inline const Function *getParent() const { return Parent; }
33 inline Function *getParent() { return Parent; }
35 // getNext/Prev - Return the next or previous argument in the list.
36 Argument *getNext() { return Next; }
37 const Argument *getNext() const { return Next; }
38 Argument *getPrev() { return Prev; }
39 const Argument *getPrev() const { return Prev; }
41 virtual void print(std::ostream &OS) const;
43 /// classof - Methods for support type inquiry through isa, cast, and
46 static inline bool classof(const Argument *) { return true; }
47 static inline bool classof(const Value *V) {
48 return V->getValueType() == ArgumentVal;