Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / Language / ClangCommon / ClangHighlighter.h
blob20bb09502d42fba6d53dde9076225024fcd96c54
1 //===-- ClangHighlighter.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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_LANGUAGE_CLANGCOMMON_CLANGHIGHLIGHTER_H
10 #define LLDB_SOURCE_PLUGINS_LANGUAGE_CLANGCOMMON_CLANGHIGHLIGHTER_H
12 #include "lldb/Utility/Stream.h"
13 #include "llvm/ADT/StringSet.h"
15 #include "lldb/Core/Highlighter.h"
16 #include <optional>
18 namespace lldb_private {
20 class ClangHighlighter : public Highlighter {
21 llvm::StringSet<> keywords;
23 public:
24 ClangHighlighter();
25 llvm::StringRef GetName() const override { return "clang"; }
27 void Highlight(const HighlightStyle &options, llvm::StringRef line,
28 std::optional<size_t> cursor_pos,
29 llvm::StringRef previous_lines, Stream &s) const override;
31 /// Returns true if the given string represents a keywords in any Clang
32 /// supported language.
33 bool isKeyword(llvm::StringRef token) const;
36 } // namespace lldb_private
38 #endif // LLDB_SOURCE_PLUGINS_LANGUAGE_CLANGCOMMON_CLANGHIGHLIGHTER_H