================ @@ -0,0 +1,333 @@ +//=- ClangDiagnosticsEmitter.cpp - Generate Clang diagnostics tables -*- 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 +// +//===----------------------------------------------------------------------===// +// +// These tablegen backends emit Clang diagnostics tables. +// +//===----------------------------------------------------------------------===// + +#include "TableGenBackends.h" +#include "llvm/ADT/StringSwitch.h" +#include "llvm/TableGen/Error.h" +#include "llvm/TableGen/Record.h" +#include "llvm/TableGen/TableGenBackend.h" + +using namespace llvm; + +namespace { +enum class BuiltinType { + Builtin, + AtomicBuiltin, + LibBuiltin, + LangBuiltin, + TargetBuiltin, +}; + +class PrototypeParser { +public: + PrototypeParser(StringRef Substitution, const Record *Builtin) + : Loc(Builtin->getFieldLoc("Prototype")), Substitution(Substitution) { + ParsePrototype(Builtin->getValueAsString("Prototype")); + } + +private: + void ParsePrototype(StringRef Prototype) { + Prototype = Prototype.trim(); + Prototype = Prototype.trim(); ---------------- AaronBallman wrote:
This seems suspicious, why two trims? https://github.com/llvm/llvm-project/pull/68324 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits