Expert C++
上QQ阅读APP看书,第一时间看更新

Intermediate code generation

After all the analysis is completed, the compiler generates intermediate code that is a light version of C++ mostly C. A simple example would be the following:

class A { 
public:
int get_member() { return mem_; }
private:
int mem_;
};

After analyzing the code, intermediate code will be generated (this is an abstract example meant to show the idea of the intermediate code generation; compilers may differ in implementation)

struct A { 
int mem_;
};
int A_get_member(A* this) { return this->mem_; }