PseudoSourceValue.h revision 198090
1193323Sed//===-- llvm/CodeGen/PseudoSourceValue.h ------------------------*- C++ -*-===//
2193323Sed//
3193323Sed//                     The LLVM Compiler Infrastructure
4193323Sed//
5193323Sed// This file is distributed under the University of Illinois Open Source
6193323Sed// License. See LICENSE.TXT for details.
7193323Sed//
8193323Sed//===----------------------------------------------------------------------===//
9193323Sed//
10193323Sed// This file contains the declaration of the PseudoSourceValue class.
11193323Sed//
12193323Sed//===----------------------------------------------------------------------===//
13193323Sed
14193323Sed#ifndef LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
15193323Sed#define LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
16193323Sed
17193323Sed#include "llvm/Value.h"
18193323Sed
19193323Sednamespace llvm {
20193323Sed  class MachineFrameInfo;
21193323Sed  class raw_ostream;
22193323Sed
23193323Sed  /// PseudoSourceValue - Special value supplied for machine level alias
24193323Sed  /// analysis. It indicates that the a memory access references the functions
25193323Sed  /// stack frame (e.g., a spill slot), below the stack frame (e.g., argument
26193323Sed  /// space), or constant pool.
27193323Sed  class PseudoSourceValue : public Value {
28198090Srdivacky  private:
29198090Srdivacky    /// printCustom - Implement printing for PseudoSourceValue. This is called
30198090Srdivacky    /// from Value::print or Value's operator<<.
31198090Srdivacky    ///
32198090Srdivacky    virtual void printCustom(raw_ostream &O) const;
33198090Srdivacky
34193323Sed  public:
35193323Sed    PseudoSourceValue();
36193323Sed
37198090Srdivacky    /// isConstant - Test whether the memory pointed to by this
38198090Srdivacky    /// PseudoSourceValue has a constant value.
39193323Sed    ///
40193323Sed    virtual bool isConstant(const MachineFrameInfo *) const;
41193323Sed
42193323Sed    /// classof - Methods for support type inquiry through isa, cast, and
43193323Sed    /// dyn_cast:
44193323Sed    ///
45193323Sed    static inline bool classof(const PseudoSourceValue *) { return true; }
46193323Sed    static inline bool classof(const Value *V) {
47193323Sed      return V->getValueID() == PseudoSourceValueVal;
48193323Sed    }
49193323Sed
50193323Sed    /// A pseudo source value referencing a fixed stack frame entry,
51193323Sed    /// e.g., a spill slot.
52193323Sed    static const PseudoSourceValue *getFixedStack(int FI);
53193323Sed
54198090Srdivacky    /// A pseudo source value referencing the area below the stack frame of
55198090Srdivacky    /// a function, e.g., the argument space.
56193323Sed    static const PseudoSourceValue *getStack();
57193323Sed
58198090Srdivacky    /// A pseudo source value referencing the global offset table
59198090Srdivacky    /// (or something the like).
60193323Sed    static const PseudoSourceValue *getGOT();
61193323Sed
62198090Srdivacky    /// A pseudo source value referencing the constant pool. Since constant
63198090Srdivacky    /// pools are constant, this doesn't need to identify a specific constant
64198090Srdivacky    /// pool entry.
65193323Sed    static const PseudoSourceValue *getConstantPool();
66193323Sed
67198090Srdivacky    /// A pseudo source value referencing a jump table. Since jump tables are
68198090Srdivacky    /// constant, this doesn't need to identify a specific jump table.
69193323Sed    static const PseudoSourceValue *getJumpTable();
70193323Sed  };
71193323Sed} // End llvm namespace
72193323Sed
73193323Sed#endif
74