Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

82 lines
2.5 KiB
C++

//===-- RPCServerSourceEmitter.h ------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
#ifndef LLDB_RPC_GEN_RPCSERVERMETHODEMITTER_H
#define LLDB_RPC_GEN_RPCSERVERMETHODEMITTER_H
#include "RPCCommon.h"
#include "clang/AST/AST.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Support/raw_ostream.h"
using namespace clang;
namespace lldb_rpc_gen {
/// Emit the source code for server-side *.cpp files.
class RPCServerSourceEmitter : public FileEmitter {
public:
RPCServerSourceEmitter(std::unique_ptr<llvm::ToolOutputFile> &&OutputFile)
: FileEmitter(std::move(OutputFile)) {
Begin();
}
/// Given a Method, emits a server-side implementation of the method
/// for lldb-rpc-server
void EmitMethod(const Method &method);
private:
void EmitCommentHeader(const Method &method);
void EmitFunctionHeader(const Method &method);
void EmitFunctionBody(const Method &method);
void EmitFunctionFooter();
void EmitStorageForParameters(const Method &method);
void EmitStorageForOneParameter(QualType ParamType,
const std::string &ParamName,
const PrintingPolicy &Policy,
bool IsFollowedByLen);
void EmitDecodeForParameters(const Method &method);
void EmitDecodeForOneParameter(QualType ParamType,
const std::string &ParamName,
const PrintingPolicy &Policy);
std::string CreateMethodCall(const Method &method);
std::string CreateEncodeLine(const std::string &value,
bool IsEncodingSBClass);
void EmitEncodesForMutableParameters(const std::vector<Param> &Params);
void EmitMethodCallAndEncode(const Method &method);
void EmitCallbackFunction(const Method &method);
void Begin() {
EmitLine("#include \"RPCUserServer.h\"");
EmitLine("#include \"SBAPI.h\"");
EmitLine("#include <lldb-rpc/common/RPCArgument.h>");
EmitLine("#include <lldb-rpc/common/RPCCommon.h>");
EmitLine("#include <lldb-rpc/common/RPCFunction.h>");
EmitLine("#include <lldb/API/LLDB.h>");
EmitLine("");
EmitLine("using namespace rpc_common;");
EmitLine("using namespace lldb;");
}
};
} // namespace lldb_rpc_gen
#endif // LLDB_RPC_GEN_RPCSERVERMETHODEMITTER_H