aboutsummaryrefslogtreecommitdiff
path: root/libc/startup
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-06-19 15:00:04 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2023-06-20 15:22:37 -0500
commit964a535bfa77b491f5ad11222b419710795f0ffb (patch)
tree00cdbf3bb63e3a771b15312c6c9d260f1bbc10a2 /libc/startup
parent6eca120dd8d3ec55bf8dc00b45366e8596359be3 (diff)
downloadllvm-964a535bfa77b491f5ad11222b419710795f0ffb.zip
llvm-964a535bfa77b491f5ad11222b419710795f0ffb.tar.gz
llvm-964a535bfa77b491f5ad11222b419710795f0ffb.tar.bz2
[libc] Remove flexible array and replace with a template
Currently the implementation of the RPC interface requires a flexible struct. This caused problems when compilling the RPC server with GCC as would be required if trying to export the RPC server interface. This required that we either move to the `x[1]` workaround or make it a template parameter. While just using `x[1]` would be much less noisy, this is technically undefined behavior. For this reason I elected to use templates. The downside to using templates is that the server code must now be able to handle multiple different types at runtime. I was unable to find a good solution that didn't rely on type erasure so I simply branch off of the given value. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D153304
Diffstat (limited to 'libc/startup')
-rw-r--r--libc/startup/gpu/amdgpu/start.cpp1
-rw-r--r--libc/startup/gpu/nvptx/start.cpp1
2 files changed, 0 insertions, 2 deletions
diff --git a/libc/startup/gpu/amdgpu/start.cpp b/libc/startup/gpu/amdgpu/start.cpp
index 8d85fe1..9a99955 100644
--- a/libc/startup/gpu/amdgpu/start.cpp
+++ b/libc/startup/gpu/amdgpu/start.cpp
@@ -42,7 +42,6 @@ _begin(int argc, char **argv, char **env, void *rpc_shared_buffer) {
// We need to set up the RPC client first in case any of the constructors
// require it.
__llvm_libc::rpc::client.reset(__llvm_libc::rpc::DEFAULT_PORT_COUNT,
- __llvm_libc::gpu::get_lane_size(),
rpc_shared_buffer);
// We want the fini array callbacks to be run after other atexit
diff --git a/libc/startup/gpu/nvptx/start.cpp b/libc/startup/gpu/nvptx/start.cpp
index fdd3c43..90f0049 100644
--- a/libc/startup/gpu/nvptx/start.cpp
+++ b/libc/startup/gpu/nvptx/start.cpp
@@ -46,7 +46,6 @@ _begin(int argc, char **argv, char **env, void *rpc_shared_buffer) {
// We need to set up the RPC client first in case any of the constructors
// require it.
__llvm_libc::rpc::client.reset(__llvm_libc::rpc::DEFAULT_PORT_COUNT,
- __llvm_libc::gpu::get_lane_size(),
rpc_shared_buffer);
// We want the fini array callbacks to be run after other atexit