Emit forward declaration

Outputs forward declarations of scopes (except interfaces)
and outputs typedefs declarations before type complete
declarations.

Bug: 31827278

Test: mma
Change-Id: I2d034fa62f4fae5dd2d6f64fa832da341b006ad2
diff --git a/Scope.cpp b/Scope.cpp
index 2033391..64ccd2e 100644
--- a/Scope.cpp
+++ b/Scope.cpp
@@ -143,7 +143,12 @@
 }
 
 status_t Scope::emitTypeDeclarations(Formatter &out) const {
-    return forEachType([&](Type *type) {
+    forEachType([&](Type* type) {
+        type->emitTypeForwardDeclaration(out);
+        return OK;
+    });
+
+    return forEachType([&](Type* type) {
         return type->emitTypeDeclarations(out);
     });
 }