Author: lattner
Date: Wed Aug 29 11:32:50 2007
New Revision: 41567

URL: http://llvm.org/viewvc/llvm-project?rev=41567&view=rev
Log:
Silence implicit 64->32-bit conversion warnings.

Modified:
    llvm/trunk/include/llvm/Instructions.h

Modified: llvm/trunk/include/llvm/Instructions.h
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=41567&r1=41566&r2=41567&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Wed Aug 29 11:32:50 2007
@@ -762,17 +762,10 @@
             // This argument ensures that we have an iterator we can
             // do arithmetic on in constant time
             std::random_access_iterator_tag) {
-    typename std::iterator_traits<InputIterator>::difference_type NumArgs = 
-      std::distance(ArgBegin, ArgEnd);
-    
-    if (NumArgs > 0) {
-      // This requires that the iterator points to contiguous memory.
-      init(Func, &*ArgBegin, NumArgs);
-    }
-    else {
-      init(Func, 0, NumArgs);
-    }
+    unsigned NumArgs = (unsigned)std::distance(ArgBegin, ArgEnd);
     
+    // This requires that the iterator points to contiguous memory.
+    init(Func, NumArgs ? &*ArgBegin : 0, NumArgs);
     setName(Name);
   }
 
@@ -1552,17 +1545,10 @@
             // This argument ensures that we have an iterator we can
             // do arithmetic on in constant time
             std::random_access_iterator_tag) {
-    typename std::iterator_traits<InputIterator>::difference_type NumArgs = 
-      std::distance(ArgBegin, ArgEnd);
-    
-    if (NumArgs > 0) {
-      // This requires that the iterator points to contiguous memory.
-      init(Func, IfNormal, IfException, &*ArgBegin, NumArgs);
-    }
-    else {
-      init(Func, IfNormal, IfException, 0, NumArgs);
-    }
+    unsigned NumArgs = (unsigned)std::distance(ArgBegin, ArgEnd);
     
+    // This requires that the iterator points to contiguous memory.
+    init(Func, IfNormal, IfException, NumArgs ? &*ArgBegin : 0, NumArgs);
     setName(Name);
   }
 


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to