[PATCH] D37912: [OpenMP] Bugfix: output file name drops the absolute path where full path is needed.

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 15 11:29:28 PDT 2017


gtbercea created this revision.

When composing the output file name, the path to the file is being dropped. The full path is required.


Repository:
  rL LLVM

https://reviews.llvm.org/D37912

Files:
  lib/Driver/ToolChains/Cuda.cpp


Index: lib/Driver/ToolChains/Cuda.cpp
===================================================================
--- lib/Driver/ToolChains/Cuda.cpp
+++ lib/Driver/ToolChains/Cuda.cpp
@@ -438,11 +438,13 @@
     if (!II.isFilename())
       continue;
 
-    SmallString<256> Name = llvm::sys::path::filename(II.getFilename());
+    SmallString<256> Name = llvm::sys::path::relative_path(II.getFilename());
+    SmallString<256> FullPath = llvm::sys::path::root_path(II.getFilename());
     llvm::sys::path::replace_extension(Name, "cubin");
+    llvm::sys::path::append(FullPath, Name);
 
     const char *CubinF =
-        C.addTempFile(C.getArgs().MakeArgString(Name));
+        C.addTempFile(C.getArgs().MakeArgString(FullPath));
 
     CmdArgs.push_back(CubinF);
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37912.115437.patch
Type: text/x-patch
Size: 763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170915/847cc3d7/attachment.bin>


More information about the cfe-commits mailing list