[PATCH] D33478: [libclang] When getting platform availabilities, merge multiple declarations if possible

Ronald Wampler via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 7 17:39:16 PDT 2017


rdwampler marked an inline comment as done.
rdwampler added inline comments.


================
Comment at: test/Index/availability.c:20
 // CHECK-2: (macos, introduced=10.4, deprecated=10.5, obsoleted=10.7)
 
 // CHECK-2: EnumConstantDecl=old_enum:6:3 (Definition) (deprecated)
----------------
Can we run `FileCheck` once now? I believe the `CHECK-1` and `CHECK-2` were added since there were no particular order for the availabilities. With this patch the order is guarantee to be stable.


================
Comment at: tools/libclang/CIndex.cpp:7268
+            (!LHS->getObsoleted().empty() && !RHS->getObsoleted().empty()) ||
+            (!LHS->getMessage().empty() && !RHS->getMessage().empty()))
+          return false;
----------------
arphaman wrote:
> I think that we don't really need the `(!LHS->getMessage().empty() && !RHS->getMessage().empty())` check here since message has to be either in a deprecated or obsoleted clause, so we should already handle that with previous checks.
Agreed.


https://reviews.llvm.org/D33478





More information about the cfe-commits mailing list