Put TargetIsa's emit_inst under a "testing_hooks" feature. (#531)
* Put TargetIsa's emit_inst under a "testing_hooks" feature. In practice, TargetIsa's emit_inst pulls in its own instantiation of the target-specifi `emit_inst` functions, which can be quite large, and LTO doesn't eliminate them because they're held live by TargetIsa's vtable. Fortunately, this function is only used by tests, so we can put it behind a feature flag. Fixes #530. * Add comments for `emit_inst` to clarify its purpose.
This commit is contained in:
@@ -7,7 +7,9 @@ mod registers;
|
||||
pub mod settings;
|
||||
|
||||
use super::super::settings as shared_settings;
|
||||
use binemit::{emit_function, CodeSink, MemoryCodeSink};
|
||||
#[cfg(feature = "testing_hooks")]
|
||||
use binemit::CodeSink;
|
||||
use binemit::{emit_function, MemoryCodeSink};
|
||||
use ir;
|
||||
use isa::enc_tables::{lookup_enclist, Encodings};
|
||||
use isa::Builder as IsaBuilder;
|
||||
@@ -98,6 +100,7 @@ impl TargetIsa for Isa {
|
||||
abi::allocatable_registers(func)
|
||||
}
|
||||
|
||||
#[cfg(feature = "testing_hooks")]
|
||||
fn emit_inst(
|
||||
&self,
|
||||
func: &ir::Function,
|
||||
|
||||
Reference in New Issue
Block a user