MLIR  20.0.0git
Functions
Transport.cpp File Reference
#include "mlir/Tools/lsp-server-support/Transport.h"
#include "mlir/Support/ToolUtilities.h"
#include "mlir/Tools/lsp-server-support/Logging.h"
#include "mlir/Tools/lsp-server-support/Protocol.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Errno.h"
#include "llvm/Support/Error.h"
#include <optional>
#include <system_error>
#include <utility>

Go to the source code of this file.

Functions

static llvm::json::Object encodeError (llvm::Error error)
 Encode the given error as a JSON object. More...
 
llvm::Error decodeError (const llvm::json::Object &o)
 Decode the given JSON object into an error. More...
 
LogicalResult readLine (std::FILE *in, SmallVectorImpl< char > &out)
 Tries to read a line up to and including
. More...
 

Function Documentation

◆ decodeError()

llvm::Error decodeError ( const llvm::json::Object &  o)

Decode the given JSON object into an error.

Definition at line 169 of file Transport.cpp.

◆ encodeError()

static llvm::json::Object encodeError ( llvm::Error  error)
static

Encode the given error as a JSON object.

Definition at line 151 of file Transport.cpp.

References toString(), and mlir::lsp::UnknownErrorCode.

Referenced by mlir::lsp::JSONTransport::reply().

◆ readLine()

LogicalResult readLine ( std::FILE *  in,
SmallVectorImpl< char > &  out 
)

Tries to read a line up to and including
.

If failing, feof(), ferror(), or shutdownRequested() will be set.

Definition at line 279 of file Transport.cpp.