doru1004 added inline comments.
================ Comment at: clang/lib/CodeGen/CGDecl.cpp:1606 + CGOpenMPRuntimeGPU &RT = + *(static_cast<CGOpenMPRuntimeGPU *>(&CGM.getOpenMPRuntime())); + if (RT.isDelayedVariableLengthDecl(*this, &D)) { ---------------- ABataev wrote: > ABataev wrote: > > 1. use `static_cast<CGOpenMPRuntimeGPU &>(CGM.getOpenMPRuntime())` > > 2. It will crash if your device is not GPU. Better to make > > `getKmpcAllocShared` and `getKmpcFreeShared` virtual (just like > > `isDelayedVariableLengthDecl`) in base CGOpenMPRuntime, since it may be > > required not only for GPU-based devices. > Check the second item, please, better to make all new member function virtual > and handle it for non-GPU devices too The support I am adding is only meant for GPUs. I am not sure why we need to consider non-GPUs. There already exists a VLA handling for non-GPUs and that one should be used. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153883/new/ https://reviews.llvm.org/D153883 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits