Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] How to differenciate a call to a function from a referencing its address?

Hi,

Let's assume I have a function F().
In the program it can be referenced in this way

void B
{
  void * addr = F; // or &F;
}

How can I differenciate this from the real call to F() using index or AST?

Let's assume I have an IIndexName for B.
I can get the list of enclosed names:

IIndexName funcB = ...
IIndexName[] refs = funcB.getEnclosedNames();
for(IIndexName ref: refs)
{
  IBinding refBinding = index.findBinding(ref);
  if( refBinding instanceof IFunction )
  {
     // How to know that ref is not call?
  }
}

Dmitry


Back to the top