If clang was configured for a DEFAULT_SYSROOT and no --sysroot argument

is seen, record one with the implicit default.

llvm-svn: 288822
This commit is contained in:
Joerg Sonnenberger 2016-12-06 16:40:57 +00:00
parent cbc872549c
commit 0599a935e5
1 changed files with 5 additions and 0 deletions

View File

@ -4061,6 +4061,11 @@ void Clang::DumpCompilationDatabase(Compilation &C, StringRef Filename,
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();