Rework this code so that it does not trigger a compiler warning. NFC

llvm-svn: 219964
This commit is contained in:
Enrico Granata 2014-10-16 21:18:58 +00:00
parent 8393406f05
commit 8d9c2da2d1
1 changed files with 3 additions and 9 deletions

View File

@ -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)