More "prep" work for handling UTF16 CFString.

Patch by Jean-Daniel Dupas. Thanks!

llvm-svn: 68203
This commit is contained in:
Steve Naroff
2009-04-01 13:55:36 +00:00
parent c94adda157
commit e14b368fa9
5 changed files with 10 additions and 12 deletions

View File

@@ -1002,7 +1002,11 @@ static void appendFieldAndPadding(CodeGenModule &CGM,
// We still need to work out the details of handling UTF-16.
// See: <rdr://2996215>
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<llvm::Constant *> &Entry =
CFConstantStringMap.GetOrCreateValue(&str[0], &str[str.length()]);