forked from OSchip/llvm-project
				
			Made LLDB compile with LLVM top-of-tree again.
The results from Clang name lookups changed to be ArrayRefs, so I had to change the way we check for the presence of a result and the way we iterate across results. llvm-svn: 170927
This commit is contained in:
		
							parent
							
								
									bab7cc405d
								
							
						
					
					
						commit
						5deaa4c902
					
				| 
						 | 
					@ -854,13 +854,13 @@ FindObjCMethodDeclsWithOrigin (unsigned int current_id,
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    ObjCInterfaceDecl::lookup_result result = original_interface_decl->lookup(original_decl_name);
 | 
					    ObjCInterfaceDecl::lookup_result result = original_interface_decl->lookup(original_decl_name);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (result.first == result.second)
 | 
					    if (result.empty())
 | 
				
			||||||
        return false;
 | 
					        return false;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (!*result.first)
 | 
					    if (!result[0])
 | 
				
			||||||
        return false;
 | 
					        return false;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    ObjCMethodDecl *result_method = dyn_cast<ObjCMethodDecl>(*result.first);
 | 
					    ObjCMethodDecl *result_method = dyn_cast<ObjCMethodDecl>(result[0]);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (!result_method)
 | 
					    if (!result_method)
 | 
				
			||||||
        return false;
 | 
					        return false;
 | 
				
			||||||
| 
						 | 
					@ -1806,10 +1806,8 @@ NameSearchContext::AddTypeDecl(void *type)
 | 
				
			||||||
void 
 | 
					void 
 | 
				
			||||||
NameSearchContext::AddLookupResult (clang::DeclContextLookupConstResult result)
 | 
					NameSearchContext::AddLookupResult (clang::DeclContextLookupConstResult result)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    for (clang::NamedDecl * const *decl_iterator = result.first;
 | 
					    for (clang::NamedDecl *decl : result)
 | 
				
			||||||
         decl_iterator != result.second;
 | 
					        m_decls.push_back (decl);
 | 
				
			||||||
         ++decl_iterator)
 | 
					 | 
				
			||||||
        m_decls.push_back (*decl_iterator);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -616,9 +616,9 @@ AppleObjCTypeVendor::FindTypes (const ConstString &name,
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        clang::DeclContext::lookup_const_result lookup_result = ast_ctx->getTranslationUnitDecl()->lookup(decl_name);
 | 
					        clang::DeclContext::lookup_const_result lookup_result = ast_ctx->getTranslationUnitDecl()->lookup(decl_name);
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        if (lookup_result.first != lookup_result.second)
 | 
					        if (!lookup_result.empty())
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (const clang::ObjCInterfaceDecl *result_iface_decl = llvm::dyn_cast<clang::ObjCInterfaceDecl>(*lookup_result.first))
 | 
					            if (const clang::ObjCInterfaceDecl *result_iface_decl = llvm::dyn_cast<clang::ObjCInterfaceDecl>(lookup_result[0]))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                clang::QualType result_iface_type = ast_ctx->getObjCInterfaceType(result_iface_decl);
 | 
					                clang::QualType result_iface_type = ast_ctx->getObjCInterfaceType(result_iface_decl);
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,8 +9,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "UnwindAssemblyInstEmulation.h"
 | 
					#include "UnwindAssemblyInstEmulation.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "llvm-c/EnhancedDisassembly.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "lldb/Core/Address.h"
 | 
					#include "lldb/Core/Address.h"
 | 
				
			||||||
#include "lldb/Core/ArchSpec.h"
 | 
					#include "lldb/Core/ArchSpec.h"
 | 
				
			||||||
#include "lldb/Core/DataBufferHeap.h"
 | 
					#include "lldb/Core/DataBufferHeap.h"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1277,9 +1277,10 @@ ClangASTContext::CreateClassTemplateDecl (DeclContext *decl_ctx,
 | 
				
			||||||
    DeclarationName decl_name (&identifier_info);
 | 
					    DeclarationName decl_name (&identifier_info);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    clang::DeclContext::lookup_result result = decl_ctx->lookup(decl_name);
 | 
					    clang::DeclContext::lookup_result result = decl_ctx->lookup(decl_name);
 | 
				
			||||||
    for (clang::DeclContext::lookup_iterator pos = result.first, end = result.second; pos != end; ++pos) 
 | 
					    
 | 
				
			||||||
 | 
					    for (NamedDecl *decl : result)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        class_template_decl = dyn_cast<clang::ClassTemplateDecl>(*pos);
 | 
					        class_template_decl = dyn_cast<clang::ClassTemplateDecl>(decl);
 | 
				
			||||||
        if (class_template_decl)
 | 
					        if (class_template_decl)
 | 
				
			||||||
            return class_template_decl;
 | 
					            return class_template_decl;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -4564,12 +4565,9 @@ ClangASTContext::GetIndexOfChildMemberWithName
 | 
				
			||||||
                                    parent_record_decl = cast<RecordDecl>(elem.Base->getType()->getAs<RecordType>()->getDecl());
 | 
					                                    parent_record_decl = cast<RecordDecl>(elem.Base->getType()->getAs<RecordType>()->getDecl());
 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            DeclContext::lookup_iterator named_decl_pos;
 | 
					                            for (NamedDecl *path_decl : path->Decls)
 | 
				
			||||||
                            for (named_decl_pos = path->Decls.first;
 | 
					 | 
				
			||||||
                                 named_decl_pos != path->Decls.second && parent_record_decl;
 | 
					 | 
				
			||||||
                                 ++named_decl_pos)
 | 
					 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                child_idx = GetIndexForRecordChild (parent_record_decl, *named_decl_pos, omit_empty_base_classes);
 | 
					                                child_idx = GetIndexForRecordChild (parent_record_decl, path_decl, omit_empty_base_classes);
 | 
				
			||||||
                                if (child_idx == UINT32_MAX)
 | 
					                                if (child_idx == UINT32_MAX)
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
                                    child_indexes.clear();
 | 
					                                    child_indexes.clear();
 | 
				
			||||||
| 
						 | 
					@ -5073,9 +5071,9 @@ ClangASTContext::GetUniqueNamespaceDeclaration (const char *name, DeclContext *d
 | 
				
			||||||
        IdentifierInfo &identifier_info = ast->Idents.get(name);
 | 
					        IdentifierInfo &identifier_info = ast->Idents.get(name);
 | 
				
			||||||
        DeclarationName decl_name (&identifier_info);
 | 
					        DeclarationName decl_name (&identifier_info);
 | 
				
			||||||
        clang::DeclContext::lookup_result result = decl_ctx->lookup(decl_name);
 | 
					        clang::DeclContext::lookup_result result = decl_ctx->lookup(decl_name);
 | 
				
			||||||
        for (clang::DeclContext::lookup_iterator pos = result.first, end = result.second; pos != end; ++pos) 
 | 
					        for (NamedDecl *decl : result)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            namespace_decl = dyn_cast<clang::NamespaceDecl>(*pos);
 | 
					            namespace_decl = dyn_cast<clang::NamespaceDecl>(decl);
 | 
				
			||||||
            if (namespace_decl)
 | 
					            if (namespace_decl)
 | 
				
			||||||
                return namespace_decl;
 | 
					                return namespace_decl;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1283,7 +1283,6 @@ ClangASTType::DumpTypeDescription (clang::ASTContext *ast_context, clang_type_t
 | 
				
			||||||
                    if (class_interface_decl)
 | 
					                    if (class_interface_decl)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        clang::PrintingPolicy policy = ast_context->getPrintingPolicy();
 | 
					                        clang::PrintingPolicy policy = ast_context->getPrintingPolicy();
 | 
				
			||||||
                        policy.DumpSourceManager = &ast_context->getSourceManager();
 | 
					 | 
				
			||||||
                        class_interface_decl->print(llvm_ostrm, policy, s->GetIndentLevel());
 | 
					                        class_interface_decl->print(llvm_ostrm, policy, s->GetIndentLevel());
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue