Skip to content
This repository has been archived by the owner on Oct 24, 2019. It is now read-only.

Commit

Permalink
WebAssembly: add logging when I get a BinaryExpr
Browse files Browse the repository at this point in the history
I actually do need to know what's breaking.
  • Loading branch information
zhuowei committed May 2, 2019
1 parent 5ecc83a commit 8b8f31f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/MC/WasmObjectWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ void WasmObjectWriter::recordRelocation(MCAssembler &Asm,
const auto *Inner = dyn_cast<MCSymbolRefExpr>(Expr);
if (Inner && Inner->getKind() == MCSymbolRefExpr::VK_WEAKREF)
llvm_unreachable("weakref used in reloc not yet implemented");
if (!Inner) {
fprintf(stderr, "weak check failed to get an inner:\n");
Expr->dump();
}
}

// Put any constant offset in an addend. Offsets can be negative, and
Expand Down Expand Up @@ -585,6 +589,8 @@ static const MCSymbolWasm *ResolveSymbol(const MCSymbolWasm &Symbol) {
if (Symbol.isVariable()) {
const MCExpr *Expr = Symbol.getVariableValue();
if (Expr->getKind() == MCExpr::Binary) {
fprintf(stderr, "ResolveSymbol got binary expr\n");
Expr->dump();
Expr = pullSymbol(Expr);
if (!Expr) {
llvm_unreachable("can't find a symbol in binary expression\n");
Expand Down

0 comments on commit 8b8f31f

Please sign in to comment.