From bceb904f91e04103dabe383540369b85bd68e423 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 12 Aug 2008 03:55:34 +0000 Subject: [PATCH] Add @selector(...) codegen support. llvm-svn: 54665 --- clang/lib/CodeGen/CGExprScalar.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 2bd39c1bd6b9..decf539f1c8a 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -134,6 +134,7 @@ public: return EmitLoadOfLValue(E); } Value *VisitObjCMessageExpr(ObjCMessageExpr *E); + Value *VisitObjCSelectorExpr(ObjCSelectorExpr *E); Value *VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) { return EmitLoadOfLValue(E);} Value *VisitArraySubscriptExpr(ArraySubscriptExpr *E); Value *VisitShuffleVectorExpr(ShuffleVectorExpr *E); @@ -501,6 +502,10 @@ Value *ScalarExprEmitter::VisitObjCMessageExpr(ObjCMessageExpr *E) { &Args[0], Args.size()); } +Value *ScalarExprEmitter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) { + return Runtime->GetSelector(Builder, E->getSelector()); +} + Value *ScalarExprEmitter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) { // Emit subscript expressions in rvalue context's. For most cases, this just // loads the lvalue formed by the subscript expr. However, we have to be