From e14b368fa9d65a75e4c080acc9cc9aa56f657e1a 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! llvm-svn: 68203 --- clang/lib/CodeGen/CodeGenModule.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 101b2e58b7f..d428c836afb 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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