hoist GlobalValue::removeDeadConstantUsers up to being a method on Constant.
[oota-llvm.git] / include / llvm / Constant.h
index defe474fb5660322546c70f70a1c4eb650874afc..38045fc0c1d6caf12cf63d017d5731081b6c859d 100644 (file)
@@ -141,16 +141,22 @@ public:
     assert(0 && "Constants that do not have operands cannot be using 'From'!");
   }
   
-  static ConstantgetNullValue(const Type* Ty);
+  static Constant *getNullValue(const Type* Ty);
   
   /// @returns the value for an integer constant of the given type that has all
   /// its bits set to true.
   /// @brief Get the all ones value
-  static ConstantgetAllOnesValue(const Type* Ty);
+  static Constant *getAllOnesValue(const Type* Ty);
 
   /// getIntegerValue - Return the value for an integer or pointer constant,
   /// or a vector thereof, with the given scalar value.
-  static Constant* getIntegerValue(const Type* Ty, const APInt &V);
+  static Constant *getIntegerValue(const Type* Ty, const APInt &V);
+  
+  /// removeDeadConstantUsers - If there are any dead constant users dangling
+  /// off of this constant, remove them.  This method is useful for clients
+  /// that want to check to see if a global is unused, but don't want to deal
+  /// with potentially dead constants hanging off of the globals.
+  void removeDeadConstantUsers() const;
 };
 
 } // End llvm namespace