mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-07 17:32:14 +00:00
Fix argument handling for chrome
This commit is contained in:
parent
3003385d76
commit
0e7c8bdf05
@ -33,7 +33,7 @@ TranslationUnit::TranslationUnit(Index* index,
|
|||||||
// index->cx_index, filepath.c_str(), args.size(), args.data(),
|
// index->cx_index, filepath.c_str(), args.size(), args.data(),
|
||||||
// (unsigned)unsaved_files.size(), unsaved_files.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(),
|
index->cx_index, filepath.c_str(), args.data(), (int)args.size(),
|
||||||
unsaved_files.data(), (unsigned)unsaved_files.size(), flags, &cx_tu);
|
unsaved_files.data(), (unsigned)unsaved_files.size(), flags, &cx_tu);
|
||||||
|
|
||||||
|
@ -44,17 +44,11 @@ static const char* kBlacklist[] = {
|
|||||||
"-MP",
|
"-MP",
|
||||||
"-MD",
|
"-MD",
|
||||||
"-MMD",
|
"-MMD",
|
||||||
"--fcolor-diagnostics"
|
"--fcolor-diagnostics",
|
||||||
|
|
||||||
//"-s",
|
// This strips path-like args but is a bit hacky.
|
||||||
|
|
||||||
"-B",
|
|
||||||
//"-f",
|
|
||||||
//"-pipe",
|
|
||||||
//"-W",
|
|
||||||
// TODO: make sure we consume includes before stripping all path-like args.
|
// 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
|
// 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".
|
// correct parsing for command lines like "goma clang -c foo".
|
||||||
while (i < entry.args.size() && entry.args[i][0] != '-')
|
while (i < entry.args.size() && entry.args[i][0] != '-')
|
||||||
++i;
|
++i;
|
||||||
|
// Include the compiler in the args.
|
||||||
|
if (i > 0)
|
||||||
|
--i;
|
||||||
|
|
||||||
bool make_next_flag_absolute = false;
|
bool make_next_flag_absolute = false;
|
||||||
bool add_next_flag_quote = false;
|
bool add_next_flag_quote = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user