mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 22:36:06 +00:00

Summary: This patch adds a temporary implementation that uses a struct-based interface in lieu of varargs support. Once varargs support exists we will move this implementation to the "real" printf implementation. Conceptually, this patch has the client copy over its format string and arguments to the server. The server will then scan the format string searching for any specifiers that are actually a string. If it is a string then we will send the pointer back to the server to tell it to copy it back. This copied value will then replace the pointer when the final formatting is done. This will require a built-in extension to the varargs support to get access to the underlying struct. The varargs used on the GPU will simply be a struct wrapped in a varargs ABI.
27 lines
619 B
TableGen
27 lines
619 B
TableGen
def GPUExtensions : StandardSpec<"GPUExtensions"> {
|
|
HeaderSpec RPC = HeaderSpec<
|
|
"gpu/rpc.h",
|
|
[], // Macros
|
|
[], // Types
|
|
[], // Enumerations
|
|
[
|
|
FunctionSpec<
|
|
"rpc_host_call",
|
|
RetValSpec<VoidType>,
|
|
[ArgSpec<VoidPtr>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
|
|
>,
|
|
FunctionSpec<
|
|
"rpc_fprintf",
|
|
RetValSpec<IntType>,
|
|
[ArgSpec<FILERestrictedPtr>,
|
|
ArgSpec<ConstCharRestrictedPtr>,
|
|
ArgSpec<VoidPtr>,
|
|
ArgSpec<SizeTType>]
|
|
>,
|
|
]
|
|
>;
|
|
let Headers = [
|
|
RPC,
|
|
];
|
|
}
|