Skip to content

Commit a920e35

Browse files
committed
Shrink Expr_::ExprInlineAsm.
On 64-bit this reduces the size of `Expr_` from 144 to 64 bytes, and reduces the size of `Expr` from 176 to 96 bytes.
1 parent a5b6a9f commit a920e35

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustc/hir/lowering.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ impl<'a> LoweringContext<'a> {
12181218
alignstack,
12191219
dialect,
12201220
expn_id,
1221-
}) => hir::ExprInlineAsm(hir::InlineAsm {
1221+
}) => hir::ExprInlineAsm(P(hir::InlineAsm {
12221222
inputs: inputs.iter().map(|&(ref c, _)| c.clone()).collect(),
12231223
outputs: outputs.iter()
12241224
.map(|out| {
@@ -1236,7 +1236,7 @@ impl<'a> LoweringContext<'a> {
12361236
alignstack: alignstack,
12371237
dialect: dialect,
12381238
expn_id: expn_id,
1239-
}, outputs.iter().map(|out| self.lower_expr(&out.expr)).collect(),
1239+
}), outputs.iter().map(|out| self.lower_expr(&out.expr)).collect(),
12401240
inputs.iter().map(|&(_, ref input)| self.lower_expr(input)).collect()),
12411241
ExprKind::Struct(ref path, ref fields, ref maybe_expr) => {
12421242
hir::ExprStruct(self.lower_path(path),

src/librustc/hir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ pub enum Expr_ {
940940
ExprRet(Option<P<Expr>>),
941941

942942
/// Inline assembly (from `asm!`), with its outputs and inputs.
943-
ExprInlineAsm(InlineAsm, Vec<P<Expr>>, Vec<P<Expr>>),
943+
ExprInlineAsm(P<InlineAsm>, HirVec<P<Expr>>, HirVec<P<Expr>>),
944944

945945
/// A struct or struct-like variant literal expression.
946946
///

0 commit comments

Comments
 (0)