aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-06-24 15:50:53 +0000
committerTed Kremenek <kremenek@apple.com>2008-06-24 15:50:53 +0000
commit4df728e368fa1f65ffc57572fed613dcca5b4fe8 (patch)
tree888b04cf2ccd0fd0f10e9a73e9cdbaf2f6a935f2 /lib/Sema/SemaExprObjC.cpp
parent0d8ac9a8b13609a4881f69ab40e64cbe20929d0a (diff)
ObjCMessageExpr objects that represent messages to class methods now can contain the ObjCInterfaceDecl* of the target class if it was available when the ObjCMessageExpr object was constructed. The original interfaces of the class has been preserved (requiring no functionality changes from clients), but now a "getClasSInfo" method returns both the ObjCInterfaceDecl* and IdentifierInfo* of the target class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r--lib/Sema/SemaExprObjC.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 1aed69ec2c..c33efbd743 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -202,8 +202,16 @@ Sema::ExprResult Sema::ActOnClassMessage(
return true;
}
}
- return new ObjCMessageExpr(receiverName, Sel, returnType, Method,
- lbrac, rbrac, ArgExprs, NumArgs);
+
+ // If we have the ObjCInterfaceDecl* for the class that is receiving
+ // the message, use that to construct the ObjCMessageExpr. Otherwise
+ // pass on the IdentifierInfo* for the class.
+ if (ClassDecl)
+ return new ObjCMessageExpr(ClassDecl, Sel, returnType, Method,
+ lbrac, rbrac, ArgExprs, NumArgs);
+ else
+ return new ObjCMessageExpr(receiverName, Sel, returnType, Method,
+ lbrac, rbrac, ArgExprs, NumArgs);
}
// ActOnInstanceMessage - used for both unary and keyword messages.