[libclang] Determinize order of platform availability attrs

Previously this code was doing std::sort on IdentifierInfo pointers. Now
it sorts alphabetically by platform name.

This should de-flake clang/test/Index/availability.c, which was failing
non-deterministically for me.

llvm-svn: 310138
This commit is contained in:
Reid Kleckner 2017-08-04 21:52:25 +00:00
parent cefb333582
commit e6cde14416
1 changed files with 2 additions and 1 deletions

View File

@ -7303,7 +7303,8 @@ static void getCursorPlatformAvailabilityForDecl(
std::sort(AvailabilityAttrs.begin(), AvailabilityAttrs.end(),
[](AvailabilityAttr *LHS, AvailabilityAttr *RHS) {
return LHS->getPlatform() > RHS->getPlatform();
return LHS->getPlatform()->getName() <
RHS->getPlatform()->getName();
});
ASTContext &Ctx = D->getASTContext();
auto It = std::unique(