Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
UnicodeNameToCodepoint.cpp
Go to the documentation of this file.
1//===- llvm/Support/UnicodeNameToCodepoint.cpp - Unicode character properties
2//-*- C++ -*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9//
10// This file implements functions to map the name or alias of a unicode
11// character to its codepoint.
12//
13//===----------------------------------------------------------------------===//
14
15#include "llvm/ADT/STLExtras.h"
16#include "llvm/ADT/StringExtras.h"
17#include "llvm/ADT/StringRef.h"
18#include "llvm/Support/Unicode.h"
19
20namespacellvm {
21namespacesys {
22namespaceunicode {
23
24externconstchar *UnicodeNameToCodepointDict;
25externconstuint8_t *UnicodeNameToCodepointIndex;
26externconst std::size_tUnicodeNameToCodepointIndexSize;
27externconst std::size_tUnicodeNameToCodepointLargestNameSize;
28
29usingBufferType =SmallString<64>;
30
31structNode {
32boolIsRoot =false;
33char32_tValue = 0xFFFFFFFF;
34uint32_tChildrenOffset = 0;
35boolHasSibling =false;
36uint32_tSize = 0;
37StringRefName;
38constNode *Parent =nullptr;
39
40constexprboolisValid() const{
41return !Name.empty() ||Value == 0xFFFFFFFF;
42 }
43constexprboolhasChildren() const{returnChildrenOffset != 0 ||IsRoot; }
44
45 std::stringfullName() const{
46 std::string S;
47// Reserve enough space for most unicode code points.
48// The chosen value represent the 99th percentile of name size as of
49// Unicode 15.0.
50 S.reserve(46);
51constNode *N =this;
52while (N) {
53 std::reverse_copy(N->Name.begin(),N->Name.end(), std::back_inserter(S));
54N =N->Parent;
55 }
56 std::reverse(S.begin(), S.end());
57return S;
58 }
59};
60
61staticNodecreateRoot() {
62NodeN;
63N.IsRoot =true;
64N.ChildrenOffset = 1;
65N.Size = 1;
66returnN;
67}
68
69staticNodereadNode(uint32_tOffset,constNode *Parent =nullptr) {
70if (Offset == 0)
71returncreateRoot();
72
73uint32_t Origin =Offset;
74NodeN;
75N.Parent = Parent;
76uint8_t NameInfo =UnicodeNameToCodepointIndex[Offset++];
77if (Offset + 6 >=UnicodeNameToCodepointIndexSize)
78returnN;
79
80bool LongName = NameInfo & 0x40;
81boolHasValue = NameInfo & 0x80;
82 std::size_tSize = NameInfo & ~0xC0;
83if (LongName) {
84uint32_t NameOffset = (UnicodeNameToCodepointIndex[Offset++] << 8);
85 NameOffset |=UnicodeNameToCodepointIndex[Offset++];
86N.Name =StringRef(UnicodeNameToCodepointDict + NameOffset,Size);
87 }else {
88N.Name =StringRef(UnicodeNameToCodepointDict +Size, 1);
89 }
90if (HasValue) {
91uint8_tH =UnicodeNameToCodepointIndex[Offset++];
92uint8_t M =UnicodeNameToCodepointIndex[Offset++];
93uint8_t L =UnicodeNameToCodepointIndex[Offset++];
94N.Value = ((H << 16) | (M << 8) | L) >> 3;
95
96bool HasChildren = L & 0x02;
97N.HasSibling = L & 0x01;
98
99if (HasChildren) {
100N.ChildrenOffset =UnicodeNameToCodepointIndex[Offset++] << 16;
101N.ChildrenOffset |=UnicodeNameToCodepointIndex[Offset++] << 8;
102N.ChildrenOffset |=UnicodeNameToCodepointIndex[Offset++];
103 }
104 }else {
105uint8_tH =UnicodeNameToCodepointIndex[Offset++];
106N.HasSibling =H & 0x80;
107bool HasChildren =H & 0x40;
108H &=uint8_t(~0xC0);
109if (HasChildren) {
110N.ChildrenOffset = (H << 16);
111N.ChildrenOffset |=
112 (uint32_t(UnicodeNameToCodepointIndex[Offset++]) << 8);
113N.ChildrenOffset |=UnicodeNameToCodepointIndex[Offset++];
114 }
115 }
116N.Size =Offset - Origin;
117returnN;
118}
119
120staticboolstartsWith(StringRefName,StringRef Needle,bool Strict,
121 std::size_t &Consummed,char &PreviousCharInName,
122bool IsPrefix =false) {
123
124 Consummed = 0;
125if (Strict) {
126if (!Name.starts_with(Needle))
127returnfalse;
128 Consummed = Needle.size();
129returntrue;
130 }
131if (Needle.empty())
132returntrue;
133
134auto NamePos =Name.begin();
135auto NeedlePos = Needle.begin();
136
137char PreviousCharInNameOrigin = PreviousCharInName;
138char PreviousCharInNeedle = *Needle.begin();
139auto IgnoreSpaces = [](auto It,autoEnd,char &PreviousChar,
140bool IsPrefix =false) {
141while (It !=End) {
142constauto Next = std::next(It);
143// Ignore spaces, underscore, medial hyphens
144// The generator ensures a needle never ends (or starts) by a medial
145// hyphen https://unicode.org/reports/tr44/#UAX44-LM2.
146boolIgnore =
147 *It ==' ' || *It =='_' ||
148 (*It =='-' && isAlnum(PreviousChar) &&
149 ((Next !=End && isAlnum(*Next)) || (Next ==End && IsPrefix)));
150 PreviousChar = *It;
151if (!Ignore)
152break;
153 ++It;
154 }
155return It;
156 };
157
158while (true) {
159 NamePos = IgnoreSpaces(NamePos,Name.end(), PreviousCharInName);
160 NeedlePos =
161 IgnoreSpaces(NeedlePos, Needle.end(), PreviousCharInNeedle, IsPrefix);
162if (NeedlePos == Needle.end())
163break;
164if (NamePos ==Name.end())
165break;
166if (toUpper(*NeedlePos) != toUpper(*NamePos))
167break;
168 NeedlePos++;
169 NamePos++;
170 }
171 Consummed = std::distance(Name.begin(), NamePos);
172if (NeedlePos != Needle.end()) {
173 PreviousCharInName = PreviousCharInNameOrigin;
174 }
175return NeedlePos == Needle.end();
176}
177
178static std::tuple<Node, bool, uint32_t>
179compareNode(uint32_tOffset,StringRefName,bool Strict,
180char PreviousCharInName,BufferType &Buffer,
181constNode *Parent =nullptr) {
182NodeN =readNode(Offset, Parent);
183 std::size_t Consummed = 0;
184bool DoesStartWith =N.IsRoot ||startsWith(Name,N.Name, Strict, Consummed,
185 PreviousCharInName);
186if (!DoesStartWith)
187return std::make_tuple(N,false, 0);
188
189if (Name.size() - Consummed == 0 &&N.Value != 0xFFFFFFFF)
190return std::make_tuple(N,true,N.Value);
191
192if (N.hasChildren()) {
193uint32_t ChildOffset =N.ChildrenOffset;
194for (;;) {
195NodeC;
196bool Matches;
197uint32_tValue;
198 std::tie(C, Matches,Value) =
199compareNode(ChildOffset,Name.substr(Consummed), Strict,
200 PreviousCharInName, Buffer, &N);
201if (Matches) {
202 std::reverse_copy(C.Name.begin(),C.Name.end(),
203 std::back_inserter(Buffer));
204return std::make_tuple(N,true,Value);
205 }
206 ChildOffset +=C.Size;
207if (!C.HasSibling)
208break;
209 }
210 }
211return std::make_tuple(N,false, 0);
212}
213
214static std::tuple<Node, bool, uint32_t>
215compareNode(uint32_tOffset,StringRefName,bool Strict,BufferType &Buffer) {
216returncompareNode(Offset,Name, Strict, 0, Buffer);
217}
218
219// clang-format off
220constexprconstchar *constHangulSyllables[][3] = {
221 {"G","A","" },
222 {"GG","AE","G" },
223 {"N","YA","GG" },
224 {"D","YAE","GS" },
225 {"DD","EO","N", },
226 {"R","E","NJ" },
227 {"M","YEO","NH" },
228 {"B","YE","D" },
229 {"BB","O","L" },
230 {"S","WA","LG" },
231 {"SS","WAE","LM" },
232 {"","OE","LB" },
233 {"J","YO","LS" },
234 {"JJ","U","LT" },
235 {"C","WEO","LP" },
236 {"K","WE","LH" },
237 {"T","WI","M" },
238 {"P","YU","B" },
239 {"H","EU","BS" },
240 { 0,"YI","S" },
241 { 0,"I","SS" },
242 { 0, 0,"NG" },
243 { 0, 0,"J" },
244 { 0, 0,"C" },
245 { 0, 0,"K" },
246 { 0, 0,"T" },
247 { 0, 0,"P" },
248 { 0, 0,"H" }
249 };
250// clang-format on
251
252// Unicode 15.0
253// 3.12 Conjoining Jamo Behavior Common constants
254constexprconstchar32_tSBase = 0xAC00;
255constexprconstuint32_tLCount = 19;
256constexprconstuint32_tVCount = 21;
257constexprconstuint32_tTCount = 28;
258
259static std::size_tfindSyllable(StringRefName,bool Strict,
260char &PreviousInName,int &Pos,int Column) {
261assert(Column == 0 || Column == 1 || Column == 2);
262static std::size_t CountPerColumn[] = {LCount,VCount,TCount};
263int Len = -1;
264int Prev = PreviousInName;
265for (std::size_tI = 0;I < CountPerColumn[Column];I++) {
266StringRef Syllable(HangulSyllables[I][Column]);
267if (int(Syllable.size()) <= Len)
268continue;
269 std::size_t Consummed = 0;
270char PreviousInNameCopy = PreviousInName;
271bool DoesStartWith =
272startsWith(Name, Syllable, Strict, Consummed, PreviousInNameCopy);
273if (!DoesStartWith)
274continue;
275 Len = Consummed;
276 Pos =I;
277 Prev = PreviousInNameCopy;
278 }
279if (Len == -1)
280return 0;
281 PreviousInName = Prev;
282return size_t(Len);
283}
284
285static std::optional<char32_t>
286nameToHangulCodePoint(StringRefName,bool Strict,BufferType &Buffer) {
287 Buffer.clear();
288// Hangul Syllable Decomposition
289 std::size_t Consummed = 0;
290char NameStart = 0;
291bool DoesStartWith =
292startsWith(Name,"HANGUL SYLLABLE ", Strict, Consummed, NameStart);
293if (!DoesStartWith)
294return std::nullopt;
295Name =Name.substr(Consummed);
296int L = -1, V = -1,T = -1;
297Name =Name.substr(findSyllable(Name, Strict, NameStart, L, 0));
298Name =Name.substr(findSyllable(Name, Strict, NameStart, V, 1));
299Name =Name.substr(findSyllable(Name, Strict, NameStart,T, 2));
300if (L != -1 && V != -1 &&T != -1 &&Name.empty()) {
301if (!Strict) {
302 Buffer.append("HANGUL SYLLABLE ");
303if (L != -1)
304 Buffer.append(HangulSyllables[L][0]);
305if (V != -1)
306 Buffer.append(HangulSyllables[V][1]);
307if (T != -1)
308 Buffer.append(HangulSyllables[T][2]);
309 }
310returnSBase + (std::uint32_t(L) *VCount + std::uint32_t(V)) *TCount +
311 std::uint32_t(T);
312 }
313// Otherwise, it's an illegal syllable name.
314return std::nullopt;
315}
316
317structGeneratedNamesData {
318StringRefPrefix;
319uint32_tStart;
320uint32_tEnd;
321};
322
323// Unicode 15.1 Table 4-8. Name Derivation Rule Prefix Strings
324staticconstGeneratedNamesDataGeneratedNamesDataTable[] = {
325 {"CJK UNIFIED IDEOGRAPH-", 0x3400, 0x4DBF},
326 {"CJK UNIFIED IDEOGRAPH-", 0x4E00, 0x9FFF},
327 {"CJK UNIFIED IDEOGRAPH-", 0x20000, 0x2A6DF},
328 {"CJK UNIFIED IDEOGRAPH-", 0x2A700, 0x2B739},
329 {"CJK UNIFIED IDEOGRAPH-", 0x2B740, 0x2B81D},
330 {"CJK UNIFIED IDEOGRAPH-", 0x2B820, 0x2CEA1},
331 {"CJK UNIFIED IDEOGRAPH-", 0x2CEB0, 0x2EBE0},
332 {"CJK UNIFIED IDEOGRAPH-", 0x2EBF0, 0x2EE5D},
333 {"CJK UNIFIED IDEOGRAPH-", 0x30000, 0x3134A},
334 {"CJK UNIFIED IDEOGRAPH-", 0x31350, 0x323AF},
335 {"TANGUT IDEOGRAPH-", 0x17000, 0x187F7},
336 {"TANGUT IDEOGRAPH-", 0x18D00, 0x18D08},
337 {"KHITAN SMALL SCRIPT CHARACTER-", 0x18B00, 0x18CD5},
338 {"NUSHU CHARACTER-", 0x1B170, 0x1B2FB},
339 {"CJK COMPATIBILITY IDEOGRAPH-", 0xF900, 0xFA6D},
340 {"CJK COMPATIBILITY IDEOGRAPH-", 0xFA70, 0xFAD9},
341 {"CJK COMPATIBILITY IDEOGRAPH-", 0x2F800, 0x2FA1D},
342};
343
344static std::optional<char32_t>
345nameToGeneratedCodePoint(StringRefName,bool Strict,BufferType &Buffer) {
346for (auto &&Item :GeneratedNamesDataTable) {
347 Buffer.clear();
348 std::size_t Consummed = 0;
349char NameStart = 0;
350bool DoesStartWith =startsWith(Name, Item.Prefix, Strict, Consummed,
351 NameStart,/*IsPrefix=*/true);
352if (!DoesStartWith)
353continue;
354autoNumber =Name.substr(Consummed);
355unsignedlonglong V = 0;
356// Be consistent about mandating upper casing.
357if (Strict &&
358llvm::any_of(Number, [](charC) {returnC >='a' &&C <='f'; }))
359return {};
360if (getAsUnsignedInteger(Number, 16, V) || V < Item.Start || V > Item.End)
361continue;
362if (!Strict) {
363 Buffer.append(Item.Prefix);
364 Buffer.append(utohexstr(V,true));
365 }
366return V;
367 }
368return std::nullopt;
369}
370
371static std::optional<char32_t>nameToCodepoint(StringRefName,bool Strict,
372BufferType &Buffer) {
373if (Name.empty())
374return std::nullopt;
375
376 std::optional<char32_t> Res =nameToHangulCodePoint(Name, Strict, Buffer);
377if (!Res)
378 Res =nameToGeneratedCodePoint(Name, Strict, Buffer);
379if (Res)
380return *Res;
381
382 Buffer.clear();
383NodeNode;
384bool Matches;
385uint32_tValue;
386 std::tie(Node, Matches,Value) =compareNode(0,Name, Strict, Buffer);
387if (Matches) {
388 std::reverse(Buffer.begin(), Buffer.end());
389// UAX44-LM2. Ignore case, whitespace, underscore ('_'), and all medial
390// hyphens except the hyphen in U+1180 HANGUL JUNGSEONG O-E.
391if (!Strict &&Value == 0x116c &&Name.contains_insensitive("O-E")) {
392 Buffer ="HANGUL JUNGSEONG O-E";
393Value = 0x1180;
394 }
395returnValue;
396 }
397return std::nullopt;
398}
399
400std::optional<char32_t>nameToCodepointStrict(StringRefName) {
401
402BufferType Buffer;
403auto Opt =nameToCodepoint(Name,true, Buffer);
404return Opt;
405}
406
407std::optional<LooseMatchingResult>
408nameToCodepointLooseMatching(StringRefName) {
409BufferType Buffer;
410auto Opt =nameToCodepoint(Name,false, Buffer);
411if (!Opt)
412return std::nullopt;
413returnLooseMatchingResult{*Opt, Buffer};
414}
415
416// Find the unicode character whose editing distance to Pattern
417// is shortest, using the Wagner–Fischer algorithm.
418llvm::SmallVector<MatchForCodepointName>
419nearestMatchesForCodepointName(StringRefPattern, std::size_t MaxMatchesCount) {
420// We maintain a fixed size vector of matches,
421// sorted by distance
422// The worst match (with the biggest distance) are discarded when new elements
423// are added.
424 std::size_t LargestEditDistance = 0;
425llvm::SmallVector<MatchForCodepointName> Matches;
426 Matches.reserve(MaxMatchesCount + 1);
427
428auto Insert = [&](constNode &Node,uint32_t Distance,
429char32_tValue) ->bool {
430if (Distance > LargestEditDistance) {
431if (Matches.size() == MaxMatchesCount)
432returnfalse;
433 LargestEditDistance = Distance;
434 }
435// To avoid allocations, the creation of the name is delayed
436// as much as possible.
437 std::stringName;
438auto GetName = [&] {
439if (Name.empty())
440Name =Node.fullName();
441returnName;
442 };
443
444auto It =llvm::lower_bound(
445 Matches, Distance,
446 [&](constMatchForCodepointName &a, std::size_t Distance) {
447if (Distance == a.Distance)
448return a.Name < GetName();
449return a.Distance < Distance;
450 });
451if (It == Matches.end() && Matches.size() == MaxMatchesCount)
452returnfalse;
453
454MatchForCodepointName M{GetName(), Distance,Value};
455 Matches.insert(It, std::move(M));
456if (Matches.size() > MaxMatchesCount)
457 Matches.pop_back();
458returntrue;
459 };
460
461// We ignore case, space, hyphens, etc,
462// in both the search pattern and the prospective names.
463autoNormalize = [](StringRefName) {
464 std::string Out;
465 Out.reserve(Name.size());
466for (charC :Name) {
467if (isAlnum(C))
468 Out.push_back(toUpper(C));
469 }
470return Out;
471 };
472 std::string NormalizedName =Normalize(Pattern);
473
474// Allocate a matrix big enough for longest names.
475const std::size_t Columns =
476 std::min(NormalizedName.size(),UnicodeNameToCodepointLargestNameSize) +
477 1;
478
479LLVM_ATTRIBUTE_UNUSEDstatic std::size_t Rows =
480UnicodeNameToCodepointLargestNameSize + 1;
481
482 std::vector<char> Distances(
483 Columns * (UnicodeNameToCodepointLargestNameSize + 1), 0);
484
485auto Get = [&Distances, Columns](size_t Column, std::size_t Row) ->char & {
486assert(Column < Columns);
487assert(Row < Rows);
488return Distances[Row * Columns + Column];
489 };
490
491for (std::size_tI = 0;I < Columns;I++)
492 Get(I, 0) =I;
493
494// Visit the childrens,
495// Filling (and overriding) the matrix for the name fragment of each node
496// iteratively. CompleteName is used to collect the actual name of potential
497// match, respecting case and spacing.
498auto VisitNode = [&](constNode &N, std::size_t Row,
499auto &VisitNode) ->void {
500 std::size_t J = 0;
501for (; J <N.Name.size(); J++) {
502if (!isAlnum(N.Name[J]))
503continue;
504
505 Get(0, Row) = Row;
506
507for (std::size_tI = 1;I < Columns;I++) {
508constint Delete = Get(I - 1, Row) + 1;
509constint Insert = Get(I, Row - 1) + 1;
510
511constint Replace =
512 Get(I - 1, Row - 1) + (NormalizedName[I - 1] !=N.Name[J] ? 1 : 0);
513
514 Get(I, Row) = std::min(Insert, std::min(Delete, Replace));
515 }
516
517 Row++;
518 }
519
520unsignedCost = Get(Columns - 1, Row - 1);
521if (N.Value != 0xFFFFFFFF) {
522 Insert(N,Cost,N.Value);
523 }
524
525if (N.hasChildren()) {
526auto ChildOffset =N.ChildrenOffset;
527for (;;) {
528NodeC =readNode(ChildOffset, &N);
529 ChildOffset +=C.Size;
530if (!C.isValid())
531break;
532 VisitNode(C, Row, VisitNode);
533if (!C.HasSibling)
534break;
535 }
536 }
537 };
538
539Node Root =createRoot();
540 VisitNode(Root, 1, VisitNode);
541return Matches;
542}
543
544}// namespace unicode
545
546}// namespace sys
547}// namespace llvm
Ignore
ReachingDefAnalysis InstSet InstSet & Ignore
Definition:ARMLowOverheadLoops.cpp:531
LLVM_ATTRIBUTE_UNUSED
#define LLVM_ATTRIBUTE_UNUSED
Definition:Compiler.h:282
Name
std::string Name
Definition:ELFObjHandler.cpp:77
Size
uint64_t Size
Definition:ELFObjHandler.cpp:81
End
bool End
Definition:ELF_riscv.cpp:480
I
#define I(x, y, z)
Definition:MD5.cpp:58
H
#define H(x, y, z)
Definition:MD5.cpp:57
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
STLExtras.h
This file contains some templates that are useful if you are working with the STL at all.
Normalize
@ Normalize
Normalize - Normalize according to the given loops.
Definition:ScalarEvolutionNormalization.cpp:24
StringExtras.h
This file contains some functions that are useful when dealing with strings.
StringRef.h
Unicode.h
T
llvm::InstructionCost
Definition:InstructionCost.h:29
llvm::Pattern
Definition:FileCheckImpl.h:565
llvm::SmallString< 64 >
llvm::SmallString::append
void append(StringRef RHS)
Append from a StringRef.
Definition:SmallString.h:68
llvm::SmallVectorBase::size
size_t size() const
Definition:SmallVector.h:78
llvm::SmallVectorImpl::reserve
void reserve(size_type N)
Definition:SmallVector.h:663
llvm::SmallVectorImpl::insert
iterator insert(iterator I, T &&Elt)
Definition:SmallVector.h:805
llvm::SmallVectorImpl::clear
void clear()
Definition:SmallVector.h:610
llvm::SmallVectorTemplateBase::pop_back
void pop_back()
Definition:SmallVector.h:425
llvm::SmallVectorTemplateCommon::end
iterator end()
Definition:SmallVector.h:269
llvm::SmallVectorTemplateCommon::begin
iterator begin()
Definition:SmallVector.h:267
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition:SmallVector.h:1196
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::StringRef::empty
constexpr bool empty() const
empty - Check if the string is empty.
Definition:StringRef.h:147
llvm::StringRef::begin
iterator begin() const
Definition:StringRef.h:116
llvm::StringRef::size
constexpr size_t size() const
size - Get the string size.
Definition:StringRef.h:150
llvm::StringRef::end
iterator end() const
Definition:StringRef.h:118
llvm::Value
LLVM Value Representation.
Definition:Value.h:74
uint32_t
uint8_t
llvm::CallingConv::C
@ C
The default llvm calling convention, compatible with C.
Definition:CallingConv.h:34
llvm::sys::unicode::readNode
static Node readNode(uint32_t Offset, const Node *Parent=nullptr)
Definition:UnicodeNameToCodepoint.cpp:69
llvm::sys::unicode::TCount
constexpr const uint32_t TCount
Definition:UnicodeNameToCodepoint.cpp:257
llvm::sys::unicode::UnicodeNameToCodepointLargestNameSize
const std::size_t UnicodeNameToCodepointLargestNameSize
Definition:UnicodeNameToCodepointGenerated.cpp:74
llvm::sys::unicode::startsWith
static bool startsWith(StringRef Name, StringRef Needle, bool Strict, std::size_t &Consummed, char &PreviousCharInName, bool IsPrefix=false)
Definition:UnicodeNameToCodepoint.cpp:120
llvm::sys::unicode::nameToCodepointStrict
std::optional< char32_t > nameToCodepointStrict(StringRef Name)
Maps the name or the alias of a Unicode character to its associated codepoints.
Definition:UnicodeNameToCodepoint.cpp:400
llvm::sys::unicode::nearestMatchesForCodepointName
SmallVector< MatchForCodepointName > nearestMatchesForCodepointName(StringRef Pattern, std::size_t MaxMatchesCount)
Definition:UnicodeNameToCodepoint.cpp:419
llvm::sys::unicode::UnicodeNameToCodepointIndexSize
const std::size_t UnicodeNameToCodepointIndexSize
Definition:UnicodeNameToCodepointGenerated.cpp:73
llvm::sys::unicode::createRoot
static Node createRoot()
Definition:UnicodeNameToCodepoint.cpp:61
llvm::sys::unicode::HangulSyllables
constexpr const char *const HangulSyllables[][3]
Definition:UnicodeNameToCodepoint.cpp:220
llvm::sys::unicode::nameToCodepointLooseMatching
std::optional< LooseMatchingResult > nameToCodepointLooseMatching(StringRef Name)
Definition:UnicodeNameToCodepoint.cpp:408
llvm::sys::unicode::LCount
constexpr const uint32_t LCount
Definition:UnicodeNameToCodepoint.cpp:255
llvm::sys::unicode::nameToHangulCodePoint
static std::optional< char32_t > nameToHangulCodePoint(StringRef Name, bool Strict, BufferType &Buffer)
Definition:UnicodeNameToCodepoint.cpp:286
llvm::sys::unicode::VCount
constexpr const uint32_t VCount
Definition:UnicodeNameToCodepoint.cpp:256
llvm::sys::unicode::UnicodeNameToCodepointIndex
const uint8_t * UnicodeNameToCodepointIndex
Definition:UnicodeNameToCodepointGenerated.cpp:72
llvm::sys::unicode::GeneratedNamesDataTable
static const GeneratedNamesData GeneratedNamesDataTable[]
Definition:UnicodeNameToCodepoint.cpp:324
llvm::sys::unicode::findSyllable
static std::size_t findSyllable(StringRef Name, bool Strict, char &PreviousInName, int &Pos, int Column)
Definition:UnicodeNameToCodepoint.cpp:259
llvm::sys::unicode::compareNode
static std::tuple< Node, bool, uint32_t > compareNode(uint32_t Offset, StringRef Name, bool Strict, char PreviousCharInName, BufferType &Buffer, const Node *Parent=nullptr)
Definition:UnicodeNameToCodepoint.cpp:179
llvm::sys::unicode::nameToCodepoint
static std::optional< char32_t > nameToCodepoint(StringRef Name, bool Strict, BufferType &Buffer)
Definition:UnicodeNameToCodepoint.cpp:371
llvm::sys::unicode::nameToGeneratedCodePoint
static std::optional< char32_t > nameToGeneratedCodePoint(StringRef Name, bool Strict, BufferType &Buffer)
Definition:UnicodeNameToCodepoint.cpp:345
llvm::sys::unicode::SBase
constexpr const char32_t SBase
Definition:UnicodeNameToCodepoint.cpp:254
llvm::sys::unicode::UnicodeNameToCodepointDict
const char * UnicodeNameToCodepointDict
Definition:UnicodeNameToCodepointGenerated.cpp:71
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::Offset
@ Offset
Definition:DWP.cpp:480
llvm::any_of
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
Definition:STLExtras.h:1746
llvm::HasValue
detail::ValueMatchesPoly< M > HasValue(M Matcher)
Definition:Error.h:221
llvm::lower_bound
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
Definition:STLExtras.h:1978
llvm::getAsUnsignedInteger
bool getAsUnsignedInteger(StringRef Str, unsigned Radix, unsigned long long &Result)
Helper functions for StringRef::getAsInteger.
Definition:StringRef.cpp:488
llvm::IntegerStyle::Number
@ Number
N
#define N
llvm::sys::unicode::GeneratedNamesData
Definition:UnicodeNameToCodepoint.cpp:317
llvm::sys::unicode::GeneratedNamesData::Prefix
StringRef Prefix
Definition:UnicodeNameToCodepoint.cpp:318
llvm::sys::unicode::GeneratedNamesData::Start
uint32_t Start
Definition:UnicodeNameToCodepoint.cpp:319
llvm::sys::unicode::GeneratedNamesData::End
uint32_t End
Definition:UnicodeNameToCodepoint.cpp:320
llvm::sys::unicode::LooseMatchingResult
Definition:Unicode.h:72
llvm::sys::unicode::MatchForCodepointName
Definition:Unicode.h:79
llvm::sys::unicode::MatchForCodepointName::Distance
uint32_t Distance
Definition:Unicode.h:81
llvm::sys::unicode::MatchForCodepointName::Name
std::string Name
Definition:Unicode.h:80
llvm::sys::unicode::Node
Definition:UnicodeNameToCodepoint.cpp:31
llvm::sys::unicode::Node::isValid
constexpr bool isValid() const
Definition:UnicodeNameToCodepoint.cpp:40
llvm::sys::unicode::Node::fullName
std::string fullName() const
Definition:UnicodeNameToCodepoint.cpp:45
llvm::sys::unicode::Node::Name
StringRef Name
Definition:UnicodeNameToCodepoint.cpp:37
llvm::sys::unicode::Node::ChildrenOffset
uint32_t ChildrenOffset
Definition:UnicodeNameToCodepoint.cpp:34
llvm::sys::unicode::Node::IsRoot
bool IsRoot
Definition:UnicodeNameToCodepoint.cpp:32
llvm::sys::unicode::Node::hasChildren
constexpr bool hasChildren() const
Definition:UnicodeNameToCodepoint.cpp:43
llvm::sys::unicode::Node::Size
uint32_t Size
Definition:UnicodeNameToCodepoint.cpp:36
llvm::sys::unicode::Node::HasSibling
bool HasSibling
Definition:UnicodeNameToCodepoint.cpp:35
llvm::sys::unicode::Node::Parent
const Node * Parent
Definition:UnicodeNameToCodepoint.cpp:38

Generated on Fri Jul 18 2025 12:55:27 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp