[cfe-commits] r76897 - /cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Daniel Dunbar
daniel at zuster.org
Thu Jul 23 13:39:25 PDT 2009
Author: ddunbar
Date: Thu Jul 23 15:38:28 2009
New Revision: 76897
URL: http://llvm.org/viewvc/llvm-project?rev=76897&view=rev
Log:
Simplify, NFC.
Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=76897&r1=76896&r2=76897&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Thu Jul 23 15:38:28 2009
@@ -1215,16 +1215,15 @@
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];
More information about the cfe-commits
mailing list