Custom legalization for global_addr.

The code to compute the address of a global variable depends on the kind
of variable, so custom legalization is required.

- Add a legalizer::globalvar module which exposes an
  expand_global_addr() function. This module is likely to grow as we add
  more types of global variables.
- Add a ArgumentPurpose::VMContext enumerator. This is used to represent
  special 'vmctx' arguments that are used as base pointers for vmctx
  globals.
This commit is contained in:
Jakob Stoklund Olesen
2017-08-18 09:08:41 -07:00
parent 5dba00b761
commit f2ebabaf5f
7 changed files with 127 additions and 12 deletions

View File

@@ -373,7 +373,7 @@ calling convention:
retlist : arglist
arg : type [argext] [argspecial]
argext : "uext" | "sext"
argspecial: "sret" | "link" | "fp" | "csr"
argspecial: "sret" | "link" | "fp" | "csr" | "vmctx"
callconv : `string`
Arguments and return values have flags whose meaning is mostly target