MLIR  19.0.0git
Protocol.h
Go to the documentation of this file.
1 //===--- Protocol.h - Language Server Protocol Implementation ---*- 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 //
9 // This file contains structs for LSP commands that are specific to the MLIR
10 // server.
11 //
12 // Each struct has a toJSON and fromJSON function, that converts between
13 // the struct and a JSON representation. (See JSON.h)
14 //
15 // Some structs also have operator<< serialization. This is for debugging and
16 // tests, and is not generally machine-readable.
17 //
18 //===----------------------------------------------------------------------===//
19 
20 #ifndef LIB_MLIR_TOOLS_MLIRLSPSERVER_PROTOCOL_H_
21 #define LIB_MLIR_TOOLS_MLIRLSPSERVER_PROTOCOL_H_
22 
24 
25 namespace mlir {
26 namespace lsp {
27 //===----------------------------------------------------------------------===//
28 // MLIRConvertBytecodeParams
29 //===----------------------------------------------------------------------===//
30 
31 /// This class represents the parameters used when converting between MLIR's
32 /// bytecode and textual format.
34  /// The input file containing the bytecode or textual format.
36 };
37 
38 /// Add support for JSON serialization.
39 bool fromJSON(const llvm::json::Value &value, MLIRConvertBytecodeParams &result,
40  llvm::json::Path path);
41 
42 //===----------------------------------------------------------------------===//
43 // MLIRConvertBytecodeResult
44 //===----------------------------------------------------------------------===//
45 
46 /// This class represents the result of converting between MLIR's bytecode and
47 /// textual format.
49  /// The resultant output of the conversion.
50  std::string output;
51 };
52 
53 /// Add support for JSON serialization.
54 llvm::json::Value toJSON(const MLIRConvertBytecodeResult &value);
55 
56 } // namespace lsp
57 } // namespace mlir
58 
59 #endif
URI in "file" scheme for a file.
Definition: Protocol.h:100
llvm::json::Value toJSON(const URIForFile &value)
Add support for JSON serialization.
Definition: Protocol.cpp:263
bool fromJSON(const llvm::json::Value &value, URIForFile &result, llvm::json::Path path)
Definition: Protocol.cpp:248
Include the generated interface declarations.
This class represents the parameters used when converting between MLIR's bytecode and textual format.
Definition: Protocol.h:33
URIForFile uri
The input file containing the bytecode or textual format.
Definition: Protocol.h:35
This class represents the result of converting between MLIR's bytecode and textual format.
Definition: Protocol.h:48
std::string output
The resultant output of the conversion.
Definition: Protocol.h:50