diff options
author | Justin Lebar <jlebar@google.com> | 2016-09-30 00:38:45 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-09-30 00:38:45 +0000 |
commit | 9091055efa871d15cc53cd8ad91689ea8cb90ddb (patch) | |
tree | dfb1d97a777083db456f1373c93825cb7581c960 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 951c6b1955326eab68dfb77b874edb3d5f3bbbf0 (diff) | |
download | bcm5719-llvm-9091055efa871d15cc53cd8ad91689ea8cb90ddb.tar.gz bcm5719-llvm-9091055efa871d15cc53cd8ad91689ea8cb90ddb.zip |
Move UTF functions into namespace llvm.
Summary:
This lets people link against LLVM and their own version of the UTF
library.
I determined this only affects llvm, clang, lld, and lldb by running
$ git grep -wl 'UTF[0-9]\+\|\bConvertUTF\bisLegalUTF\|getNumBytesFor' | cut -f 1 -d '/' | sort | uniq
clang
lld
lldb
llvm
Tested with
ninja lldb
ninja check-clang check-llvm check-lld
(ninja check-lldb doesn't complete for me with or without this patch.)
Reviewers: rnk
Subscribers: klimek, beanz, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D24996
llvm-svn: 282822
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 43fa615aa0f..9bf3ae2752f 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3136,13 +3136,12 @@ GetConstantCFStringEntry(llvm::StringMap<llvm::GlobalVariable *> &Map, // Otherwise, convert the UTF8 literals into a string of shorts. IsUTF16 = true; - SmallVector<UTF16, 128> ToBuf(NumBytes + 1); // +1 for ending nulls. - const UTF8 *FromPtr = (const UTF8 *)String.data(); - UTF16 *ToPtr = &ToBuf[0]; + SmallVector<llvm::UTF16, 128> ToBuf(NumBytes + 1); // +1 for ending nulls. + const llvm::UTF8 *FromPtr = (const llvm::UTF8 *)String.data(); + llvm::UTF16 *ToPtr = &ToBuf[0]; - (void)ConvertUTF8toUTF16(&FromPtr, FromPtr + NumBytes, - &ToPtr, ToPtr + NumBytes, - strictConversion); + (void)llvm::ConvertUTF8toUTF16(&FromPtr, FromPtr + NumBytes, &ToPtr, + ToPtr + NumBytes, llvm::strictConversion); // ConvertUTF8toUTF16 returns the length in ToPtr. StringLength = ToPtr - &ToBuf[0]; |