summaryrefslogtreecommitdiffstats
path: root/clang/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
commita3a37ae8c8b862e087f3795edd856377b60971fd (patch)
tree6c6fb78b90d1498c716beaee20d16c3ee105480f /clang/lib/Sema/SemaExprObjC.cpp
parenta2509a1a485008037b6c73f72f82ab8532e4046d (diff)
downloadbcm5719-llvm-a3a37ae8c8b862e087f3795edd856377b60971fd.tar.gz
bcm5719-llvm-a3a37ae8c8b862e087f3795edd856377b60971fd.zip
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.
llvm-svn: 52676
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaExprObjC.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index 1aed69ec2c5..c33efbd743f 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud