Constructors in the GIMPLE tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am working on GMC project (http://d3s.mff.cuni.cz/~sery/gmc/) and I need to “reimplement” function “__comp_ctor ”. For that I need access to GIMPLE representation of constructors. I have access to normal functions and methods through the function materialize_cgraph where they are walked through, but in this list aren’t constructors. I found that constructors could be accessed by macro TYPE_METHODS, which I used with RECORD_TYPE, but instead of returning the first method, it returned 0, although there was also ordinary method in the class except wanted constructors.

Could someone help me access constructors? (The best would be if I can access them using structures generated in materialize_cgraph.)

In the attachment there is a file which I used to generate the GIMPLE tree. (GMC won’t work with it, but you can use it to explore GIMPLE tree or to explain the situation.)

Best regards
Jan Šebetovský
-----------------------------------------
Use international language in international communication: http://www.lernu.net

#include<cstdio>

class A {
	public:
		int number;

		A():number(21) {
			number = 100;
		}

		A(int n):number(n) {}

		void echo() {
			printf("A:OK:%d\n", number);
		}
};

int main(int argc, char** argv) {
	A a(42);
	a.number = 10;
	a.echo();
	printf("OK\n");
}

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux