diff options
author | Seth Cantrell <seth.cantrell@gmail.com> | 2012-10-30 06:13:52 +0000 |
---|---|---|
committer | Seth Cantrell <seth.cantrell@gmail.com> | 2012-10-30 06:13:52 +0000 |
commit | ee2effd26447ce448c69b69735e8d25be1741c20 (patch) | |
tree | d7f06c3d26d32e7c3e9cda4b3e9ccf0a21bcd6fe | |
parent | 293941687131f3939929daa4ae2c10df37a1539a (diff) | |
download | bcm5719-llvm-ee2effd26447ce448c69b69735e8d25be1741c20.tar.gz bcm5719-llvm-ee2effd26447ce448c69b69735e8d25be1741c20.zip |
remove duplicate data array
llvm-svn: 167007
-rw-r--r-- | clang/lib/Frontend/TextDiagnostic.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp index bbd96b91f59..a421f9ac34c 100644 --- a/clang/lib/Frontend/TextDiagnostic.cpp +++ b/clang/lib/Frontend/TextDiagnostic.cpp @@ -113,18 +113,6 @@ printableTextForNextCharacter(StringRef SourceLine, size_t *i, return std::make_pair(expandedTab, true); } - // FIXME: this data is copied from the private implementation of ConvertUTF.h - static const char trailingBytesForUTF8[256] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 - }; - unsigned char const *begin, *end; begin = reinterpret_cast<unsigned char const *>(&*(SourceLine.begin() + *i)); end = begin + (SourceLine.size() - *i); @@ -133,8 +121,7 @@ printableTextForNextCharacter(StringRef SourceLine, size_t *i, UTF32 c; UTF32 *cptr = &c; unsigned char const *original_begin = begin; - char trailingBytes = trailingBytesForUTF8[(unsigned char)SourceLine[*i]]; - unsigned char const *cp_end = begin+trailingBytes+1; + unsigned char const *cp_end = begin+getNumBytesForUTF8(SourceLine[*i]); ConversionResult res = ConvertUTF8toUTF32(&begin, cp_end, &cptr, cptr+1, strictConversion); |