This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump][COFF][NFC] Split format-specific interfaces; add namespace
ClosedPublic

Authored by hubert.reinterpretcast on Apr 1 2020, 9:07 PM.

Details

Summary

This patch addresses, for the interfaces implemented by COFFDump.cpp, multiple issues identified with the current structure of llvm-objdump.h in the review of D72973.

This patch moves implementation details of the tool into an llvm::objdump namespace for external linkage names, splits the implementation details into separate headers for each implementation file, and uses qualified names when declaring members of the llvm::objdump namespace in place of leaving the namespace definition open.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2020, 9:07 PM

COFFDump.h: Apply clang-format changes for namespace end

Hopefully get arc to upload full diff

MaskRay accepted this revision.Apr 1 2020, 9:37 PM

LGTM.

llvm/tools/llvm-objdump/llvm-objdump.cpp
78

Add a new line before namespace llvm

This revision is now accepted and ready to land.Apr 1 2020, 9:37 PM
jhenderson accepted this revision.Apr 2 2020, 12:49 AM

LGTM, with or without my comments addressed.

llvm/tools/llvm-objdump/COFFDump.h
14

Can't you forward-declare Error to avoid this include?

llvm/tools/llvm-objdump/llvm-objdump.cpp
49

It's probably okay to address this clang-format comment here, since you're adding a new include.

hubert.reinterpretcast marked 2 inline comments as done.Apr 2 2020, 6:27 AM

Please let me know if there is a preference to post additional patches in parts in the same style or to update this one with the changes associated with the other files when they are all done. Thanks.

llvm/tools/llvm-objdump/COFFDump.h
14

Yes, I think so. Will do.

llvm/tools/llvm-objdump/llvm-objdump.cpp
49

D72973 already plans to remove this line.

78

Will do; I'll add the same comment to D72973.

Please let me know if there is a preference to post additional patches in parts in the same style or to update this one with the changes associated with the other files when they are all done. Thanks.

Lots of small changes is fine by me, and probably even preferable overall.

hubert.reinterpretcast marked an inline comment as done.Apr 2 2020, 7:43 AM

Lots of small changes is fine by me, and probably even preferable overall.

Okay. I will address the comments on the commit (and change the patch description accordingly) if it goes smoothly. Would you like to see the other patches (if they don't have additional complications) posted for pre-commit review?

hubert.reinterpretcast marked 4 inline comments as done.
  • Address comments: Forward-declare llvm::Error; add newline
hubert.reinterpretcast retitled this revision from [llvm-objdump][NFC] Split format-specific interfaces; add namespace to [llvm-objdump][COFF][NFC] Split format-specific interfaces; add namespace.Apr 2 2020, 3:15 PM
hubert.reinterpretcast edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.

Lots of small changes is fine by me, and probably even preferable overall.

Okay. I will address the comments on the commit (and change the patch description accordingly) if it goes smoothly. Would you like to see the other patches (if they don't have additional complications) posted for pre-commit review?

Yes, please.