Cluster-pod-args: Reuse struct types
Fixes https://github.com/google/clspv/issues/104
diff --git a/lib/ClusterPodKernelArgumentsPass.cpp b/lib/ClusterPodKernelArgumentsPass.cpp
index 230096d..e60ea83 100644
--- a/lib/ClusterPodKernelArgumentsPass.cpp
+++ b/lib/ClusterPodKernelArgumentsPass.cpp
@@ -132,8 +132,8 @@
}
// Put the pointer arguments first, and then POD arguments struct last.
- auto PodArgsStructTy =
- StructType::create(PodArgTys, F->getName().str() + ".podargs");
+ // Use StructType::get so we reuse types where possible.
+ auto PodArgsStructTy = StructType::get(Context, PodArgTys);
SmallVector<Type *, 8> NewFuncParamTys(PtrArgTys);
NewFuncParamTys.push_back(PodArgsStructTy);