r310138 - [libclang] Determinize order of platform availability attrs
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 4 14:52:26 PDT 2017
Author: rnk
Date: Fri Aug 4 14:52:25 2017
New Revision: 310138
URL: http://llvm.org/viewvc/llvm-project?rev=310138&view=rev
Log:
[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.
Modified:
cfe/trunk/tools/libclang/CIndex.cpp
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=310138&r1=310137&r2=310138&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Fri Aug 4 14:52:25 2017
@@ -7303,7 +7303,8 @@ static void getCursorPlatformAvailabilit
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(
More information about the cfe-commits
mailing list