bae7e2317354ae23da6aad7face02d2d67af91cd
[oota-llvm.git] / include / llvm / CodeGen / PseudoSourceValue.h
1 //===-- llvm/CodeGen/PseudoSourceValue.h ------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declaration of the PseudoSourceValue class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
15 #define LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
16
17 #include "llvm/Value.h"
18
19 namespace llvm {
20   /// PseudoSourceValue - Special value supplied for machine level alias
21   /// analysis. It indicates that the a memory access references the functions
22   /// stack frame (e.g., a spill slot), below the stack frame (e.g., argument
23   /// space), or constant pool.
24   class PseudoSourceValue : public Value {
25     const char *name;
26   public:
27     explicit PseudoSourceValue(const char *_name);
28
29     virtual void print(std::ostream &OS) const;
30
31     /// classof - Methods for support type inquiry through isa, cast, and
32     /// dyn_cast:
33     ///
34     static inline bool classof(const PseudoSourceValue *) { return true; }
35     static inline bool classof(const Value *V) {
36       return V->getValueID() == PseudoSourceValueVal;
37     }
38
39     /// A pseudo source value referencing to the stack frame of a function,
40     /// e.g., a spill slot.
41     static const PseudoSourceValue FPRel;
42
43     /// A source value referencing the area below the stack frame of a function,
44     /// e.g., the argument space.
45     static const PseudoSourceValue SPRel;
46
47     /// A source value referencing the global offset table (or something the
48     /// like).
49     static const PseudoSourceValue GPRel;
50
51     /// A source value relative to some kind of thread id/pointer.
52     static const PseudoSourceValue TPRel;
53
54     /// A SV referencing the constant pool
55     static const PseudoSourceValue CPRel;
56
57     /// A SV referencing the jump table
58     static const PseudoSourceValue JTRel;
59   };
60 } // End llvm namespace
61
62 #endif