================ @@ -0,0 +1,162 @@ +//=- ClangBuiltinsEmitter.cpp - Generate Clang builtin templates-*- 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 tablegen backend emits Clang's builtin templates. +// +//===----------------------------------------------------------------------===// + +#include "TableGenBackends.h" +#include "llvm/TableGen/Error.h" +#include "llvm/TableGen/TableGenBackend.h" + +#include <sstream> + +using namespace llvm; + +static std::string TemplateNameList; +static std::string CreateBuiltinTemplateParameterList; + +namespace { +struct ParserState { + size_t UniqueCounter = 0; + size_t CurrentDepth = 0; + bool EmittedSizeTInfo = false; +}; + +std::pair<std::string, std::string> +ParseTemplateParameterList(ParserState &PS, + ArrayRef<const Record *> TemplateArgs) { + std::vector<std::string> Params; + std::unordered_map<std::string, std::string> TemplateNameToParmName; ---------------- erichkeane wrote:
There are distinct advantages (particularly in the case of `StringMap`) to the point it is nice to use them (same perhaps with `SmallVector` the line above, given its Small-Size-Opt and typically small number of params). You're right that we care LESS about tablegen, though there are definitely folks who are particularly sensitive to the speed of tablegen. https://github.com/llvm/llvm-project/pull/123736 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits