Disallow multiple edges.
[oota-llvm.git] / include / llvm / GlobalValue.h
index 6b6610b724f0dde6dbbf77edc9ea1a90e8e4dda6..b0e58d4451c7eb5e6983c37cfcd010ef0d31a35b 100644 (file)
@@ -107,12 +107,14 @@ public:
   bool hasDLLImportLinkage()  const { return Linkage == DLLImportLinkage; }
   bool hasDLLExportLinkage()  const { return Linkage == DLLExportLinkage; }
   bool hasExternalWeakLinkage() const { return Linkage == ExternalWeakLinkage; }
+  bool hasGhostLinkage()      const { return Linkage == GhostLinkage; }
   void setLinkage(LinkageTypes LT) { Linkage = LT; }
   LinkageTypes getLinkage() const { return Linkage; }
 
-  /// isWeakForLinker - Determines if symbol is weak for linker having weak or
-  /// linkonce or common or extweak LLVM linkage.
-  bool isWeakForLinker() const {
+  /// mayBeOverridden - Whether the definition of this global may be replaced
+  /// at link time.  For example, if a function has weak linkage then the code
+  /// defining it may be replaced by different code.
+  bool mayBeOverridden() const {
     return (Linkage == WeakLinkage ||
             Linkage == LinkOnceLinkage ||
             Linkage == CommonLinkage ||
@@ -141,6 +143,14 @@ public:
   /// value is outside of the current translation unit...
   virtual bool isDeclaration() const = 0;
 
+  /// removeFromParent - This method unlinks 'this' from the containing module,
+  /// but does not delete it.
+  virtual void removeFromParent() = 0;
+
+  /// eraseFromParent - This method unlinks 'this' from the containing module
+  /// and deletes it.
+  virtual void eraseFromParent() = 0;
+
   /// getParent - Get the module that this global value is contained inside
   /// of...
   inline Module *getParent() { return Parent; }