Introduce globalsym_addr.

This is an instruction used in legalization of GlobalVarData::Sym global
variables.
This commit is contained in:
Dan Gohman
2017-10-30 10:02:29 -07:00
parent cb805f704d
commit 9c54c3fff0
11 changed files with 96 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ mod memorysink;
pub use self::relaxation::relax_branches;
pub use self::memorysink::{MemoryCodeSink, RelocSink};
use ir::{Ebb, FuncRef, JumpTable, Function, Inst};
use ir::{Ebb, FuncRef, GlobalVar, JumpTable, Function, Inst};
use regalloc::RegDiversions;
/// Offset in bytes from the beginning of the function.
@@ -47,6 +47,10 @@ pub trait CodeSink {
/// Add a relocation referencing an external function at the current offset.
fn reloc_func(&mut self, Reloc, FuncRef);
/// Add a relocation referencing an external global variable symbol at the
/// current offset. This is only used for `GlobalVarData::Sym` globals.
fn reloc_globalsym(&mut self, Reloc, GlobalVar);
/// Add a relocation referencing a jump table.
fn reloc_jt(&mut self, Reloc, JumpTable);
}