[Lldb-commits] [lldb] r106665 - /lldb/trunk/source/Expression/ClangASTSource.cpp
Sean Callanan
scallanan at apple.com
Wed Jun 23 11:58:10 PDT 2010
Author: spyffe
Date: Wed Jun 23 13:58:10 2010
New Revision: 106665
URL: http://llvm.org/viewvc/llvm-project?rev=106665&view=rev
Log:
Fixes for array handling and dynamic type casting
errors pointed out by John McCall.
Modified:
lldb/trunk/source/Expression/ClangASTSource.cpp
Modified: lldb/trunk/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangASTSource.cpp?rev=106665&r1=106664&r2=106665&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangASTSource.cpp (original)
+++ lldb/trunk/source/Expression/ClangASTSource.cpp Wed Jun 23 13:58:10 2010
@@ -112,15 +112,14 @@
QualType QT = QualType::getFromOpaquePtr(type);
clang::Type *T = QT.getTypePtr();
+ const FunctionProtoType *FPT = T->getAs<FunctionProtoType>();
- if (T->isFunctionProtoType())
- {
- FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(T);
-
+ if (FPT)
+ {
unsigned NumArgs = FPT->getNumArgs();
unsigned ArgIndex;
- ParmVarDecl *ParmVarDecls[NumArgs];
+ ParmVarDecl **ParmVarDecls = new ParmVarDecl*[NumArgs];
for (ArgIndex = 0; ArgIndex < NumArgs; ++ArgIndex)
{
@@ -138,6 +137,8 @@
}
Decl->setParams(ParmVarDecls, NumArgs);
+
+ delete [] ParmVarDecls;
}
Decls.push_back(Decl);
More information about the lldb-commits
mailing list