[PATCH] D43197: [OpenMP] Add flag for linking runtime bitcode library

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 6 09:05:22 PST 2018

ABataev added inline comments.

Comment at: lib/Driver/ToolChains/Cuda.cpp:591
+    llvm::sys::path::append(DefaultLibPath, "lib" CLANG_LIBDIR_SUFFIX);
+    LibraryPaths.emplace_back(DriverArgs.MakeArgString(DefaultLibPath));
Maybe just `LibraryPaths.emplace_back(DefaultLibPath);`?

Comment at: lib/Driver/ToolChains/Cuda.cpp:598
+      llvm::SplitString(*LibPath, Frags,
+          StringRef(&(llvm::sys::EnvPathSeparator)));
+      for (auto Path : Frags)
Wow, never do such things! This is a pointer to non-null terminated string.
const char EnvPathSeparatorStr[] = {EnvPathSeparator, '\0'};
And use this array as a separator.

  rC Clang


More information about the cfe-commits mailing list