[PATCH] D40250: [OpenMP] Consistently use cubin extension for nvlink

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 20 08:46:32 PST 2017


gtbercea added inline comments.


================
Comment at: lib/Driver/ToolChains/Clang.cpp:5340
+
+    const ToolChain *CurTC = &getToolChain();
+    if (const auto *OA = dyn_cast<OffloadAction>(JA.getInputs()[I])) {
----------------
Please add a comment here describing what this entire code snippet is doing.


================
Comment at: lib/Driver/ToolChains/Cuda.cpp:431
 
-    SmallString<256> Name(II.getFilename());
-    llvm::sys::path::replace_extension(Name, "cubin");
-
-    const char *CubinF =
-        C.addTempFile(C.getArgs().MakeArgString(Name));
+    const char *CubinF = C.addTempFile(
+        C.getArgs().MakeArgString(getToolChain().getInputFilename(II)));
----------------
Is this always a cubin?


================
Comment at: lib/Driver/ToolChains/Cuda.cpp:461
+std::string CudaToolChain::getInputFilename(const InputInfo &Input) const {
+  if (OK != Action::OFK_OpenMP || Input.getType() != types::TY_Object)
+    return ToolChain::getInputFilename(Input);
----------------
When does this situation occur?


https://reviews.llvm.org/D40250





More information about the cfe-commits mailing list