use cheaper/simpler getselector call for @selector exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52759 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-06-26 04:38:58 +00:00
Родитель 8e67b63530
Коммит 42ba3e7ba1
3 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -33,8 +33,7 @@ llvm::Value *CodeGenFunction::EmitObjCSelectorExpr(const ObjCSelectorExpr *E) {
// 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());
}

Просмотреть файл

@ -118,10 +118,10 @@ public:
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,

Просмотреть файл

@ -53,12 +53,13 @@ public:
/// 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,