Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] what exactly is stored in the index?


On Fri, Jan 4, 2013 at 1:27 AM, Nathan Ridge <zeratul976@xxxxxxxxxxx> wrote:

Hi,

I'm having trouble understanding what exactly is stored in the index.

On the one hand, it seems the index is meant to store information about
non-local entities only, because these are the entities of interest
to someone who needs information about something in a header file.
This is corroborated by the first few lines of
PDOMCPPLinkage.adaptOrAddParent(), where a binding whose owner is a
function (i.e. a local binding) is rejected (unless it's a template
parameter).

This is exactly the idea. 

On the other hand, when I run the indexer, I see
PDOMLinkage.addBinding() being called for every name in every file,
even local names.

Are these two things not in conflict with each other?

For example, consider the following code:


template <typename T> class A {};

void f()
{
    typedef int Int;
    A<Int> a;
}


When this code is indexed, the binding for the template-id 'A<Int>'
is stored in the index (i.e. PDOMLinkage.addBinding() is called on it).
However, when the marshalling process gets to storing the template
argument 'Int', it is not stored because it's a local binding (its
owner is the function 'f').

It seems that the class instance A<Int> should not be stored in the index, but there should be a PDOMName representing 'A' in 'A<Int> a;' 

This gives rise to bug 397345 [1]. I am trying to fix it, but I feel
that I need to understand the underlying concepts before I can fix it.

Any insights are appreciated!

Thanks,
Nate

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=397345

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

-sergey 


Back to the top