Added support for StmtIterators to iterate over the size expressions
of VariableArrayTypes that appear in TypedefDecls.

for example:

  typedef int T[x][x];

the StmtIterator will iterate over "x" and "x" as subexpressions of
the DeclStmt for T.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43474 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtIterator.cpp b/AST/StmtIterator.cpp
index 89d17bd..ae6de11 100644
--- a/AST/StmtIterator.cpp
+++ b/AST/StmtIterator.cpp
@@ -38,10 +38,11 @@
   setVAPtr(p);
 
   if (!p) {
-    VarDecl* VD = cast<VarDecl>(decl);
-    
-    if (!VD->Init)
-      NextDecl();
+    if (VarDecl* VD = dyn_cast<VarDecl>(decl)) 
+      if (VD->Init)
+        return;
+      
+    NextDecl();
   }
 }
 
@@ -69,6 +70,13 @@
       if (VD->getInit())
         return;    
     }
+    else if (TypedefDecl* TD = dyn_cast<TypedefDecl>(decl)) {
+      if (VariableArrayType* VAPtr = 
+           FindVA(TD->getUnderlyingType().getTypePtr())) {
+        setVAPtr(VAPtr);
+        return;
+      }
+    }
     else if (EnumConstantDecl* ECD = dyn_cast<EnumConstantDecl>(decl))
       if (ECD->getInitExpr())
         return;