Skip to main content

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

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).

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').

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
 		 	   		  

Back to the top