fd979896182e7fb2f8594996c100b8c24afe84b3
[oota-llvm.git] / include / llvm / GlobalVariable.h
1 //===-- llvm/Global.h - Class to represent a global variable -----*- C++ -*--=//
2 //
3 // This file contains the declaration of the GlobalVariable class, which
4 // represents a single global variable in the VM.
5 //
6 // Global variables are constant pointers that refer to hunks of space that are
7 // allocated by either the VM, or by the linker in a static compiler.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #ifndef LLVM_GLOBAL_VARIABLE_H
12 #define LLVM_GLOBAL_VARIABLE_H
13
14 #include "llvm/Value.h"
15 class Module;
16
17 class GlobalVariable : public Value {
18   Module *Parent;                  // The module that contains this method
19
20   friend class ValueHolder<GlobalVariable, Module, Module>;
21   void setParent(Module *parent) { Parent = parent; }
22
23 public:
24   GlobalVariable(const Type *Ty, const string &Name = "");
25   ~GlobalVariable() {}
26
27   // Specialize setName to handle symbol table majik...
28   virtual void setName(const string &name, SymbolTable *ST = 0);
29
30   inline       Module *getParent()       { return Parent; }
31   inline const Module *getParent() const { return Parent; }
32 };
33
34 #endif