[AMDGPU][AsmParser][NFC] Translate parsed MIMG instructions to MCInsts automatically.
[llvm-project.git] / clang-tools-extra / clangd / unittests / Annotations.h
blob7cf9c30d8d4bb7504dc679cf77b6b9f827a097b3
1 //===--- Annotations.h - Annotated source code for tests ---------*- 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 //===----------------------------------------------------------------------===//
8 // A clangd-specific version of llvm/Testing/Annotations/Annotations.h, replaces
9 // offsets and offset-based ranges with types from the LSP protocol.
10 //===---------------------------------------------------------------------===//
12 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_UNITTESTS_ANNOTATIONS_H
13 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_UNITTESTS_ANNOTATIONS_H
15 #include "Protocol.h"
16 #include "llvm/Testing/Annotations/Annotations.h"
18 namespace clang {
19 namespace clangd {
21 /// Same as llvm::Annotations, but adjusts functions to LSP-specific types for
22 /// positions and ranges.
23 class Annotations : public llvm::Annotations {
24 using Base = llvm::Annotations;
26 public:
27 using llvm::Annotations::Annotations;
29 Position point(llvm::StringRef Name = "") const;
30 std::pair<Position, llvm::StringRef>
31 pointWithPayload(llvm::StringRef Name = "") const;
32 std::vector<Position> points(llvm::StringRef Name = "") const;
33 std::vector<std::pair<Position, llvm::StringRef>>
34 pointsWithPayload(llvm::StringRef Name = "") const;
36 clangd::Range range(llvm::StringRef Name = "") const;
37 std::pair<clangd::Range, llvm::StringRef>
38 rangeWithPayload(llvm::StringRef Name = "") const;
39 std::vector<clangd::Range> ranges(llvm::StringRef Name = "") const;
40 std::vector<std::pair<clangd::Range, llvm::StringRef>>
41 rangesWithPayload(llvm::StringRef Name = "") const;
44 } // namespace clangd
45 } // namespace clang
47 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_UNITTESTS_ANNOTATIONS_H