Author: joerg
Date: Tue Dec  6 10:40:57 2016
New Revision: 288822

URL: http://llvm.org/viewvc/llvm-project?rev=288822&view=rev
Log:
If clang was configured for a DEFAULT_SYSROOT and no --sysroot argument
is seen, record one with the implicit default.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=288822&r1=288821&r2=288822&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Dec  6 10:40:57 2016
@@ -4061,6 +4061,11 @@ void Clang::DumpCompilationDatabase(Comp
   Buf = "-x";
   Buf += types::getTypeName(Input.getType());
   CDB << ", \"" << escape(Buf) << "\"";
+  if (!D.SysRoot.empty() && !Args.hasArg(options::OPT__sysroot_EQ)) {
+    Buf = "--sysroot=";
+    Buf += D.SysRoot;
+    CDB << ", \"" << escape(Buf) << "\"";
+  }
   CDB << ", \"" << escape(Input.getFilename()) << "\"";
   for (auto &A: Args) {
     auto &O = A->getOption();


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to