This is an archive of the discontinued LLVM Phabricator instance.

[llvm-dwarfdump] Interface cleanup. NFC
ClosedPublic

Authored by MaskRay on Apr 9 2020, 6:32 PM.

Details

Summary

This patch moves interface declarations into llvm-dwarfdump.h and wrap
declarations in anonymous namespaces as appropriate. At the same time,
the externals are moved into the llvm::dwarfdump namespace`.

Diff Detail

Event Timeline

MaskRay created this revision.Apr 9 2020, 6:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 9 2020, 6:32 PM
djtodoro accepted this revision.Apr 10 2020, 1:44 AM

This looks good (from my side). Thanks.

This revision is now accepted and ready to land.Apr 10 2020, 1:44 AM
This revision was automatically updated to reflect the committed changes.

I'd have rejected this change, partly, if I'd seen this before the commit. I REALLY hate it when definitions and declarations for functions are not in matching header/source files. Why did the declarations relating to the SectionSizes.cpp stuff get moved into an unrelated header?

I'd have rejected this change, partly, if I'd seen this before the commit. I REALLY hate it when definitions and declarations for functions are not in matching header/source files. Why did the declarations relating to the SectionSizes.cpp stuff get moved into an unrelated header?

Not sure whether SectionSizes.cpp should be placed in its own file. Merging it into Statistics.cpp and adding a Statistics.h, does that sound good to you?

definitions and declarations for functions are not in matching header/source files

The previous state might be worse to you? A .cpp file made the declarations...

I'd have rejected this change, partly, if I'd seen this before the commit. I REALLY hate it when definitions and declarations for functions are not in matching header/source files. Why did the declarations relating to the SectionSizes.cpp stuff get moved into an unrelated header?

Not sure whether SectionSizes.cpp should be placed in its own file. Merging it into Statistics.cpp and adding a Statistics.h, does that sound good to you?

Merging the two seems reasonable in this case, since they're all to do with statistics, although I do find LLVM's propensity to put everything in one monolitihic file (see virtually every one of the tools in the tools directory) hard to work with.

Is there not already a Statistics.h?

definitions and declarations for functions are not in matching header/source files

The previous state might be worse to you? A .cpp file made the declarations...

I missed that somehow. Thanks. That should indeed be fixed by putting it in a header.

I'd have rejected this change, partly, if I'd seen this before the commit. I REALLY hate it when definitions and declarations for functions are not in matching header/source files. Why did the declarations relating to the SectionSizes.cpp stuff get moved into an unrelated header?

Not sure whether SectionSizes.cpp should be placed in its own file. Merging it into Statistics.cpp and adding a Statistics.h, does that sound good to you?

Merging the two seems reasonable in this case, since they're all to do with statistics, although I do find LLVM's propensity to put everything in one monolitihic file (see virtually every one of the tools in the tools directory) hard to work with.

OK.

Is there not already a Statistics.h?

Statistics.h does not exist. llvm-dwarfdump.h is now the only header.

definitions and declarations for functions are not in matching header/source files

The previous state might be worse to you? A .cpp file made the declarations...

I missed that somehow. Thanks. That should indeed be fixed by putting it in a header.