[cfe-commits] r83597 - in /cfe/trunk: lib/Sema/SemaCodeComplete.cpp test/CodeCompletion/property.m

Steve Naroff snaroff at apple.com
Thu Oct 8 16:45:11 PDT 2009


Author: snaroff
Date: Thu Oct  8 18:45:10 2009
New Revision: 83597

URL: http://llvm.org/viewvc/llvm-project?rev=83597&view=rev
Log:
- Fixup SortCodeCompleteResult() to properly sort keywords on Mac OS (compare was system dependent). Worked on Linux, failed on Mac OS (which caused the recently added testcase to fail on Linux). 
- Sort results in testcase.


Modified:
    cfe/trunk/lib/Sema/SemaCodeComplete.cpp
    cfe/trunk/test/CodeCompletion/property.m

Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=83597&r1=83596&r2=83597&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Thu Oct  8 18:45:10 2009
@@ -986,7 +986,7 @@
                                           Y.Declaration->getDeclName());
           
         case Result::RK_Keyword:
-          return strcmp(X.Keyword, Y.Keyword) == -1;
+          return strcmp(X.Keyword, Y.Keyword) < 0;
       }
       
       // Silence GCC warning.

Modified: cfe/trunk/test/CodeCompletion/property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeCompletion/property.m?rev=83597&r1=83596&r2=83597&view=diff

==============================================================================
--- cfe/trunk/test/CodeCompletion/property.m (original)
+++ cfe/trunk/test/CodeCompletion/property.m Thu Oct  8 18:45:10 2009
@@ -7,22 +7,22 @@
 @property(copy) Foo *myprop;
 @property(retain, nonatomic) id xx;
 // RUN: clang-cc -fsyntax-only -code-completion-at=%s:7:11 %s -o - | FileCheck -check-prefix=CC1 %s &&
-// CC1: readonly
-// CC1-NEXT: assign
-// CC1-NEXT: readwrite
-// CC1-NEXT: retain
+// CC1: assign
 // CC1-NEXT: copy
+// CC1-NEXT: getter
 // CC1-NEXT: nonatomic
+// CC1-NEXT: readonly
+// CC1-NEXT: readwrite
+// CC1-NEXT: retain
 // CC1-NEXT: setter
-// CC1-NEXT: getter
 // RUN: clang-cc -fsyntax-only -code-completion-at=%s:8:18 %s -o - | FileCheck -check-prefix=CC2 %s
-// CC2: readonly
-// CC2-NEXT: assign
-// CC2-NEXT: readwrite
+// CC2: assign
 // CC2-NEXT: copy
+// CC2-NEXT: getter
 // CC2-NEXT: nonatomic
+// CC2-NEXT: readonly
+// CC2-NEXT: readwrite
 // CC2-NEXT: setter
-// CC2-NEXT: getter
 @end
 
 





More information about the cfe-commits mailing list