diff --git a/src/libclangmm/TranslationUnit.cc b/src/libclangmm/TranslationUnit.cc index 4dedf342..c957ad01 100644 --- a/src/libclangmm/TranslationUnit.cc +++ b/src/libclangmm/TranslationUnit.cc @@ -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); diff --git a/src/project.cc b/src/project.cc index 89ba5ed1..84be3991 100644 --- a/src/project.cc +++ b/src/project.cc @@ -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;