aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-06-26 04:42:20 +0000
committerChris Lattner <sabre@nondot.org>2008-06-26 04:42:20 +0000
commit9384c768e93f270118a30ce96546083a666da284 (patch)
tree774f7bd4d53404fe1356a0da3120e14b03aa021b /lib/CodeGen/CGObjC.cpp
parent42ba3e7ba1d4f3fad4871af77ab68ae3514b8c7e (diff)
avoid a lot of unneeded selector processing work by passing around
selectors instead of Value*'s. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r--lib/CodeGen/CGObjC.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index e9d20640b7..9bf53d9700 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -86,14 +86,9 @@ llvm::Value *CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E) {
}
}
- // Get the selector string
- std::string SelStr = E->getSelector().getName();
- llvm::Constant *Selector = CGM.GetAddrOfConstantString(SelStr);
-
- llvm::Value *SelPtr = Builder.CreateStructGEP(Selector, 0);
if (isSuperMessage) {
- const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(CurFuncDecl);
- assert(OMD && "super is only valid in an Objective-C method");
+ // super is only valid in an Objective-C method
+ const ObjCMethodDecl *OMD = cast<ObjCMethodDecl>(CurFuncDecl);
const char *SuperClass =
OMD->getClassInterface()->getSuperClass()->getName();
return Runtime->GenerateMessageSendSuper(Builder, ConvertType(E->getType()),
@@ -103,7 +98,7 @@ llvm::Value *CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E) {
}
return Runtime->GenerateMessageSend(Builder, ConvertType(E->getType()),
LoadObjCSelf(),
- Receiver, SelPtr,
+ Receiver, E->getSelector(),
&Args[0], Args.size());
}