Reclaim memory allocated for ParmVarDecl's in FunctionDecl::Destroy.

Fixed a bug in ParmVarDecl::param_end(): Handle the case where there are no
ParmVarDecls for a FunctionDecl, but its function prototype has formal arguments
(can happen with typedefs).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51297 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 51040d3..c75fb8b 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -412,7 +412,12 @@
 }
 
 void FunctionDecl::Destroy(ASTContext& C) {
-  if (Body) Body->Destroy(C);
+  if (Body)
+    Body->Destroy(C);
+
+  for (param_iterator I=param_begin(), E=param_end(); I!=E; ++I)
+    (*I)->Destroy(C);
+    
   Decl::Destroy(C);
 }