Skip to content

Commit c59a707

Browse files
committed
adjust wasm leb128 relaxation for new MCFragment API
1 parent b1db637 commit c59a707

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class WebAssemblyAsmBackend final : public MCAsmBackend {
4646
std::unique_ptr<MCObjectTargetWriter>
4747
createObjectTargetWriter() const override;
4848

49-
std::pair<bool, bool> relaxLEB128(MCLEBFragment &LF,
49+
std::pair<bool, bool> relaxLEB128(MCFragment &LF,
5050
int64_t &Value) const override;
5151

5252
bool writeNopData(raw_ostream &OS, uint64_t Count,
@@ -75,9 +75,9 @@ WebAssemblyAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
7575
return Infos[Kind - FirstTargetFixupKind];
7676
}
7777

78-
std::pair<bool, bool> WebAssemblyAsmBackend::relaxLEB128(MCLEBFragment &LF,
78+
std::pair<bool, bool> WebAssemblyAsmBackend::relaxLEB128(MCFragment &LF,
7979
int64_t &Value) const {
80-
const MCExpr &Expr = LF.getValue();
80+
const MCExpr &Expr = LF.getLEBValue();
8181
if (Expr.getKind() == MCExpr::ExprKind::SymbolRef) {
8282
const MCSymbolRefExpr &SymExpr = llvm::cast<MCSymbolRefExpr>(Expr);
8383
if (static_cast<WebAssembly::Specifier>(SymExpr.getSpecifier()) ==
@@ -88,8 +88,7 @@ std::pair<bool, bool> WebAssemblyAsmBackend::relaxLEB128(MCLEBFragment &LF,
8888
}
8989
// currently, this is only used for leb128 encoded function indices
9090
// that require relocations
91-
LF.getFixups().push_back(
92-
MCFixup::create(0, &Expr, WebAssembly::fixup_uleb128_i32, Expr.getLoc()));
91+
LF.setVarFixups(MCFixup::create(0, &Expr, WebAssembly::fixup_uleb128_i32));
9392
// ensure that the stored placeholder is large enough to hold any 32-bit val
9493
Value = UINT32_MAX;
9594
return std::make_pair(true, false);

0 commit comments

Comments
 (0)