Open gtrepta opened 3 years ago
On first glance this duplication still exists - we should look further into the LLVM backend runtime exposing an API to semantics that need it.
runtime/header.h
is basically the API, with typedefs and macros for handling the backend's data structures. It's probably sufficient enough to expose the json headers/functionality there.
runtime/json/json.cpp
implementsKoreHandler
,KoreWriter
, andwrite_json
. Inblockchain-k-plugin
inplugin-c/json.cpp
those are also being implemented, and slightly differently (I guess they're older versions?). Making a header file with declarations for these would allow the blockchain plugin to use them.Inversely,
runtime/json/json.cpp
has a few structs declared which are provided by a header file inblockchain-k-plugin
inplugin-c/k.h
. These arezinj
,stringinj
,boolinj
,jsonlist
,json
, andjsonmember
, along with someextern "C"
stuff. There are also declarations of globalblock *
andblockheader
constructs scattered around, even in firefly and iele-semantics. These are just typedefs and simple constructs but maybe it would be good to get them centralized somewhere with some basic utilities as a rudimentary "K API".