Add support for register alias set description
[oota-llvm.git] / include / llvm / Argument.h
1 //===-- llvm/Argument.h - Definition of the Argument class -------*- C++ -*--=//
2 //
3 // This file defines the Argument class, which represents and incoming formal
4 // argument to a Function.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #ifndef LLVM_ARGUMENT_H
9 #define LLVM_ARGUMENT_H
10
11 #include "llvm/Value.h"
12
13 class Argument : public Value {  // Defined in the Function.cpp file
14   Function *Parent;
15
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   void setParent(Function *parent);
21
22 public:
23   /// Argument ctor - If Function argument is specified, this argument is
24   /// inserted at the end of the argument list for the function.
25   ///
26   Argument(const Type *Ty, const std::string &Name = "", Function *F = 0);
27
28   /// setName - Specialize setName to handle symbol table majik...
29   virtual void setName(const std::string &name, SymbolTable *ST = 0);
30
31   inline const Function *getParent() const { return Parent; }
32   inline       Function *getParent()       { return Parent; }
33  
34   // getNext/Prev - Return the next or previous argument in the list.
35         Argument *getNext()       { return Next; }
36   const Argument *getNext() const { return Next; }
37         Argument *getPrev()       { return Prev; }
38   const Argument *getPrev() const { return Prev; }
39
40   virtual void print(std::ostream &OS) const;
41
42   /// classof - Methods for support type inquiry through isa, cast, and
43   /// dyn_cast:
44   ///
45   static inline bool classof(const Argument *) { return true; }
46   static inline bool classof(const Value *V) {
47     return V->getValueType() == ArgumentVal;
48   }
49 };
50
51 #endif