From a148a1d40e8605efc2ae8a9e711aa72e35a9758c Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 14 Apr 2010 02:22:16 +0000 Subject: 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. llvm-svn: 101207 --- clang/lib/Parse/MinimalAction.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'clang/lib/Parse/MinimalAction.cpp') diff --git a/clang/lib/Parse/MinimalAction.cpp b/clang/lib/Parse/MinimalAction.cpp index e75569231c7..fc06a0d6a52 100644 --- a/clang/lib/Parse/MinimalAction.cpp +++ b/clang/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, -- cgit v1.2.3