CIRCT  19.0.0git
JSON.h
Go to the documentation of this file.
1 //===- Json.h - Json Utilities ----------------------------------*- 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 // Utilities for JSON-to-Attribute conversion.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef CIRCT_SUPPORT_JSON_H
14 #define CIRCT_SUPPORT_JSON_H
15 
16 #include "circt/Support/LLVM.h"
17 #include "llvm/Support/JSON.h"
18 
19 namespace circt {
20 
21 /// Convert a simple attribute to JSON.
22 LogicalResult convertAttributeToJSON(llvm::json::OStream &json, Attribute attr);
23 
24 /// Convert arbitrary JSON to an MLIR Attribute.
25 Attribute convertJSONToAttribute(MLIRContext *context, llvm::json::Value &value,
26  llvm::json::Path p);
27 
28 } // namespace circt
29 
30 #endif // CIRCT_SUPPORT_JSON_H
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21
Attribute convertJSONToAttribute(MLIRContext *context, llvm::json::Value &value, llvm::json::Path p)
Convert arbitrary JSON to an MLIR Attribute.
LogicalResult convertAttributeToJSON(llvm::json::OStream &json, Attribute attr)
Convert a simple attribute to JSON.
Definition: JSON.cpp:23