diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-07-23 20:38:28 +0000 | 
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-23 20:38:28 +0000 | 
| commit | 2a5b83c7e6c1019cecefed1f5d14280b3b358287 (patch) | |
| tree | d0f1e803118de394c987bea8335481c0225f3281 | |
| parent | 1f3b8c0d162d83c884860a76be8acee982843dfc (diff) | |
| download | bcm5719-llvm-2a5b83c7e6c1019cecefed1f5d14280b3b358287.tar.gz bcm5719-llvm-2a5b83c7e6c1019cecefed1f5d14280b3b358287.zip  | |
Simplify, NFC.
llvm-svn: 76897
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 15 | 
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 43217656076..c417cf8ec93 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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];  | 

