[Lldb-commits] [lldb] r170927 - in /lldb/trunk/source: Expression/ClangASTSource.cpp Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp Symbol/ClangASTContext.cpp Symbol/ClangASTType.cpp
Sean Callanan
scallanan at apple.com
Fri Dec 21 13:34:42 PST 2012
Author: spyffe
Date: Fri Dec 21 15:34:42 2012
New Revision: 170927
URL: http://llvm.org/viewvc/llvm-project?rev=170927&view=rev
Log:
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.
Modified:
lldb/trunk/source/Expression/ClangASTSource.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp
lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/ClangASTType.cpp
Modified: lldb/trunk/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangASTSource.cpp?rev=170927&r1=170926&r2=170927&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangASTSource.cpp (original)
+++ lldb/trunk/source/Expression/ClangASTSource.cpp Fri Dec 21 15:34:42 2012
@@ -854,13 +854,13 @@
ObjCInterfaceDecl::lookup_result result = original_interface_decl->lookup(original_decl_name);
- if (result.first == result.second)
+ if (result.empty())
return false;
- if (!*result.first)
+ if (!result[0])
return false;
- ObjCMethodDecl *result_method = dyn_cast<ObjCMethodDecl>(*result.first);
+ ObjCMethodDecl *result_method = dyn_cast<ObjCMethodDecl>(result[0]);
if (!result_method)
return false;
@@ -1806,10 +1806,8 @@
void
NameSearchContext::AddLookupResult (clang::DeclContextLookupConstResult result)
{
- for (clang::NamedDecl * const *decl_iterator = result.first;
- decl_iterator != result.second;
- ++decl_iterator)
- m_decls.push_back (*decl_iterator);
+ for (clang::NamedDecl *decl : result)
+ m_decls.push_back (decl);
}
void
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp?rev=170927&r1=170926&r2=170927&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp Fri Dec 21 15:34:42 2012
@@ -616,9 +616,9 @@
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);
Modified: lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp?rev=170927&r1=170926&r2=170927&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp Fri Dec 21 15:34:42 2012
@@ -9,8 +9,6 @@
#include "UnwindAssemblyInstEmulation.h"
-#include "llvm-c/EnhancedDisassembly.h"
-
#include "lldb/Core/Address.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Core/DataBufferHeap.h"
Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=170927&r1=170926&r2=170927&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Dec 21 15:34:42 2012
@@ -1277,9 +1277,10 @@
DeclarationName decl_name (&identifier_info);
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)
return class_template_decl;
}
@@ -4564,12 +4565,9 @@
parent_record_decl = cast<RecordDecl>(elem.Base->getType()->getAs<RecordType>()->getDecl());
}
}
- DeclContext::lookup_iterator named_decl_pos;
- for (named_decl_pos = path->Decls.first;
- named_decl_pos != path->Decls.second && parent_record_decl;
- ++named_decl_pos)
+ for (NamedDecl *path_decl : path->Decls)
{
- 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)
{
child_indexes.clear();
@@ -5073,9 +5071,9 @@
IdentifierInfo &identifier_info = ast->Idents.get(name);
DeclarationName decl_name (&identifier_info);
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)
return namespace_decl;
}
Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=170927&r1=170926&r2=170927&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Fri Dec 21 15:34:42 2012
@@ -1283,7 +1283,6 @@
if (class_interface_decl)
{
clang::PrintingPolicy policy = ast_context->getPrintingPolicy();
- policy.DumpSourceManager = &ast_context->getSourceManager();
class_interface_decl->print(llvm_ostrm, policy, s->GetIndentLevel());
}
}
More information about the lldb-commits
mailing list