This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Using the GCC IR
- From: "Rohit Gulati" <rgulati at cadence dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Fri, 6 Feb 2004 19:28:28 -0800
- Subject: Using the GCC IR
Hi,
?
I want to run g++ on a C++ source file and then WALK the IR generated by GCC to do further processing and finally call the backend to do its job. Basically add a linter to do specific checks in my C++ code.
?
Can I get access to the IR generated by GCC. I know how to dump the IR to file. Is there a way to access the IR in memory (walk the IR).
?
I am interested in :
1. Access all classes/structs in file scope
2. Detailed Type information (base_classes, member routines, member fields, etc)
3. Detail Routine info (statements and expressions)
4. Map objects to their source code decls (file, line, col number)
5. etc,
?
Is it possible. Is there a way to walk the GCC IR? I could not find any info on the web or gnu.org. so I am sending an email to you. This is extremely important for my next project.
?
One alternative I have is to use the EDG (Edison Compile Group) IR. They provide a nice way to walk the IR. Their primary business is frontend.
?
But I was really hoping I could use GCC IR for it. I am sure something must be out there. Just want to know what.
?
thanks
Rohit