aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/GlobalVariable.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-10 07:58:01 +0000
committerChris Lattner <sabre@nondot.org>2001-09-10 07:58:01 +0000
commit70cc3397f84c2e1fd69c059a0ef89e398e847b00 (patch)
treeca2156daf75e4abf788d92925bdce4063da36e58 /include/llvm/GlobalVariable.h
parent7720c8e1a7a252e983e3f3e7f841d7901dfea80c (diff)
downloadexternal_llvm-70cc3397f84c2e1fd69c059a0ef89e398e847b00.zip
external_llvm-70cc3397f84c2e1fd69c059a0ef89e398e847b00.tar.gz
external_llvm-70cc3397f84c2e1fd69c059a0ef89e398e847b00.tar.bz2
Implement global variable support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/GlobalVariable.h')
-rw-r--r--include/llvm/GlobalVariable.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/llvm/GlobalVariable.h b/include/llvm/GlobalVariable.h
new file mode 100644
index 0000000..fd97989
--- /dev/null
+++ b/include/llvm/GlobalVariable.h
@@ -0,0 +1,34 @@
+//===-- llvm/Global.h - Class to represent a global variable -----*- C++ -*--=//
+//
+// This file contains the declaration of the GlobalVariable class, which
+// represents a single global variable in the VM.
+//
+// Global variables are constant pointers that refer to hunks of space that are
+// allocated by either the VM, or by the linker in a static compiler.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_GLOBAL_VARIABLE_H
+#define LLVM_GLOBAL_VARIABLE_H
+
+#include "llvm/Value.h"
+class Module;
+
+class GlobalVariable : public Value {
+ Module *Parent; // The module that contains this method
+
+ friend class ValueHolder<GlobalVariable, Module, Module>;
+ void setParent(Module *parent) { Parent = parent; }
+
+public:
+ GlobalVariable(const Type *Ty, const string &Name = "");
+ ~GlobalVariable() {}
+
+ // Specialize setName to handle symbol table majik...
+ virtual void setName(const string &name, SymbolTable *ST = 0);
+
+ inline Module *getParent() { return Parent; }
+ inline const Module *getParent() const { return Parent; }
+};
+
+#endif