[cfe-commits] r52759 - in /cfe/trunk/lib/CodeGen: CGObjC.cpp CGObjCGNU.cpp CGObjCRuntime.h
Chris Lattner
sabre at nondot.org
Wed Jun 25 21:38:58 PDT 2008
Author: lattner
Date: Wed Jun 25 23:38:58 2008
New Revision: 52759
URL: http://llvm.org/viewvc/llvm-project?rev=52759&view=rev
Log:
use cheaper/simpler getselector call for @selector exprs.
Modified:
cfe/trunk/lib/CodeGen/CGObjC.cpp
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
cfe/trunk/lib/CodeGen/CGObjCRuntime.h
Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=52759&r1=52758&r2=52759&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Wed Jun 25 23:38:58 2008
@@ -33,8 +33,7 @@
// Note that this implementation allows for non-constant strings to be passed
// as arguments to @selector(). Currently, the only thing preventing this
// behaviour is the type checking in the front end.
- return CGM.getObjCRuntime()->GetSelector(Builder,
- CGM.GetAddrOfConstantString(E->getSelector().getName()), 0);
+ return CGM.getObjCRuntime()->GetSelector(Builder, E->getSelector());
}
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=52759&r1=52758&r2=52759&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Wed Jun 25 23:38:58 2008
@@ -118,10 +118,10 @@
unsigned ArgC);
virtual llvm::Value *LookupClass(llvm::IRBuilder &Builder, llvm::Value
*ClassName);
+ virtual llvm::Value *GetSelector(llvm::IRBuilder &Builder, Selector Sel);
virtual llvm::Value *GetSelector(llvm::IRBuilder &Builder,
llvm::Value *SelName,
llvm::Value *SelTypes);
- llvm::Value *GetSelector(llvm::IRBuilder &Builder, Selector Sel);
virtual llvm::Function *MethodPreamble(
const std::string &ClassName,
Modified: cfe/trunk/lib/CodeGen/CGObjCRuntime.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCRuntime.h?rev=52759&r1=52758&r2=52759&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCRuntime.h (original)
+++ cfe/trunk/lib/CodeGen/CGObjCRuntime.h Wed Jun 25 23:38:58 2008
@@ -53,12 +53,13 @@
/// this compilation unit with the runtime library.
virtual llvm::Function *ModuleInitFunction() =0;
/// Get a selector for the specified name and type values
+ virtual llvm::Value *GetSelector(llvm::IRBuilder &Builder, Selector Sel) = 0;
virtual llvm::Value *GetSelector(llvm::IRBuilder &Builder,
llvm::Value *SelName,
llvm::Value *SelTypes) = 0;
/// Generate a constant string object
- virtual llvm::Constant *GenerateConstantString(const char *String, const size_t
- length) =0;
+ virtual llvm::Constant *GenerateConstantString(const char *String,
+ const size_t Length) = 0;
/// Generate a category. A category contains a list of methods (and
/// accompanying metadata) and a list of protocols.
virtual void GenerateCategory(const char *ClassName, const char *CategoryName,
More information about the cfe-commits
mailing list