Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 945cb79

Browse files
committed
WebAssembly: add logging when I get a BinaryExpr
I actually do need to know what's breaking.
1 parent 0c04b1c commit 945cb79

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/MC/WasmObjectWriter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,10 @@ void WasmObjectWriter::recordRelocation(MCAssembler &Asm,
480480
const auto *Inner = dyn_cast<MCSymbolRefExpr>(Expr);
481481
if (Inner && Inner->getKind() == MCSymbolRefExpr::VK_WEAKREF)
482482
llvm_unreachable("weakref used in reloc not yet implemented");
483+
if (!Inner) {
484+
fprintf(stderr, "weak check failed to get an inner:\n");
485+
Expr->dump();
486+
}
483487
}
484488

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

0 commit comments

Comments
 (0)