summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2014-10-16 21:18:58 +0000
committerEnrico Granata <egranata@apple.com>2014-10-16 21:18:58 +0000
commit8d9c2da2d1c8870079fec93b9e5922011890a841 (patch)
tree941684e56717aea157eaabe7b65b9a992dd9fe84 /lldb/source/DataFormatters
parent8393406f05b42a31dcf1e486b09e8f9d39564ec8 (diff)
downloadbcm5719-llvm-8d9c2da2d1c8870079fec93b9e5922011890a841.tar.gz
bcm5719-llvm-8d9c2da2d1c8870079fec93b9e5922011890a841.zip
Rework this code so that it does not trigger a compiler warning. NFC
llvm-svn: 219964
Diffstat (limited to 'lldb/source/DataFormatters')
-rw-r--r--lldb/source/DataFormatters/NSDictionary.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/lldb/source/DataFormatters/NSDictionary.cpp b/lldb/source/DataFormatters/NSDictionary.cpp
index ddd1e2e7ca9..da05c7bf941 100644
--- a/lldb/source/DataFormatters/NSDictionary.cpp
+++ b/lldb/source/DataFormatters/NSDictionary.cpp
@@ -47,18 +47,12 @@ GetLLDBNSPairType (TargetSP target_sp)
clang::DeclContext::lookup_const_result result = ast->getTranslationUnitDecl()->lookup(myName);
- for (clang::NamedDecl *named_decl : result)
+ if (!result.empty())
{
+ clang::NamedDecl *named_decl = result[0];
if (const clang::CXXRecordDecl *record_decl = llvm::dyn_cast<clang::CXXRecordDecl>(named_decl))
- {
clang_type.SetClangType(ast, clang::QualType(record_decl->getTypeForDecl(), 0));
- break;
- }
- else
- {
- // somebody else (the user?) has defined a type with the magic name already - fail!!!
- return clang_type;
- }
+ return clang_type;
}
if (!clang_type)
OpenPOWER on IntegriCloud