brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · c473df8 Raw
50 lines · c
1//===-- ClangDiagnostic.h ---------------------------------------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGDIAGNOSTIC_H10#define LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGDIAGNOSTIC_H11 12#include <vector>13 14#include "clang/Basic/Diagnostic.h"15 16#include "lldb/lldb-defines.h"17#include "lldb/lldb-types.h"18 19#include "lldb/Expression/DiagnosticManager.h"20 21namespace lldb_private {22 23class ClangDiagnostic : public Diagnostic {24public:25  typedef std::vector<clang::FixItHint> FixItList;26 27  static inline bool classof(const ClangDiagnostic *) { return true; }28  static inline bool classof(const Diagnostic *diag) {29    return diag->getKind() == eDiagnosticOriginClang;30  }31 32  ClangDiagnostic(DiagnosticDetail detail, uint32_t compiler_id)33      : Diagnostic(eDiagnosticOriginClang, compiler_id, detail) {}34 35  ~ClangDiagnostic() override = default;36 37  bool HasFixIts() const override { return !m_fixit_vec.empty(); }38 39  void AddFixitHint(const clang::FixItHint &fixit) {40    m_fixit_vec.push_back(fixit);41  }42 43  const FixItList &FixIts() const { return m_fixit_vec; }44private:45  FixItList m_fixit_vec;46};47 48} // namespace lldb_private49#endif // LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGDIAGNOSTIC_H50