aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGObjC.cpp3
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp2
-rw-r--r--lib/CodeGen/CGObjCRuntime.h5
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 1beaf103db..e9d20640b7 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -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());
}
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 9cbb0ed49c..565167dc6f 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -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,
diff --git a/lib/CodeGen/CGObjCRuntime.h b/lib/CodeGen/CGObjCRuntime.h
index a000dd9e24..07d8962096 100644
--- a/lib/CodeGen/CGObjCRuntime.h
+++ b/lib/CodeGen/CGObjCRuntime.h
@@ -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,