* Minor cleanups
[oota-llvm.git] / include / llvm / GlobalValue.h
index baee0bf4e085c5a99e6c9c8842ae0420fc19bd18..1527940d7967154bd380ed7889a85982c9acf31d 100644 (file)
@@ -16,9 +16,11 @@ class PointerType;
 class GlobalValue : public User {
   GlobalValue(const GlobalValue &);             // do not implement
 protected:
-  GlobalValue(const Type *Ty, ValueTy vty, const string &name = "")
-    : User(Ty, vty, name) { Parent = 0; }
+  GlobalValue(const Type *Ty, ValueTy vty, bool hasInternalLinkage,
+             const std::string &name = "")
+    : User(Ty, vty, name), HasInternalLinkage(hasInternalLinkage), Parent(0) {}
 
+  bool HasInternalLinkage;    // Is this value accessable externally?
   Module *Parent;
 public:
   ~GlobalValue() {}
@@ -28,6 +30,11 @@ public:
     return (const PointerType*)User::getType();
   }
 
+  // Internal Linkage - True if the global value is inaccessible to 
+  bool hasInternalLinkage() const { return HasInternalLinkage; }
+  bool hasExternalLinkage() const { return !HasInternalLinkage; }
+  void setInternalLinkage(bool HIL) { HasInternalLinkage = HIL; }
+
   // Get the module that this global value is contained inside of...
   inline Module *getParent() { return Parent; }
   inline const Module *getParent() const { return Parent; }