Address ODR violation spot by @Riatre and work around .o .a in compile_commands.json

This commit is contained in:
Fangrui Song 2018-02-07 10:27:30 -08:00
parent 4815b35ff9
commit 9b0256355e
2 changed files with 5 additions and 5 deletions

View File

@ -241,6 +241,11 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry(
// This is most likely the file path we will be passing to clang.
if (EndsWith(arg, base_name))
arg = cleanup_maybe_relative_path(arg);
// TODO Exclude .a .o to make link command in compile_commands.json work.
// Also, clang_parseTranslationUnit2FullArgv does not seem to accept
// multiple source filenames.
else if (EndsWith(arg, ".a") || EndsWith(arg, ".o"))
continue;
}
result.args.push_back(arg);

View File

@ -357,11 +357,6 @@ Maybe<QueryVarId> GetQueryVarIdFromUsr(QueryDatabase* query_db,
} // namespace
template <>
bool Maybe<QueryLocation>::has_value() const {
return storage.range.start.line >= 0;
}
Maybe<QueryFileId> QueryDatabase::GetQueryFileIdFromPath(
const std::string& path) {
return ::GetQueryFileIdFromPath(this, path, false);