Silently ignore multiple registration of files
This commit is contained in:
parent
d14965b24e
commit
6dd85cb7a7
5 changed files with 23 additions and 6 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include <cppast/detail/assert.hpp>
|
||||
#include <cppast/cpp_entity.hpp>
|
||||
#include <cppast/cpp_entity_kind.hpp>
|
||||
#include <cppast/cpp_file.hpp>
|
||||
|
||||
using namespace cppast;
|
||||
|
||||
|
|
@ -33,6 +34,13 @@ void cpp_entity_index::register_definition(cpp_entity_id
|
|||
}
|
||||
}
|
||||
|
||||
bool cpp_entity_index::register_file(cpp_entity_id id,
|
||||
type_safe::object_ref<const cpp_file> file) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
return map_.emplace(std::move(id), value(file, true)).second;
|
||||
}
|
||||
|
||||
void cpp_entity_index::register_forward_declaration(
|
||||
cpp_entity_id id, type_safe::object_ref<const cpp_entity> entity) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue