aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-23 20:38:28 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-23 20:38:28 +0000
commitec586e7b10394aeed25c8e5ee02d230951826136 (patch)
treeb886a338ab12054057db86911e017ea0bf98d433 /lib/CodeGen/CodeGenModule.cpp
parentdfaf4b3ac898bc40d928af693990769e98738793 (diff)
Simplify, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76897 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 4321765607..c417cf8ec9 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -1215,16 +1215,15 @@ GetAddrOfConstantCFString(const StringLiteral *Literal) {
StringLength = ToPtr-&ToBuf[0];
str.assign((char *)&ToBuf[0], StringLength*2);// Twice as many UTF8 chars.
isUTF16 = true;
- } else if (Result == sourceIllegal) {
+ } else {
+ assert(Result == sourceIllegal && "UTF-8 to UTF-16 conversion failed");
// FIXME: Have Sema::CheckObjCString() validate the UTF-8 string.
- str.assign(Literal->getStrData(), Literal->getByteLength());
- StringLength = str.length();
- } else
- assert(Result == conversionOK && "UTF-8 to UTF-16 conversion failed");
-
+ StringLength = Literal->getByteLength();
+ str.assign(Literal->getStrData(), StringLength);
+ }
} else {
- str.assign(Literal->getStrData(), Literal->getByteLength());
- StringLength = str.length();
+ StringLength = Literal->getByteLength();
+ str.assign(Literal->getStrData(), StringLength);
}
llvm::Constant *&Entry = CFConstantStringMap[str];