aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/MinimalAction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Parse/MinimalAction.cpp')
-rw-r--r--lib/Parse/MinimalAction.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/Parse/MinimalAction.cpp b/lib/Parse/MinimalAction.cpp
index fc06a0d6a5..5a03767811 100644
--- a/lib/Parse/MinimalAction.cpp
+++ b/lib/Parse/MinimalAction.cpp
@@ -27,15 +27,30 @@ ActionBase::~ActionBase() {}
Action::~Action() {}
Action::ObjCMessageKind Action::getObjCMessageKind(Scope *S,
- IdentifierInfo *&Name,
+ IdentifierInfo *Name,
SourceLocation NameLoc,
bool IsSuper,
- bool HasTrailingDot) {
+ bool HasTrailingDot,
+ TypeTy *&ReceiverType) {
+ ReceiverType = 0;
+
if (IsSuper && !HasTrailingDot && S->isInObjcMethodScope())
return ObjCSuperMessage;
- if (getTypeName(*Name, NameLoc, S))
+ if (TypeTy *TyName = getTypeName(*Name, NameLoc, S)) {
+ DeclSpec DS;
+ const char *PrevSpec = 0;
+ unsigned DiagID = 0;
+ if (!DS.SetTypeSpecType(DeclSpec::TST_typename, NameLoc, PrevSpec,
+ DiagID, TyName)) {
+ DS.SetRangeEnd(NameLoc);
+ Declarator DeclaratorInfo(DS, Declarator::TypeNameContext);
+ TypeResult Ty = ActOnTypeName(S, DeclaratorInfo);
+ if (!Ty.isInvalid())
+ ReceiverType = Ty.get();
+ }
return ObjCClassMessage;
+ }
return ObjCInstanceMessage;
}