Add the -o flag to specify an output path for llvm-bitcode-strip.
This matches the interface to the Xcode bitcode_strip tool.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I was going to suggest that the option should be documented in the llvm-bitcode-strip command guide, but it looks like that this documentation hasn't been written yet :(
llvm/test/tools/llvm-objcopy/MachO/bitcode-strip.test | ||
---|---|---|
2 | ||
5 | You shouldn't just run a naked not ... without checking the error message produced by llvm-bitcode-strip | |
6 | You should check that %t2 contains the output you expect, whatever that may be. | |
30 | I suspect you only need 0 or 1 sections for the test case to be sufficient? | |
llvm/tools/llvm-objcopy/ObjcopyOptions.cpp | ||
1225 | Are you sure you want this behaviour? Prior to this patch, llvm-bitcode-strip will modify things in-place, like llvm-strip does. |
llvm/tools/llvm-objcopy/ObjcopyOptions.cpp | ||
---|---|---|
1225 | Yes, this matches the behaviour of bitcode_strip: Usage: bitcode_strip input [-r | -m | -l] [-keep_cs] -o output |
update test to check error message, remove unused sections and verify output is unchanged.
llvm/tools/llvm-objcopy/ObjcopyOptions.cpp | ||
---|---|---|
1228 | I'd change this comment: the error message already has llvm-bitcode-strip in the prefix, so no need to repeat it in the body of the message. Perhaps simply "-o is a required argument" (alternative ideas also welcome)? |