Add printing support to ConstantRange class
authorChris Lattner <sabre@nondot.org>
Mon, 2 Sep 2002 00:18:26 +0000 (00:18 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 2 Sep 2002 00:18:26 +0000 (00:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3566 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/ConstantRange.h

index 1d4ce6cc8683f4cafe68f03b997c036cc0c9cca5..553fd166c7685f069aaf9663d1877658544ab2a8 100644 (file)
@@ -18,6 +18,7 @@
 #define LLVM_SUPPORT_CONSTANT_RANGE_H
 
 #include "Support/DataTypes.h"
+#include <iosfwd>
 class ConstantIntegral;
 class Type;
 
@@ -92,6 +93,19 @@ class ConstantRange {
   /// set before.
   ///
   ConstantRange unionWith(const ConstantRange &CR) const;
+
+  /// print - Print out the bounds to a stream...
+  ///
+  void print(std::ostream &OS) const;
+
+  /// dump - Allow printing from a debugger easily...
+  ///
+  void dump() const;
 };
 
+inline std::ostream &operator<<(std::ostream &OS, const ConstantRange &CR) {
+  CR.print(OS);
+  return OS;
+}
+
 #endif