From 8d4141f83d9de379547cf05bd75d4c6cf894b189 Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Wed, 1 Apr 2009 13:55:36 +0000 Subject: More "prep" work for handling UTF16 CFString. Patch by Jean-Daniel Dupas. Thanks! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68203 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 101b2e58b7..d428c836af 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1002,7 +1002,11 @@ static void appendFieldAndPadding(CodeGenModule &CGM, // We still need to work out the details of handling UTF-16. // See: llvm::Constant *CodeGenModule:: -GetAddrOfConstantCFString(const std::string &str) { +GetAddrOfConstantCFString(const StringLiteral *Literal) { + // if (Literal->containsNonAsciiOrNull()) { + // // FIXME: Convert from UTF-8 to UTF-16. + // } + std::string str(Literal->getStrData(), Literal->getByteLength()); llvm::StringMapEntry &Entry = CFConstantStringMap.GetOrCreateValue(&str[0], &str[str.length()]); -- cgit v1.2.3-70-g09d2