[llvm-commits] [llvm] r86394 - /llvm/trunk/include/llvm/Target/TargetData.h

Chris Lattner sabre at nondot.org
Sat Nov 7 10:53:00 PST 2009


Author: lattner
Date: Sat Nov  7 12:53:00 2009
New Revision: 86394

URL: http://llvm.org/viewvc/llvm-project?rev=86394&view=rev
Log:
all targets should be required to declare legal integer types.  My plan to
make it optional doesn't work out.  If you don't want to specify this, don't
specify a TD string at all.

Modified:
    llvm/trunk/include/llvm/Target/TargetData.h

Modified: llvm/trunk/include/llvm/Target/TargetData.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetData.h?rev=86394&r1=86393&r2=86394&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetData.h (original)
+++ llvm/trunk/include/llvm/Target/TargetData.h Sat Nov  7 12:53:00 2009
@@ -144,23 +144,22 @@
   /// string constructor above.
   std::string getStringRepresentation() const;
   
-  
-  /// isIllegalInteger - This function returns true if the specified type is
-  /// known to not be a native integer type supported by the CPU.  For example,
+  /// isLegalInteger - This function returns true if the specified type is
+  /// known tobe a native integer type supported by the CPU.  For example,
   /// i64 is not native on most 32-bit CPUs and i37 is not native on any known
-  /// one.  This returns false if the integer width is legal or we don't know.
+  /// one.  This returns false if the integer width is not legal.
   ///
   /// The width is specified in bits.
   ///
-  bool isIllegalInteger(unsigned Width) const {
-    // If we don't have information about legal integer types, don't claim the
-    // type is illegal.
-    if (LegalIntWidths.empty()) return false;
-    
+  bool isLegalInteger(unsigned Width) const {
     for (unsigned i = 0, e = LegalIntWidths.size(); i != e; ++i)
       if (LegalIntWidths[i] == Width)
-        return false;
-    return true;
+        return true;
+    return false;
+  }
+  
+  bool isIllegalInteger(unsigned Width) const {
+    return !isLegalInteger(Width);
   }
   
   /// Target pointer alignment





More information about the llvm-commits mailing list