Use v.data() instead of &v[0] when SmallVector v might be empty.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp
index 00b5441..e5ab322 100644
--- a/lib/Analysis/ConstantFolding.cpp
+++ b/lib/Analysis/ConstantFolding.cpp
@@ -260,7 +260,7 @@
         }
       }
       
-      return ConstantVector::get(&Result[0], Result.size());
+      return ConstantVector::get(Result.data(), Result.size());
     }
   }
   
@@ -306,10 +306,10 @@
 
   if (const CmpInst *CI = dyn_cast<CmpInst>(I))
     return ConstantFoldCompareInstOperands(CI->getPredicate(),
-                                           &Ops[0], Ops.size(), TD);
+                                           Ops.data(), Ops.size(), TD);
   else
     return ConstantFoldInstOperands(I->getOpcode(), I->getType(),
-                                    &Ops[0], Ops.size(), TD);
+                                    Ops.data(), Ops.size(), TD);
 }
 
 /// ConstantFoldConstantExpression - Attempt to fold the constant expression
@@ -325,10 +325,10 @@
 
   if (CE->isCompare())
     return ConstantFoldCompareInstOperands(CE->getPredicate(),
-                                           &Ops[0], Ops.size(), TD);
+                                           Ops.data(), Ops.size(), TD);
   else 
     return ConstantFoldInstOperands(CE->getOpcode(), CE->getType(),
-                                    &Ops[0], Ops.size(), TD);
+                                    Ops.data(), Ops.size(), TD);
 }
 
 /// ConstantFoldInstOperands - Attempt to constant fold an instruction with the
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 9f6cbc9..6bdb64c 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -442,7 +442,7 @@
   
   Constant *Init = ConstantArray::get(ArrayType::get(EmptyStructPtr,
                                                      Elts.size()),
-                                      &Elts[0], Elts.size());
+                                      Elts.data(), Elts.size());
   // If we already have this array, just return the uniqued version.
   DIDescriptor &Entry = SimpleConstantCache[Init];
   if (!Entry.isNull()) return DIArray(Entry.getGV());