diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-03-08 21:51:21 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-03-08 21:51:21 +0000 |
commit | bea522ff43a3f11c7a2bc7949119dbb9fce19e39 (patch) | |
tree | 7e720ef716401a1b50dda348b13a9b8a108e1200 /lib/CodeGen | |
parent | 303b96f255d61ae3dff913d777d3f40332786257 (diff) |
ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.
No (intended) functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index bd4c98e35b..27ef65fa94 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -420,19 +420,16 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, // Emit subprogram debug descriptor. if (CGDebugInfo *DI = getDebugInfo()) { - unsigned NumArgs = 0; - QualType *ArgsArray = new QualType[Args.size()]; + SmallVector<QualType, 16> ArgTypes; for (FunctionArgList::const_iterator i = Args.begin(), e = Args.end(); i != e; ++i) { - ArgsArray[NumArgs++] = (*i)->getType(); + ArgTypes.push_back((*i)->getType()); } QualType FnType = - getContext().getFunctionType(RetTy, ArgsArray, NumArgs, + getContext().getFunctionType(RetTy, ArgTypes, FunctionProtoType::ExtProtoInfo()); - delete[] ArgsArray; - DI->setLocation(StartLoc); DI->EmitFunctionStart(GD, FnType, CurFn, Builder); } |