gimple

Playing with gcc's intermediate GIMPLE format

混江龙づ霸主 提交于 2020-01-22 12:00:30
问题 According to this article gcc uses several intermediate formats before generating code. I read that the GIMPLE format uses three address code, which seems to be the easiest intermediate language to use. But I need some more detail, as I need to build a tool that can take the intermediate code and insert some code to it before generating the final code. For this I first need to know how can I even generate the GIMPLE format code and save it in a file. So I'm looking for some documents and

Use gcc plugins to modify the order of variable declarations

家住魔仙堡 提交于 2019-12-24 03:23:26
问题 I know this is very hard to do, and that I should avoid that, but I have my reasons for this. I want to modify the order of some field declarations in compilation time, for example : class A { char c; int i; } must turn to : class A { int i; char c; } if I chose to swap the order of i and c , I want to know how to change the location of a field declaration having its tree Anyone know how can I do this ?? thanks ! I use the g++ 4.9.2 version of plugins 回答1: If I was going to try this, I would

Use gcc plugins to modify the order of variable declarations

烂漫一生 提交于 2019-12-24 03:23:19
问题 I know this is very hard to do, and that I should avoid that, but I have my reasons for this. I want to modify the order of some field declarations in compilation time, for example : class A { char c; int i; } must turn to : class A { int i; char c; } if I chose to swap the order of i and c , I want to know how to change the location of a field declaration having its tree Anyone know how can I do this ?? thanks ! I use the g++ 4.9.2 version of plugins 回答1: If I was going to try this, I would

Playing with gcc's intermediate GIMPLE format

a 夏天 提交于 2019-12-03 06:28:37
According to this article gcc uses several intermediate formats before generating code. I read that the GIMPLE format uses three address code, which seems to be the easiest intermediate language to use. But I need some more detail, as I need to build a tool that can take the intermediate code and insert some code to it before generating the final code. For this I first need to know how can I even generate the GIMPLE format code and save it in a file. So I'm looking for some documents and examples. Also, if anyone has worked with such things, can I know the complexity of this task, which is to