[Lldb-commits] [lldb] r131698 - /lldb/trunk/source/Symbol/ClangASTContext.cpp
Charles Davis
cdavis at mines.edu
Thu May 19 16:33:46 PDT 2011
Author: cdavis
Date: Thu May 19 18:33:46 2011
New Revision: 131698
URL: http://llvm.org/viewvc/llvm-project?rev=131698&view=rev
Log:
Use a SmallVector here instead of a VLA.
Modified:
lldb/trunk/source/Symbol/ClangASTContext.cpp
Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=131698&r1=131697&r2=131698&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu May 19 18:33:46 2011
@@ -1481,25 +1481,25 @@
// Populate the method decl with parameter decls
- ParmVarDecl *params[num_params];
+ llvm::SmallVector<ParmVarDecl *, 12> params;
for (int param_index = 0;
param_index < num_params;
++param_index)
{
- params[param_index] = ParmVarDecl::Create (*ast,
- cxx_method_decl,
- SourceLocation(),
- SourceLocation(),
- NULL, // anonymous
- method_function_prototype->getArgType(param_index),
- NULL,
- SC_None,
- SC_None,
- NULL);
+ params.push_back (ParmVarDecl::Create (*ast,
+ cxx_method_decl,
+ SourceLocation(),
+ SourceLocation(),
+ NULL, // anonymous
+ method_function_prototype->getArgType(param_index),
+ NULL,
+ SC_None,
+ SC_None,
+ NULL));
}
- cxx_method_decl->setParams (params, num_params);
+ cxx_method_decl->setParams (params.data(), num_params);
cxx_record_decl->addDecl (cxx_method_decl);
More information about the lldb-commits
mailing list