[PATCH] D112284: [Clang][NFC] Clang CUDA codegen: a dyn_cast -> cast instance + clang-tidy fixes

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 25 10:48:22 PDT 2021


tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.

The description is a bit misleading. The dyn_cast->cast appears to be a minor part of this patch.
I'd separate clang-tidy cleanups into a separate patch or would just describe all of these changes as a clean-up. dyn_cast->cast is an NFC change here, too, considering that we're operating on a type of `FunctionDecl *cudaLaunchKernelFD`.



================
Comment at: clang/lib/CodeGen/CGCUDANV.cpp:240
         llvm::FunctionType::get(IntTy, CharPtrTy, false), "hipLaunchByPtr");
-  } else {
-    // cudaError_t cudaLaunch(char *);
-    return CGM.CreateRuntimeFunction(
-        llvm::FunctionType::get(IntTy, CharPtrTy, false), "cudaLaunch");
   }
+  // cudaError_t cudaLaunch(char *);
----------------
Nit: you could remove these `{...}` now, too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112284/new/

https://reviews.llvm.org/D112284



More information about the cfe-commits mailing list