-//===-- 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
#define LLVM_GLOBALVALUE_H
#include "llvm/User.h"
+
+namespace llvm {
+
class PointerType;
class Module;
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)
};
/// 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; }
}
};
+} // End llvm namespace
+
#endif