[llvm-commits] [llvm] r79595 - /llvm/trunk/lib/Support/APInt.cpp

Eric Christopher echristo at apple.com
Thu Aug 20 21:10:31 PDT 2009


Author: echristo
Date: Thu Aug 20 23:10:31 2009
New Revision: 79595

URL: http://llvm.org/viewvc/llvm-project?rev=79595&view=rev
Log:
Update error messages for '+'. Fix grammar and make the two
negative checks resemble each other.

Modified:
    llvm/trunk/lib/Support/APInt.cpp

Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=79595&r1=79594&r2=79595&view=diff

==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Thu Aug 20 23:10:31 2009
@@ -623,14 +623,15 @@
 
   size_t slen = str.size();
 
-  // Each computation below needs to know if its negative
+  // Each computation below needs to know if it's negative.
   StringRef::iterator p = str.begin();
-  unsigned isNegative = str.front() == '-';
+  unsigned isNegative = *p == '-';
   if (*p == '-' || *p == '+') {
     p++;
     slen--;
-    assert(slen && "string is only a minus!");
+    assert(slen && "String is only a sign, needs a value.");
   }
+
   // For radixes of power-of-two values, the bits required is accurately and
   // easily computed
   if (radix == 2)
@@ -2052,7 +2053,7 @@
   if (*p == '-' || *p == '+') {
     p++;
     slen--;
-    assert(slen && "string is only a minus!");
+    assert(slen && "String is only a sign, needs a value.");
   }
   assert((slen <= numbits || radix != 2) && "Insufficient bit width");
   assert(((slen-1)*3 <= numbits || radix != 8) && "Insufficient bit width");





More information about the llvm-commits mailing list