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

Hal Finkel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 15 18:52:55 PDT 2017


hfinkel added inline comments.


================
Comment at: lib/Driver/ToolChains/Cuda.cpp:442
+    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");
----------------
Naming this FullPath seems inaccurate. It's not the full path, it's the root path (which is just the root_name + root_directory, but not any directory after that).

In any case, I don't see why all of this is necessary. Can't you just have:

    SmallString<256> Name = II.getFilename();
    llvm::sys::path::replace_extension(Name, "cubin");

    const char *CubinF =
        C.addTempFile(C.getArgs().MakeArgString(Name));



https://reviews.llvm.org/D37912





More information about the cfe-commits mailing list