This is an archive of the discontinued LLVM Phabricator instance.

Add --reproduce to lld/wasm.
ClosedPublic

Authored by ruiu on May 20 2019, 8:41 PM.

Details

Summary

--reproduce is a convenient option for debugging. If you invoke lld
with --reproduce=repro.tar, it creates repro.tar with all input
files and the command line options given to the linker, so that it is
very easy to run lld with the exact same inputs.

ELF and Windows lld have this option.

This patch add that option to lld/wasm.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.May 20 2019, 8:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2019, 8:41 PM
grimar added a subscriber: grimar.May 21 2019, 12:54 AM

Few cosmetic issues I noticed are below.

lld/wasm/Driver.cpp
31 ↗(On Diff #200395)

Unsorted.

555 ↗(On Diff #200395)

--reproduce

lld/wasm/InputFiles.cpp
35 ↗(On Diff #200395)

Seems Loading should be lower case for conistency with log in dumpInfo() below.

lld/wasm/InputFiles.h
36 ↗(On Diff #200395)

Use double dashes for consistency with the other comments?

ruiu marked 2 inline comments as done.May 21 2019, 1:04 AM
ruiu added inline comments.
lld/wasm/Driver.cpp
31 ↗(On Diff #200395)

It's actually sorted ASCIIbetically.

lld/wasm/InputFiles.cpp
35 ↗(On Diff #200395)

Well, true, but we shouldn't fix that in this patch.

ruiu updated this revision to Diff 200421.May 21 2019, 1:04 AM
  • address review comments
sbc100 accepted this revision.May 21 2019, 2:03 AM
sbc100 added inline comments.
lld/test/wasm/reproduce.ll
9 ↗(On Diff #200421)

If you are trying to verify the contents here why not something more explicit like tar t repro.tar | FileCheck %s -check-prefix=CONTENTS?

lld/wasm/InputFiles.cpp
58 ↗(On Diff #200421)

Seems unrelated. Also, I kind of like the vertical separation here.

This revision is now accepted and ready to land.May 21 2019, 2:03 AM

The convention I've been using is to prefex the commit subject with [WebAssembly]

ruiu marked 2 inline comments as done.May 21 2019, 4:45 AM
ruiu added inline comments.
lld/test/wasm/reproduce.ll
9 ↗(On Diff #200421)

Done.

lld/wasm/InputFiles.cpp
58 ↗(On Diff #200421)

Done.

This revision was automatically updated to reflect the committed changes.