Switch a few clients over to StringLiteral::getString.
- Switching all of them out-of-my-current-scope-of-interest, sorry. llvm-svn: 82515
This commit is contained in:
@@ -1310,14 +1310,11 @@ GetConstantCFStringEntry(llvm::StringMap<llvm::Constant*> &Map,
|
||||
bool TargetIsLSB,
|
||||
bool &IsUTF16,
|
||||
unsigned &StringLength) {
|
||||
unsigned NumBytes = Literal->getByteLength();
|
||||
|
||||
// Check for simple case.
|
||||
if (!Literal->containsNonAsciiOrNull()) {
|
||||
StringLength = NumBytes;
|
||||
return Map.GetOrCreateValue(llvm::StringRef(Literal->getStrData(),
|
||||
StringLength));
|
||||
}
|
||||
if (!Literal->containsNonAsciiOrNull())
|
||||
return Map.GetOrCreateValue(Literal->getString());
|
||||
|
||||
unsigned NumBytes = Literal->getByteLength();
|
||||
|
||||
// Otherwise, convert the UTF8 literals into a byte string.
|
||||
llvm::SmallVector<UTF16, 128> ToBuf(NumBytes);
|
||||
@@ -1333,9 +1330,7 @@ GetConstantCFStringEntry(llvm::StringMap<llvm::Constant*> &Map,
|
||||
// FIXME: Have Sema::CheckObjCString() validate the UTF-8 string and remove
|
||||
// this duplicate code.
|
||||
assert(Result == sourceIllegal && "UTF-8 to UTF-16 conversion failed");
|
||||
StringLength = NumBytes;
|
||||
return Map.GetOrCreateValue(llvm::StringRef(Literal->getStrData(),
|
||||
StringLength));
|
||||
return Map.GetOrCreateValue(Literal->getString());
|
||||
}
|
||||
|
||||
// ConvertUTF8toUTF16 returns the length in ToPtr.
|
||||
|
||||
Reference in New Issue
Block a user