Silence implicit 64->32-bit conversion warnings.
authorChris Lattner <sabre@nondot.org>
Wed, 29 Aug 2007 16:32:50 +0000 (16:32 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 29 Aug 2007 16:32:50 +0000 (16:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41567 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Instructions.h

index 2913341cb8988b8037786dd7131e01e09579670a..328932acac100020dc56d250e975186eab6b74c5 100644 (file)
@@ -762,17 +762,10 @@ class CallInst : public Instruction {
             // 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 @@ class InvokeInst : public TerminatorInst {
             // 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);
   }