aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/MinimalAction.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-14 02:22:16 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-14 02:22:16 +0000
commit1dbca6ea983231b4cab1a8f1edda8f6e13c21f12 (patch)
treec5435bd2736db69b010bf3b073e36f94466a6f60 /lib/Parse/MinimalAction.cpp
parentf19de1ce44b9c7ffdeb388d6fe2fa8a1d0288f64 (diff)
Introduce a parsing action to distinguish between class, instance, and
super message sends in Objective-C. No actual functionality change here, but it provides a hook so that Sema can typo-correct the receiver in some cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101207 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/MinimalAction.cpp')
-rw-r--r--lib/Parse/MinimalAction.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Parse/MinimalAction.cpp b/lib/Parse/MinimalAction.cpp
index e75569231c..fc06a0d6a5 100644
--- a/lib/Parse/MinimalAction.cpp
+++ b/lib/Parse/MinimalAction.cpp
@@ -26,6 +26,20 @@ ActionBase::~ActionBase() {}
/// Out-of-line virtual destructor to provide home for Action class.
Action::~Action() {}
+Action::ObjCMessageKind Action::getObjCMessageKind(Scope *S,
+ IdentifierInfo *&Name,
+ SourceLocation NameLoc,
+ bool IsSuper,
+ bool HasTrailingDot) {
+ if (IsSuper && !HasTrailingDot && S->isInObjcMethodScope())
+ return ObjCSuperMessage;
+
+ if (getTypeName(*Name, NameLoc, S))
+ return ObjCClassMessage;
+
+ return ObjCInstanceMessage;
+}
+
// Defined out-of-line here because of dependecy on AttributeList
Action::DeclPtrTy Action::ActOnUsingDirective(Scope *CurScope,
SourceLocation UsingLoc,