* Fix comment
authorChris Lattner <sabre@nondot.org>
Mon, 8 Apr 2002 21:50:15 +0000 (21:50 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 8 Apr 2002 21:50:15 +0000 (21:50 +0000)
* Add printing support
* add isFloatingPoint method
* Remove isXXXType() methods for non-derived types

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2167 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Type.h

index 07d9615ba95a0e40eebdbd1074c13446fbd13318..60601002de754937caf0182c3a06f32d80ee2f45 100644 (file)
@@ -1,7 +1,7 @@
 //===-- llvm/Type.h - Classes for handling data types ------------*- C++ -*--=//
 //
 // This file contains the declaration of the Type class.  For more "Type" type
-// stuff, look in DerivedTypes.h and Opt/ConstantHandling.h
+// stuff, look in DerivedTypes.h.
 //
 // Note that instances of the Type class are immutable: once they are created,
 // they are never changed.  Also note that only one instance of a particular 
@@ -98,6 +98,7 @@ protected:
   inline void setRecursive(bool Val) { Recursive = Val; }
 
 public:
+  virtual void print(std::ostream &O) const;
 
   //===--------------------------------------------------------------------===//
   // Property accessors for dealing with types...
@@ -132,6 +133,10 @@ public:
   //
   virtual bool isIntegral() const { return 0; }
 
+  // isFloatingPoint - Return true if this is one of the two floating point
+  // types
+  bool isFloatingPoint() const { return ID == FloatTyID || ID == DoubleTyID; }
+
   // isAbstract - True if the type is either an Opaque type, or is a derived
   // type that includes an opaque type somewhere in it.  
   //
@@ -214,8 +219,6 @@ public:
   // Methods for determining the subtype of this Type. This section defines a
   // family of isArrayType(), isLabelType(),  etc functions...
   //
-#define HANDLE_PRIM_TYPE(NAME, SIZE)                                      \
-  inline bool is##NAME##Type() const { return ID == NAME##TyID; }
 #define HANDLE_DERV_TYPE(NAME, CLASS)                                     \
   inline bool is##NAME##Type() const { return ID == NAME##TyID; }