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 /llvm/lib/Support | |
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 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/CMakeLists.txt | 2 | ||||
-rw-r--r-- | llvm/lib/Support/ConvertUTF.cpp (renamed from llvm/lib/Support/ConvertUTF.c) | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt index b188b4cc6cb..9f755450535 100644 --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -40,7 +40,7 @@ add_llvm_library(LLVMSupport COM.cpp CommandLine.cpp Compression.cpp - ConvertUTF.c + ConvertUTF.cpp ConvertUTFWrapper.cpp CrashRecoveryContext.cpp DataExtractor.cpp diff --git a/llvm/lib/Support/ConvertUTF.c b/llvm/lib/Support/ConvertUTF.cpp index 128459a1d54..39fd218d3f0 100644 --- a/llvm/lib/Support/ConvertUTF.c +++ b/llvm/lib/Support/ConvertUTF.cpp @@ -53,6 +53,8 @@ #endif #include <assert.h> +namespace llvm { + static const int halfShift = 10; /* used for shifting by 10 bits */ static const UTF32 halfBase = 0x0010000UL; @@ -62,8 +64,6 @@ static const UTF32 halfMask = 0x3FFUL; #define UNI_SUR_HIGH_END (UTF32)0xDBFF #define UNI_SUR_LOW_START (UTF32)0xDC00 #define UNI_SUR_LOW_END (UTF32)0xDFFF -#define false 0 -#define true 1 /* --------------------------------------------------------------------- */ @@ -706,3 +706,5 @@ ConversionResult ConvertUTF8toUTF32(const UTF8 **sourceStart, similarly unrolled loops. --------------------------------------------------------------------- */ + +} // namespace llvm |