[PATCH] D41687: [llvm-objcopy] Add support for input types and the -I and -B flags

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 3 15:02:37 PST 2018


jakehehrlich updated this revision to Diff 128571.
jakehehrlich marked 4 inline comments as done.
jakehehrlich added a comment.

I haven't figured out a solution to the "giant nested if-statment" problem yet. There's a sense in which it's largely intractable because we have to use dynamic information to dispatch to 1 of 4 statically known functions of different types. I'm still thinking about it.

1. Added test for each -B option (as future architectures/names are added then that test can be extended)
2. Made any non-template function static (I think it was just the one)
3. Reordered Object(uint16_t) as mentioned
4. Made symbols own their names (amazingly this was as simple just replacing StringRef with std::string in one place)
5. Made addSymbol take a Twine instead of a StringRef for the symbol name (strictly more general and suits the symbol generation case used in InputBianryFormat)
6. Eh...I may be forgetting something but I only changed things that were requested. Hopefully I changed everything that was requested.


Repository:
  rL LLVM

https://reviews.llvm.org/D41687

Files:
  test/tools/llvm-objcopy/binary-input-archs.test
  test/tools/llvm-objcopy/binary-input.test
  tools/llvm-objcopy/Object.cpp
  tools/llvm-objcopy/Object.h
  tools/llvm-objcopy/llvm-objcopy.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41687.128571.patch
Type: text/x-patch
Size: 22024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180103/9d8f937b/attachment.bin>


More information about the llvm-commits mailing list