diff options
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 05d81eaf0f..f688029fb2 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -487,7 +487,7 @@ public: CGObjCCommonMac(CodeGen::CodeGenModule &cgm) : CGM(cgm) { } - virtual llvm::Constant *GenerateConstantString(const std::string &String); + virtual llvm::Constant *GenerateConstantString(const ObjCStringLiteral *SL); virtual llvm::Function *GenerateMethod(const ObjCMethodDecl *OMD, const ObjCContainerDecl *CD=0); @@ -899,8 +899,13 @@ llvm::Value *CGObjCMac::GetSelector(CGBuilderTy &Builder, Selector Sel) { */ llvm::Constant *CGObjCCommonMac::GenerateConstantString( - const std::string &String) { - return CGM.GetAddrOfConstantCFString(String); + const ObjCStringLiteral *SL) { + std::string Str(SL->getString()->getStrData(), + SL->getString()->getByteLength()); + if (SL->getString()->containsNonAscii()) { + // FIXME: Convert from UTF-8 to UTF-16. + } + return CGM.GetAddrOfConstantCFString(Str); } /// Generates a message send where the super is the receiver. This is |