Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] ICproject.getReferences(Ibinding), exist something similar?

Below is a link to an overview on how to access information about c/c++ code, it contains a few code examples that may be helpful:




From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Daniel.Barrientos@xxxxxxxxxxxxxx
Sent: Thursday, October 27, 2011 14:27
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] ICproject.getReferences(Ibinding), exist something similar?
Importance: Low


Hello everyone,

I am using CDT parser to implement some Code Static Analysis in my project.

But now I am facing a problem. I have a header file that defines:


Void Function1();

Void Function2();


I also have 2 c files:


Void whatever1(){





Void whatever2(){





I want to detect if functions are used to determine if code can be optimized:

Until now I use for example:

IBinding functionname_binding=function.getName().resolveBinding();



That works when I analyse Cfile1 or Cfile2.

So I ask: Ist everyfunction declared in header used in TranslationUnit that we analyse now?



But I would like to ask CDT: Ist everyfunction declared in header used in the project that we analyse now?



Unfortunately, I didn’t find a method like Cproject.getReferences(Ibinding) and when I make:

For all translation_unit:



it does not work because functionname_binding is the instance created previously to make the loop.


Can you help me on this??





Daniel Barrientos

BMW EF-612, Softwareentwicklung und -test
Geb 79.6 2.Stock Raum 36

Tel:     +49-89-382-21886
Mobil: +49 176 601 21886





Back to the top