1 //===-- llvm/Global.h - Class to represent a global variable -----*- C++ -*--=//
3 // This file contains the declaration of the GlobalVariable class, which
4 // represents a single global variable in the VM.
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.
9 //===----------------------------------------------------------------------===//
11 #ifndef LLVM_GLOBAL_VARIABLE_H
12 #define LLVM_GLOBAL_VARIABLE_H
14 #include "llvm/Value.h"
17 class GlobalVariable : public Value {
18 Module *Parent; // The module that contains this method
20 friend class ValueHolder<GlobalVariable, Module, Module>;
21 void setParent(Module *parent) { Parent = parent; }
24 GlobalVariable(const Type *Ty, const string &Name = "");
27 // Specialize setName to handle symbol table majik...
28 virtual void setName(const string &name, SymbolTable *ST = 0);
30 inline Module *getParent() { return Parent; }
31 inline const Module *getParent() const { return Parent; }