diff options
| author | orivej <[email protected]> | 2022-02-10 16:44:49 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:44:49 +0300 | 
| commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
| tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/llvm12/include/llvm/Support/Unicode.h | |
| parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/include/llvm/Support/Unicode.h')
| -rw-r--r-- | contrib/libs/llvm12/include/llvm/Support/Unicode.h | 162 | 
1 files changed, 81 insertions, 81 deletions
| diff --git a/contrib/libs/llvm12/include/llvm/Support/Unicode.h b/contrib/libs/llvm12/include/llvm/Support/Unicode.h index 822c8665c4b..dfc5826d2fe 100644 --- a/contrib/libs/llvm12/include/llvm/Support/Unicode.h +++ b/contrib/libs/llvm12/include/llvm/Support/Unicode.h @@ -1,81 +1,81 @@ -#pragma once - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -//===- llvm/Support/Unicode.h - Unicode character properties  -*- C++ -*-=====// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines functions that allow querying certain properties of Unicode -// characters. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_SUPPORT_UNICODE_H -#define LLVM_SUPPORT_UNICODE_H - -namespace llvm { -class StringRef; - -namespace sys { -namespace unicode { - -enum ColumnWidthErrors { -  ErrorInvalidUTF8 = -2, -  ErrorNonPrintableCharacter = -1 -}; - -/// Determines if a character is likely to be displayed correctly on the -/// terminal. Exact implementation would have to depend on the specific -/// terminal, so we define the semantic that should be suitable for generic case -/// of a terminal capable to output Unicode characters. -/// -/// All characters from the Unicode code point range are considered printable -/// except for: -///   * C0 and C1 control character ranges; -///   * default ignorable code points as per 5.21 of -///     http://www.unicode.org/versions/Unicode6.2.0/UnicodeStandard-6.2.pdf -///     except for U+00AD SOFT HYPHEN, as it's actually displayed on most -///     terminals; -///   * format characters (category = Cf); -///   * surrogates (category = Cs); -///   * unassigned characters (category = Cn). -/// \return true if the character is considered printable. -bool isPrintable(int UCS); - -/// Gets the number of positions the UTF8-encoded \p Text is likely to occupy -/// when output on a terminal ("character width"). This depends on the -/// implementation of the terminal, and there's no standard definition of -/// character width. -/// -/// The implementation defines it in a way that is expected to be compatible -/// with a generic Unicode-capable terminal. -/// -/// \return Character width: -///   * ErrorNonPrintableCharacter (-1) if \p Text contains non-printable -///     characters (as identified by isPrintable); -///   * 0 for each non-spacing and enclosing combining mark; -///   * 2 for each CJK character excluding halfwidth forms; -///   * 1 for each of the remaining characters. -int columnWidthUTF8(StringRef Text); - -/// Fold input unicode character according the Simple unicode case folding -/// rules. -int foldCharSimple(int C); - -} // namespace unicode -} // namespace sys -} // namespace llvm - -#endif - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif +#pragma once  +  +#ifdef __GNUC__  +#pragma GCC diagnostic push  +#pragma GCC diagnostic ignored "-Wunused-parameter"  +#endif  +  +//===- llvm/Support/Unicode.h - Unicode character properties  -*- C++ -*-=====//  +//  +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.  +// See https://llvm.org/LICENSE.txt for license information.  +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception  +//  +//===----------------------------------------------------------------------===//  +//  +// This file defines functions that allow querying certain properties of Unicode  +// characters.  +//  +//===----------------------------------------------------------------------===//  +  +#ifndef LLVM_SUPPORT_UNICODE_H  +#define LLVM_SUPPORT_UNICODE_H  +  +namespace llvm {  +class StringRef;  +  +namespace sys {  +namespace unicode {  +  +enum ColumnWidthErrors {  +  ErrorInvalidUTF8 = -2,  +  ErrorNonPrintableCharacter = -1  +};  +  +/// Determines if a character is likely to be displayed correctly on the  +/// terminal. Exact implementation would have to depend on the specific  +/// terminal, so we define the semantic that should be suitable for generic case  +/// of a terminal capable to output Unicode characters.  +///  +/// All characters from the Unicode code point range are considered printable  +/// except for:  +///   * C0 and C1 control character ranges;  +///   * default ignorable code points as per 5.21 of  +///     http://www.unicode.org/versions/Unicode6.2.0/UnicodeStandard-6.2.pdf  +///     except for U+00AD SOFT HYPHEN, as it's actually displayed on most  +///     terminals;  +///   * format characters (category = Cf);  +///   * surrogates (category = Cs);  +///   * unassigned characters (category = Cn).  +/// \return true if the character is considered printable.  +bool isPrintable(int UCS);  +  +/// Gets the number of positions the UTF8-encoded \p Text is likely to occupy  +/// when output on a terminal ("character width"). This depends on the  +/// implementation of the terminal, and there's no standard definition of  +/// character width.  +///  +/// The implementation defines it in a way that is expected to be compatible  +/// with a generic Unicode-capable terminal.  +///  +/// \return Character width:  +///   * ErrorNonPrintableCharacter (-1) if \p Text contains non-printable  +///     characters (as identified by isPrintable);  +///   * 0 for each non-spacing and enclosing combining mark;  +///   * 2 for each CJK character excluding halfwidth forms;  +///   * 1 for each of the remaining characters.  +int columnWidthUTF8(StringRef Text);  +  +/// Fold input unicode character according the Simple unicode case folding  +/// rules.  +int foldCharSimple(int C);  +  +} // namespace unicode  +} // namespace sys  +} // namespace llvm  +  +#endif  +  +#ifdef __GNUC__  +#pragma GCC diagnostic pop  +#endif  | 
