//===--- UnicodeNameMappingGenerator.cpp - Unicode name data generator ---===// // // 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 is used to generate lib/Support/UnicodeNameToCodepointGenerated.cpp // using UnicodeData.txt and NameAliases.txt available at // https://unicode.org/Public/15.1.0/ucd/ //===----------------------------------------------------------------------===// #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringRef.h" #include <algorithm> #include <array> #include <deque> #include <fstream> #include <memory> #include <optional> #include <set> #include <string> #include <unordered_map> #include <utility> #include <vector> static const llvm::StringRef Letters = …; // Collect names UnicodeData.txt and AliasNames.txt // There may be multiple names per code points. static std::unordered_multimap<char32_t, std::string> loadDataFiles(const std::string &NamesFile, const std::string &AliasesFile) { … } class Trie { … }; extern const char *UnicodeLicense; int main(int argc, char **argv) { … } const char *UnicodeLicense = …;