diff options
| author | Reid Kleckner <rnk@google.com> | 2017-08-04 21:52:25 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2017-08-04 21:52:25 +0000 |
| commit | e6cde144164255e16640960fb7aaf67a183f8098 (patch) | |
| tree | 20635c8d769d36efa880e25b5a08b91d245d1dbb /clang | |
| parent | cefb3335823f5d2d45898bd5dc635efb464523ea (diff) | |
| download | bcm5719-llvm-e6cde144164255e16640960fb7aaf67a183f8098.tar.gz bcm5719-llvm-e6cde144164255e16640960fb7aaf67a183f8098.zip | |
[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
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/tools/libclang/CIndex.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 1815fdf5bd8..ca21b6c6f68 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -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( |

