Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] How to figure out which function is using macro with index only


Here is the problem I'm trying to resolve:
Let's assume there is a function that uses a macro.
I need to find out which function is using a macro with index only.
I can get the list of all the names of particular file with
IIndedFile.findNames(int offset, int length).
This list will contain the macros (PDOMMacroDefinition and
PDOMMacroReference) at the end of the list (after all other names).
The problem is that I cannot figure out which function uses a macro:
- PDOMCFunction.getFunctionScope() returns null, so I cannot get
offset and length of the function body. I.e. I cannot use
IIndedFile.findNames(int offset, int length).
- PDOMName.getEclosedNames for a function does not return any macro
- IIndex.findReferncies() for PDOMMacro or PDOMMacroContainer returns
the PDOMMacroReferenceName which in turn returns PDOMMacroContainer as
its binding.

Is there any way to deal with this function-to-macro usage?


Back to the top