[Openmp-commits] [openmp] [Libomptarget][NFC] Remove use of VLA in the AMDGPU plugin (PR #69761)

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Fri Oct 20 12:56:39 PDT 2023


================
@@ -2869,15 +2869,14 @@ struct AMDGPUPluginTy final : public GenericPluginTy {
         if (Status != HSA_STATUS_SUCCESS)
           return Status;
 
-        // TODO: This is not allowed by the standard.
-        char ISAName[Length];
-        Status = hsa_isa_get_info_alt(ISA, HSA_ISA_INFO_NAME, ISAName);
+        llvm::SmallVector<char> ISAName(Length);
----------------
jhuber6 wrote:

Okay, this is something I wasn't sure about. The documentation states that the length does not include the null terminator, but printing the Length suggested that it's not true. Given that I'm not trusting the documentation I instead wrote it in such a way that it will work regardless by trimming any null terminators at the end if they exist.

https://github.com/llvm/llvm-project/pull/69761


More information about the Openmp-commits mailing list