summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-04-01 13:55:36 +0000
committerSteve Naroff <snaroff@apple.com>2009-04-01 13:55:36 +0000
commite14b368fa9d65a75e4c080acc9cc9aa56f657e1a (patch)
tree3bdc074003083dac29c2230a18f0ba9738a70f86 /clang/lib/CodeGen/CodeGenModule.cpp
parentc94adda1574e781d12f1d04fbfdec51f4299653c (diff)
downloadbcm5719-llvm-e14b368fa9d65a75e4c080acc9cc9aa56f657e1a.tar.gz
bcm5719-llvm-e14b368fa9d65a75e4c080acc9cc9aa56f657e1a.zip
More "prep" work for handling UTF16 CFString.
Patch by Jean-Daniel Dupas. Thanks! llvm-svn: 68203
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp6
1 files changed, 5 insertions, 1 deletions
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: <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()]);
OpenPOWER on IntegriCloud