[clang-modernize] Update for API change.

NFC.

llvm-svn: 219063
This commit is contained in:
Benjamin Kramer 2014-10-04 17:19:03 +00:00
parent 07935294be
commit d12555795e

View File

@ -383,27 +383,27 @@ private:
assert(MacroLoc.isFileID());
do {
ASTContext::ParentVector Parents = Context.getParents(Start);
const auto &Parents = Context.getParents(Start);
if (Parents.empty())
return false;
assert(Parents.size() == 1 &&
"Found an ancestor with more than one parent!");
ASTContext::ParentVector::const_iterator I = Parents.begin();
const ast_type_traits::DynTypedNode &Parent = Parents[0];
SourceLocation Loc;
if (const Decl *D = I->get<Decl>())
if (const Decl *D = Parent.get<Decl>())
Loc = D->getLocStart();
else if (const Stmt *S = I->get<Stmt>())
else if (const Stmt *S = Parent.get<Stmt>())
Loc = S->getLocStart();
else
llvm_unreachable("Expected to find Decl or Stmt containing ancestor");
if (!expandsFrom(Loc, MacroLoc)) {
Result = *I;
Result = Parent;
return true;
}
Start = *I;
Start = Parent;
} while (1);
llvm_unreachable("findContainingAncestor");