Skip to content

Commit f9f5e52

Browse files
committed
Eliminate some build_array_alloca
1 parent 5001e9b commit f9f5e52

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

src/emit/stylus/target.rs

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -937,11 +937,7 @@ impl<'a> TargetRuntime<'a> for StylusTarget {
937937
} => {
938938
let coinbase = bin
939939
.builder
940-
.build_array_alloca(
941-
bin.context.i8_type(),
942-
i32_const!(bin.ns.address_length as u64),
943-
"coinbase",
944-
)
940+
.build_alloca(bin.address_type(), "coinbase")
945941
.unwrap();
946942

947943
call!("block_coinbase", &[coinbase.into()], "block_coinbase");
@@ -1087,11 +1083,7 @@ impl<'a> TargetRuntime<'a> for StylusTarget {
10871083

10881084
let address = bin
10891085
.builder
1090-
.build_array_alloca(
1091-
bin.context.i8_type(),
1092-
i32_const!(bin.ns.address_length as u64),
1093-
"address",
1094-
)
1086+
.build_alloca(bin.address_type(), "address")
10951087
.unwrap();
10961088

10971089
let revert_data_len = bin
@@ -1144,11 +1136,7 @@ impl<'a> TargetRuntime<'a> for StylusTarget {
11441136
} => {
11451137
let address = bin
11461138
.builder
1147-
.build_array_alloca(
1148-
bin.context.i8_type(),
1149-
i32_const!(bin.ns.address_length as u64),
1150-
"address",
1151-
)
1139+
.build_alloca(bin.address_type(), "address")
11521140
.unwrap();
11531141

11541142
call!("contract_address", &[address.into()], "contract_address");
@@ -1218,11 +1206,7 @@ impl<'a> TargetRuntime<'a> for StylusTarget {
12181206
} => {
12191207
let address = bin
12201208
.builder
1221-
.build_array_alloca(
1222-
bin.context.i8_type(),
1223-
i32_const!(bin.ns.address_length as u64),
1224-
"address",
1225-
)
1209+
.build_alloca(bin.address_type(), "address")
12261210
.unwrap();
12271211

12281212
call!("tx_origin", &[address.into()], "tx_origin");
@@ -1237,11 +1221,7 @@ impl<'a> TargetRuntime<'a> for StylusTarget {
12371221
} => {
12381222
let address = bin
12391223
.builder
1240-
.build_array_alloca(
1241-
bin.context.i8_type(),
1242-
i32_const!(bin.ns.address_length as u64),
1243-
"address",
1244-
)
1224+
.build_alloca(bin.address_type(), "address")
12451225
.unwrap();
12461226

12471227
call!("msg_sender", &[address.into()], "msg_sender");

0 commit comments

Comments
 (0)