Fix argument handling for chrome

This commit is contained in:
Jacob Dufault 2017-10-18 00:02:33 -07:00
parent 3003385d76
commit 0e7c8bdf05
2 changed files with 7 additions and 10 deletions

View File

@ -33,7 +33,7 @@ TranslationUnit::TranslationUnit(Index* index,
// index->cx_index, filepath.c_str(), args.size(), args.data(),
// (unsigned)unsaved_files.size(), unsaved_files.data());
CXErrorCode error_code = clang_parseTranslationUnit2(
CXErrorCode error_code = clang_parseTranslationUnit2FullArgv(
index->cx_index, filepath.c_str(), args.data(), (int)args.size(),
unsaved_files.data(), (unsigned)unsaved_files.size(), flags, &cx_tu);

View File

@ -44,17 +44,11 @@ static const char* kBlacklist[] = {
"-MP",
"-MD",
"-MMD",
"--fcolor-diagnostics"
"--fcolor-diagnostics",
//"-s",
"-B",
//"-f",
//"-pipe",
//"-W",
// This strips path-like args but is a bit hacky.
// TODO: make sure we consume includes before stripping all path-like args.
//"/", "..",
//"-stdlib=libc++"
"/", "..",
};
// Arguments which are followed by a potentially relative path. We need to make
@ -103,6 +97,9 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry(
// correct parsing for command lines like "goma clang -c foo".
while (i < entry.args.size() && entry.args[i][0] != '-')
++i;
// Include the compiler in the args.
if (i > 0)
--i;
bool make_next_flag_absolute = false;
bool add_next_flag_quote = false;