mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-10-08 03:13:58 +00:00
[clang-modernize] Update for API change.
NFC. llvm-svn: 219063
This commit is contained in:
parent
07935294be
commit
d12555795e
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user