[PATCH] D17784: Check if LLVM_PREFIX is defined before using it.

Chaoren Lin via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 1 15:00:02 PST 2016


chaoren created this revision.
chaoren added reviewers: kparzysz, bkramer.
chaoren added a subscriber: cfe-commits.

LLVM_PREFIX could be undefined if CMAKE_INSTALL_PREFIX were set to empty.

http://reviews.llvm.org/D17784

Files:
  lib/Driver/ToolChains.cpp

Index: lib/Driver/ToolChains.cpp
===================================================================
--- lib/Driver/ToolChains.cpp
+++ lib/Driver/ToolChains.cpp
@@ -2607,9 +2607,11 @@
   if (getVFS().exists(InstallRelDir = InstalledDir + "/../target"))
     return InstallRelDir;
 
+#ifdef LLVM_PREFIX
   std::string PrefixRelDir = std::string(LLVM_PREFIX) + "/target";
   if (getVFS().exists(PrefixRelDir))
     return PrefixRelDir;
+#endif
 
   return InstallRelDir;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17784.49553.patch
Type: text/x-patch
Size: 472 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160301/b92f4bf1/attachment.bin>


More information about the cfe-commits mailing list