Updated LLVM/Clang to pull in the latest ARM disassembler.
This involved minor changes to the way we report Objective-C
methods, as well as cosmetic changes and added parameters
for a variety of Clang APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141437 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ASTDumper.cpp b/source/Expression/ASTDumper.cpp
index 8194233..3f6104b 100644
--- a/source/Expression/ASTDumper.cpp
+++ b/source/Expression/ASTDumper.cpp
@@ -245,7 +245,7 @@
 void ASTDumper::VisitTagDecl (clang::TagDecl *tag_decl)
 {
     m_stream.Indent();  m_stream.Printf("class : TagDecl\n");
-    m_stream.Indent();  m_stream.Printf("isDefinition() : %s\n", SfB(tag_decl->isDefinition()));
+    m_stream.Indent();  m_stream.Printf("getDefinition() : %s\n", SfB((bool)tag_decl->getDefinition()));
     m_stream.Indent();  m_stream.Printf("isBeingDefined() : %s\n", SfB(tag_decl->isBeingDefined()));
     m_stream.Indent();  m_stream.Printf("isEmbeddedInDeclarator() : %s\n", SfB(tag_decl->isEmbeddedInDeclarator()));
     m_stream.Indent();  m_stream.Printf("isDependentType() : %s\n", SfB(tag_decl->isDependentType()));
@@ -416,7 +416,7 @@
         switch (type->getScalarTypeKind())
         {
             default:                                m_stream.Printf("~\n"); break;
-            case clang::Type::STK_Pointer:          m_stream.Printf("STK_Pointer\n"); break;
+            case clang::Type::STK_CPointer:         m_stream.Printf("STK_CPointer\n"); break;
             case clang::Type::STK_MemberPointer:    m_stream.Printf("STK_MemberPointer\n"); break;
             case clang::Type::STK_Bool:             m_stream.Printf("STK_Bool\n"); break;
             case clang::Type::STK_Integral:         m_stream.Printf("STK_Integral\n"); break;
diff --git a/source/Expression/ASTResultSynthesizer.cpp b/source/Expression/ASTResultSynthesizer.cpp
index b2b593b..db0714e 100644
--- a/source/Expression/ASTResultSynthesizer.cpp
+++ b/source/Expression/ASTResultSynthesizer.cpp
@@ -200,6 +200,10 @@
     }
     
     Stmt *method_body = MethodDecl->getBody();
+    
+    if (!method_body)
+        return false;
+    
     CompoundStmt *compound_stmt = dyn_cast<CompoundStmt>(method_body);
     
     bool ret = SynthesizeBodyResult (compound_stmt,
diff --git a/source/Expression/ClangASTSource.cpp b/source/Expression/ClangASTSource.cpp
index 26bf0b9..854fcc8 100644
--- a/source/Expression/ClangASTSource.cpp
+++ b/source/Expression/ClangASTSource.cpp
@@ -197,27 +197,25 @@
         unsigned NumArgs = func_proto_type->getNumArgs();
         unsigned ArgIndex;
         
-        ParmVarDecl **param_var_decls = new ParmVarDecl*[NumArgs];
-        
+        SmallVector<ParmVarDecl *, 5> parm_var_decls;
+                
         for (ArgIndex = 0; ArgIndex < NumArgs; ++ArgIndex)
         {
             QualType arg_qual_type (func_proto_type->getArgType(ArgIndex));
             
-            param_var_decls[ArgIndex] = ParmVarDecl::Create (m_ast_source.m_ast_context,
-                                                             const_cast<DeclContext*>(m_decl_context),
-                                                             SourceLocation(),
-                                                             SourceLocation(),
-                                                             NULL,
-                                                             arg_qual_type,
-                                                             NULL,
-                                                             SC_Static,
-                                                             SC_Static,
-                                                             NULL);
+            parm_var_decls.push_back(ParmVarDecl::Create (m_ast_source.m_ast_context,
+                                                          const_cast<DeclContext*>(m_decl_context),
+                                                          SourceLocation(),
+                                                          SourceLocation(),
+                                                          NULL,
+                                                          arg_qual_type,
+                                                          NULL,
+                                                          SC_Static,
+                                                          SC_Static,
+                                                          NULL));
         }
         
-        func_decl->setParams(param_var_decls, NumArgs);
-        
-        delete [] param_var_decls;
+        func_decl->setParams(ArrayRef<ParmVarDecl*>(parm_var_decls));
     }
     
     m_decls.push_back(func_decl);
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index 42c6f7a..368bbe6 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -2388,6 +2388,10 @@
             
             return;
         }
+        
+        // any other $__lldb names should be weeded out now
+        if (!::strncmp(name_unique_cstr, "$__lldb", sizeof("$__lldb") - 1))
+            return;
 
         do
         {
diff --git a/source/Expression/ClangExpressionParser.cpp b/source/Expression/ClangExpressionParser.cpp
index e674565..17cc5a8 100644
--- a/source/Expression/ClangExpressionParser.cpp
+++ b/source/Expression/ClangExpressionParser.cpp
@@ -41,7 +41,6 @@
 #include "clang/Frontend/FrontendPluginRegistry.h"
 #include "clang/Frontend/TextDiagnosticBuffer.h"
 #include "clang/Frontend/TextDiagnosticPrinter.h"
-#include "clang/Frontend/VerifyDiagnosticsClient.h"
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Parse/ParseAST.h"
 #include "clang/Rewrite/FrontendActions.h"
@@ -50,6 +49,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ExecutionEngine/ExecutionEngine.h"
+#include "llvm/Support/TargetSelect.h"
 
 #if !defined(__APPLE__)
 #define USE_STANDARD_JIT
@@ -67,8 +67,6 @@
 #include "llvm/Support/DynamicLibrary.h"
 #include "llvm/Support/Host.h"
 #include "llvm/Support/Signals.h"
-#include "llvm/Target/TargetRegistry.h"
-#include "llvm/Target/TargetSelect.h"
 
 using namespace clang;
 using namespace llvm;
@@ -103,12 +101,12 @@
 //===----------------------------------------------------------------------===//
 
 static void LLVMErrorHandler(void *UserData, const std::string &Message) {
-    Diagnostic &Diags = *static_cast<Diagnostic*>(UserData);
+    DiagnosticsEngine &Diags = *static_cast<DiagnosticsEngine*>(UserData);
     
     Diags.Report(diag::err_fe_error_backend) << Message;
     
     // We cannot recover from llvm errors.
-    exit(1);
+    assert(0);
 }
 
 static FrontendAction *CreateFrontendBaseAction(CompilerInstance &CI) {
@@ -132,7 +130,7 @@
         case EmitCodeGenOnly:        return new EmitCodeGenOnlyAction();
         case EmitObj:                return new EmitObjAction();
         case FixIt:                  return new FixItAction();
-        case GeneratePCH:            return new GeneratePCHAction();
+        case GeneratePCH:            return new GeneratePCHAction(false);
         case GeneratePTH:            return new GeneratePTHAction();
         case InitOnly:               return new InitOnlyAction();
         case ParseSyntaxOnly:        return new SyntaxOnlyAction();
@@ -308,11 +306,11 @@
     // 6. Most of this we get from the CompilerInstance, but we 
     // also want to give the context an ExternalASTSource.
     m_selector_table.reset(new SelectorTable());
-    m_builtin_context.reset(new Builtin::Context(m_compiler->getTarget()));
+    m_builtin_context.reset(new Builtin::Context());
     
     std::auto_ptr<clang::ASTContext> ast_context(new ASTContext(m_compiler->getLangOpts(),
                                                                 m_compiler->getSourceManager(),
-                                                                m_compiler->getTarget(),
+                                                                &m_compiler->getTarget(),
                                                                 m_compiler->getPreprocessor().getIdentifierTable(),
                                                                 *m_selector_table.get(),
                                                                 *m_builtin_context.get(),