* Both Method & GlobalVariable now subclass GlobalValue
[oota-llvm.git] / include / llvm / GlobalVariable.h
index 3ee7f6d45a2bd3966e984ebb15f6a86702946ba0..4256ffee940ad07f0ef085e75fd7376ce433e44d 100644 (file)
 #ifndef LLVM_GLOBAL_VARIABLE_H
 #define LLVM_GLOBAL_VARIABLE_H
 
-#include "llvm/User.h"
+#include "llvm/GlobalValue.h"
 class Module;
 class ConstPoolVal;
 class PointerType;
 
-class GlobalVariable : public User {
+class GlobalVariable : public GlobalValue {
   Module *Parent;                  // The module that contains this method
 
   friend class ValueHolder<GlobalVariable, Module, Module>;
@@ -30,11 +30,6 @@ public:
                 const string &Name = "");
   ~GlobalVariable() {}
 
-  // getType - Global variables are always pointers
-  inline const PointerType *getType() const {
-    return (const PointerType*)User::getType();
-  }
-
   // Specialize setName to handle symbol table majik...
   virtual void setName(const string &name, SymbolTable *ST = 0);
 
@@ -63,7 +58,7 @@ public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const GlobalVariable *) { return true; }
   static inline bool classof(const Value *V) {
-    return V->getValueType() == Value::GlobalVal;
+    return V->getValueType() == Value::GlobalVariableVal;
   }
 };