[cfe-commits] r116574 - /cfe/trunk/lib/Sema/SemaLookup.cpp
Douglas Gregor
dgregor at apple.com
Fri Oct 15 06:35:25 PDT 2010
Author: dgregor
Date: Fri Oct 15 08:35:25 2010
New Revision: 116574
URL: http://llvm.org/viewvc/llvm-project?rev=116574&view=rev
Log:
When we're in the context of an Objective-C message send's receiver,
typo correction prefers "super" over other, equivalent completions. I
believe this will fix the regression on the buildbot.
Modified:
cfe/trunk/lib/Sema/SemaLookup.cpp
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=116574&r1=116573&r2=116574&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Fri Oct 15 08:35:25 2010
@@ -2704,6 +2704,10 @@
unsigned size() const { return BestResults.size(); }
bool empty() const { return BestResults.empty(); }
+ bool &operator[](llvm::StringRef Name) {
+ return BestResults[Name];
+ }
+
unsigned getBestEditDistance() const { return BestEditDistance; }
};
@@ -3119,7 +3123,15 @@
// If only a single name remains, return that result.
if (Consumer.size() == 1)
return &Context.Idents.get(Consumer.begin()->getKey());
-
+ else if (Consumer.size() > 1 && CTC == CTC_ObjCMessageReceiver
+ && Consumer["super"]) {
+ // Prefix 'super' when we're completing in a message-receiver
+ // context.
+ Res.suppressDiagnostics();
+ Res.clear();
+ return &Context.Idents.get("super");
+ }
+
Res.suppressDiagnostics();
Res.setLookupName(Typo);
Res.clear();
More information about the cfe-commits
mailing list