[PATCH] D40618: [SourceLocations] Use stronger sort predicate to remove non-deterministic ordering

Mandeep Singh Grang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 29 12:02:21 PST 2017


mgrang added inline comments.


================
Comment at: tools/libclang/CIndex.cpp:1028
     SourceLocation L_B = B->getLocStart();
-    assert(L_A.isValid() && L_B.isValid());
-    return SM.isBeforeInTranslationUnit(L_A, L_B);
+    return L_A != L_B ?
+           SM.isBeforeInTranslationUnit(L_A, L_B) :
----------------
Also removed the assert from here since isBeforeInTranslationUnit already has the same assert.


Repository:
  rC Clang

https://reviews.llvm.org/D40618





More information about the cfe-commits mailing list