Completely rework the way uses are stored and attached to their declarations.
author David Nolden
()
committer David Nolden
()
commit 24b215b91647cb2ca7bbc4248a93014f2ede8202
tree 70b828bdd35dc7c56d849eb559054c9aebd2db38
parent 4875baf589b6fdd1acb45a44a4ca84ab9b686159
Completely rework the way uses are stored and attached to their declarations.
1. Make uses extremely memory-efficient by reducing each use to 5 integers stored in a vector(range + declaration-index).
2. Manage the uses locally within the context that contains them, and hold a parallel vector that eventually contains smart-ranges when available.
That way we lose no memory for the 99.99% uses that don't have smart-ranges.
3. Like done with definitions, use an intermediate structure that uses the declaration-id for the mapping from declarations to uses. That way, we will never get problems from documents
parsed in multiple versions, the declarations all share the same uses.

Now we can actually start thinking about building uses for all parsed files(If it just was faster).

25 files changed:
language/CMakeLists.txt
language/duchain/declaration.cpp
language/duchain/declaration.h
language/duchain/declaration_p.h
language/duchain/declarationid.cpp
language/duchain/declarationid.h
language/duchain/definitions.cpp
language/duchain/duchain.cpp
language/duchain/duchain.h
language/duchain/duchainutils.cpp
language/duchain/duchainutils.h
language/duchain/ducontext.cpp
language/duchain/ducontext.h
language/duchain/ducontext_p.h
language/duchain/smartconverter.cpp
language/duchain/smartconverter.h
language/duchain/topducontext.cpp
language/duchain/topducontext.h
language/duchain/use.cpp
language/duchain/use.h
language/duchain/uses.cpp [ new file with mode 0644 ]
language/duchain/uses.h [ new file with mode 0644 ]
language/interfaces/icodehighlighting.h
plugins/duchainviewer/duchainmodel.cpp
plugins/usehighlight/usehighlight.cpp