This is an archive of the discontinued LLVM Phabricator instance.

[llvm-dwp] Add a command line option to set the target triple
ClosedPublic

Authored by pfaffe on Dec 23 2020, 12:45 AM.

Details

Summary

The llvm-dwp tool hard-codes the target triple to x86. Instead, add a command
line option for overriding the default triple to support alternative targets
such as WebAssembly as well.

Diff Detail

Event Timeline

pfaffe created this revision.Dec 23 2020, 12:45 AM
pfaffe requested review of this revision.Dec 23 2020, 12:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 23 2020, 12:45 AM

Could the target triple be identified from one of the input files instead? (in any case, this'll need test coverage)

pfaffe updated this revision to Diff 316390.Jan 13 2021, 7:22 AM

Read triple from first dwo file instead of from command line and add a test.

dblaikie accepted this revision.Jan 13 2021, 1:02 PM

Code change looks good - test might be able to be tweaked a bit before committing.

llvm/test/tools/llvm-dwp/WebAssembly/simple.test
1 ↗(On Diff #316390)

Could the wasm.dwo file be written in assembly (that's more the style used these days, compared to when I wrote the original dwp tests) and assembled with llvm-mc? (this .test file could be the assembly .s file instead - self-describing/standalone in one file rather than an opaque binary beside this .test file that doesn't describe its inputs)

This revision is now accepted and ready to land.Jan 13 2021, 1:02 PM
pfaffe updated this revision to Diff 316595.Jan 14 2021, 2:08 AM

Replace binary test with an assembly test.

pfaffe updated this revision to Diff 318496.Jan 22 2021, 5:33 AM

Rebase and improve testcase: The file can just be empty.

pfaffe updated this revision to Diff 318497.Jan 22 2021, 5:34 AM

Restore changes lost in previous patchset.

dblaikie accepted this revision.Jan 22 2021, 11:32 AM

Looks good

This revision was automatically updated to reflect the committed changes.