Source code analysis of the LSS Compiler (58) node structure used by the backend

Source: Internet
Author: User

The following node structure is used to identify Code attributes at the backend of the LSS compiler. #001 #002 // node annotation extension, mainly used for code generation. #003 // #004 // Cai junsheng 2007/07/21 QQ: 9073204 #005 // #006 typedef struct {#007 unsigned listed: 1; // mark this as the root node of the tree. #008 unsigned registered: 1; // whether the register is allocated #009 unsigned emitted: 1; // identifies the output command. #010 unsigned copy: 1; // indicates the replication between registers. #011 unsigned equatable: 1; // The command that marks the temporary Unit for storing the public expression #012 unsigned spills: 1; // The register overflow flag. #013 unsigned mayrecalc: 1; // The node where the public expression can be recalculated. #014 void * State; // Save the command selection result. #015 short inst; // indicates whether the node is implemented using commands. #016 node kids [3]; // command tree compiled by the backend. #017 node Prev, next; // Command linked list. #018 node prevuse; #019 short argno; // number of parameters. #020} xnode; #021 #022 #023 typedef struct {#024 char * Name; // name generated by the compiler backend. #025 unsigned int eaddr;/* omit */#026 int offset; // indicates the stack location of the variable. #027 node lastuse; // The node that finally uses the register. #028 int usecount; // number of nodes used. #029 regnode; // storage allocation attributes. #030 symbol * wildcard; // Save the register list. #031} xsymbol; #032 back-end Generation Code. It is mainly used to calculate the attributes of the above structure. As long as all the above structures are filled in, the final code can be generated.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.