Fix failing test cases with joined live intervals. It turns out that
[oota-llvm.git] / include / llvm / GlobalValue.h
index 13ad9237182949cd7302853cff5582949549c337..942d9b9a4081ded2b6e951a24dfbea4943ba8d43 100644 (file)
@@ -1,4 +1,11 @@
-//===-- llvm/GlobalValue.h - Class to represent a global value ---*- C++ -*--=//
+//===-- llvm/GlobalValue.h - Class to represent a global value --*- C++ -*-===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // This file is a common base class of all globally definable objects.  As such,
 // it is subclassed by GlobalVariable and by Function.  This is used because you
@@ -11,6 +18,9 @@
 #define LLVM_GLOBALVALUE_H
 
 #include "llvm/User.h"
+
+namespace llvm {
+
 class PointerType;
 class Module;
 
@@ -20,6 +30,7 @@ public:
   enum LinkageTypes {
     ExternalLinkage,   // Externally visible function
     LinkOnceLinkage,   // Keep one copy of named function when linking (inline)
+    WeakLinkage,       // Keep one copy of named function when linking (weak)
     AppendingLinkage,  // Special purpose, only applies to global arrays
     InternalLinkage    // Rename collisions when linking (static functions)
   };
@@ -35,11 +46,12 @@ public:
 
   /// getType - Global values are always pointers.
   inline const PointerType *getType() const {
-    return (const PointerType*)User::getType();
+    return reinterpret_cast<const PointerType*>(User::getType());
   }
 
   bool hasExternalLinkage()  const { return Linkage == ExternalLinkage; }
   bool hasLinkOnceLinkage()  const { return Linkage == LinkOnceLinkage; }
+  bool hasWeakLinkage()      const { return Linkage == WeakLinkage; }
   bool hasAppendingLinkage() const { return Linkage == AppendingLinkage; }
   bool hasInternalLinkage()  const { return Linkage == InternalLinkage; }
   void setLinkage(LinkageTypes LT) { Linkage = LT; }
@@ -62,4 +74,6 @@ public:
   }
 };
 
+} // End llvm namespace
+
 #endif