diff --git a/src/clang_args b/src/clang_args index 255d22d1..76bff66f 100644 --- a/src/clang_args +++ b/src/clang_args @@ -9,9 +9,9 @@ -IC:/Program Files/LLVM/include # Use libcxx --stdlib=libc++ --nostdinc++ --IC:/Users/jacob/Desktop/superindex/indexer/libcxx/include +#-stdlib=libc++ +#-nostdinc++ +#-IC:/Users/jacob/Desktop/superindex/indexer/libcxx/include #-fms-compatibility #-fdelayed-template-parsing diff --git a/src/query.cc b/src/query.cc index 6e0b7de6..25cffb6f 100644 --- a/src/query.cc +++ b/src/query.cc @@ -113,7 +113,14 @@ QueryableVarDef::DefUpdate MapIdToUsr(const IdCache& id_cache, const VarDefDefin QueryableFile::QueryableFile(const IndexedFile& indexed) : file_id(indexed.path) { - FileId local_file_id = indexed.id_cache.file_path_to_file_id.find(indexed.path)->second; + auto it = indexed.id_cache.file_path_to_file_id.find(indexed.path); + if (it == indexed.id_cache.file_path_to_file_id.end()) { + // TODO: investigate + std::cerr << "Unable to find cached file " << indexed.path << std::endl; + return; + } + + FileId local_file_id = it->second; auto add_outline = [this, &indexed, local_file_id](Usr usr, Location location) { if (location.file_id() == local_file_id) outline.push_back(UsrRef(usr, MapIdToUsr(indexed.id_cache, location)));