Resolve regression after
MODIFY
llvm_util/llvm2alive.cpp
llvm_util/llvm2alive.cpp
@@ -398,12 +398,12 @@ public:
auto inst = make_unique<ExtractValue>(*ty, value_name(i), *val);
- auto &valty = val->getType();
+ auto *valty = &val->getType();
for (auto idx : i.indices()) {
- auto *aty = valty.getAsAggregateType();
+ auto *aty = valty->getAsAggregateType();
unsigned idx_with_paddings = aty->countPaddings(idx) + idx;
inst->addIdx(idx_with_paddings);
- valty = aty->getChild(idx_with_paddings);
+ valty = &aty->getChild(idx_with_paddings);
}
RETURN_IDENTIFIER(move(inst));

ADD
tests/alive-tv/extractvalue-padding.srctgt.ll
+%struct = type { i32, [4 x i8] }
+
+define i8 @src() {
+ %A = extractvalue %struct { i32 2, [4 x i8] c"foo\00" }, 1, 2
+ ret i8 %A
+}
+
+define i8 @tgt() {
+ ret i8 111
+}

Resolve regression after #356 (#358)