Path: blob/main/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h
39653 views
//===-- ClangDiagnostic.h ---------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGDIAGNOSTIC_H9#define LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGDIAGNOSTIC_H1011#include <vector>1213#include "clang/Basic/Diagnostic.h"1415#include "lldb/lldb-defines.h"16#include "lldb/lldb-types.h"1718#include "lldb/Expression/DiagnosticManager.h"1920namespace lldb_private {2122class ClangDiagnostic : public Diagnostic {23public:24typedef std::vector<clang::FixItHint> FixItList;2526static inline bool classof(const ClangDiagnostic *) { return true; }27static inline bool classof(const Diagnostic *diag) {28return diag->getKind() == eDiagnosticOriginClang;29}3031ClangDiagnostic(llvm::StringRef message, lldb::Severity severity,32uint32_t compiler_id)33: Diagnostic(message, severity, eDiagnosticOriginClang, compiler_id) {}3435~ClangDiagnostic() override = default;3637bool HasFixIts() const override { return !m_fixit_vec.empty(); }3839void AddFixitHint(const clang::FixItHint &fixit) {40m_fixit_vec.push_back(fixit);41}4243const FixItList &FixIts() const { return m_fixit_vec; }44private:45FixItList m_fixit_vec;46};4748} // namespace lldb_private49#endif // LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGDIAGNOSTIC_H505152