Use v.data() instead of &v[0] when SmallVector v might be empty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 329d6c4..ccbea26 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1361,7 +1361,7 @@
CanonicalArgs.push_back(getCanonicalType(ArgArray[i]));
Canonical = getFunctionType(getCanonicalType(ResultTy),
- &CanonicalArgs[0], NumArgs,
+ CanonicalArgs.data(), NumArgs,
isVariadic, TypeQuals);
// Get the new insert position for the node we care about.
diff --git a/lib/AST/Builtins.cpp b/lib/AST/Builtins.cpp
index ca75c5d..8368feb 100644
--- a/lib/AST/Builtins.cpp
+++ b/lib/AST/Builtins.cpp
@@ -285,6 +285,6 @@
// handle untyped/variadic arguments "T c99Style();" or "T cppStyle(...);".
if (ArgTypes.size() == 0 && TypeStr[0] == '.')
return Context.getFunctionNoProtoType(ResType);
- return Context.getFunctionType(ResType, &ArgTypes[0], ArgTypes.size(),
+ return Context.getFunctionType(ResType, ArgTypes.data(), ArgTypes.size(),
TypeStr[0] == '.', 0);
}