Pass TargetFrontendConfig by value rather than by reference.

This commit is contained in:
Dan Gohman
2018-11-07 15:52:52 -08:00
parent b476f823d4
commit fd875c3f5a

View File

@@ -179,17 +179,17 @@ pub struct TargetFrontendConfig {
impl TargetFrontendConfig {
/// Get the pointer type of this target.
pub fn pointer_type(&self) -> ir::Type {
pub fn pointer_type(self) -> ir::Type {
ir::Type::int(u16::from(self.pointer_bits())).unwrap()
}
/// Get the width of pointers on this target, in units of bits.
pub fn pointer_bits(&self) -> u8 {
pub fn pointer_bits(self) -> u8 {
self.pointer_width.bits()
}
/// Get the width of pointers on this target, in units of bytes.
pub fn pointer_bytes(&self) -> u8 {
pub fn pointer_bytes(self) -> u8 {
self.pointer_width.bytes()
}
}