Introduced support for UnknownAnyTy, the Clang type
representing variables whose type must be inferred
from the way they are used.  Functions without debug
information now return UnknownAnyTy and must be cast.

Variables with no debug information are not yet using
UnknownAnyTy; instead they are assumed to be void*.
Support for variables of unknown type is coming (and,
in fact, some relevant support functions are included
in this commit) but will take a bit of extra effort.

The testsuite has also been updated to reflect the new
requirement that the result of printf be cast, i.e.

expr (int) printf("Hello world!")


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131263 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionParser.cpp b/source/Expression/ClangExpressionParser.cpp
index 5165462..028f99a 100644
--- a/source/Expression/ClangExpressionParser.cpp
+++ b/source/Expression/ClangExpressionParser.cpp
@@ -17,6 +17,7 @@
 #include "lldb/Core/StreamString.h"
 #include "lldb/Expression/ClangASTSource.h"
 #include "lldb/Expression/ClangExpression.h"
+#include "lldb/Expression/ClangExpressionDeclMap.h"
 #include "lldb/Expression/IRDynamicChecks.h"
 #include "lldb/Expression/IRForTarget.h"
 #include "lldb/Expression/IRToDWARF.h"
@@ -352,7 +353,7 @@
         ParseAST(m_compiler->getPreprocessor(), m_code_generator.get(), m_compiler->getASTContext());    
     
     diag_buf->EndSourceFile();
-    
+        
     TextDiagnosticBuffer::const_iterator diag_iterator;
     
     int num_errors = 0;
@@ -377,6 +378,15 @@
          ++diag_iterator)
         stream.Printf("note: %s\n", (*diag_iterator).second.c_str());
     
+    if (!num_errors)
+    {
+        if (m_expr.DeclMap() && !m_expr.DeclMap()->ResolveUnknownTypes())
+        {
+            stream.Printf("error: Couldn't infer the type of a variable\n");
+            num_errors++;
+        }
+    }
+    
     return num_errors;
 }