//===- FindDiagnosticID.cpp - diagtool tool for finding diagnostic id -----===// // // 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 // //===----------------------------------------------------------------------===// #include "DiagTool.h" #include "DiagnosticNames.h" #include "clang/Basic/AllDiagnostics.h" #include "llvm/Support/CommandLine.h" #include <optional> DEF_DIAGTOOL(…) usingnamespaceclang; usingnamespacediagtool; static StringRef getNameFromID(StringRef Name) { … } static std::optional<DiagnosticRecord> findDiagnostic(ArrayRef<DiagnosticRecord> Diagnostics, StringRef Name) { … } int FindDiagnosticID::run(unsigned int argc, char **argv, llvm::raw_ostream &OS) { … }