This is an archive of the discontinued LLVM Phabricator instance.

[dsymutil] Upstream getBundleInfo implementation
ClosedPublic

Authored by JDevlieghere on Nov 20 2017, 6:12 AM.

Details

Summary

This patch implements getBundleInfo, which uses CoreFoundation to
obtain information about the CFBundle. This information is needed to
populate the Plist in the dSYM bundle.

This change only applies to darwin and is an NFC as far as other
platforms are concerned.

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Nov 20 2017, 6:12 AM
vsk edited edge metadata.Nov 28 2017, 10:47 AM

Thanks for sending this out! Are there tests?

tools/dsymutil/CFBundle.cpp
20 ↗(On Diff #123574)

Why not define CFReleaser as a std::unique_ptr with a custom deleter? That would drop support for get_address, but it looks dead anyway.

91 ↗(On Diff #123574)

Why do the subclasses of CFReleaser<T> need virtual destructors?

tools/dsymutil/CFBundle.h
1 ↗(On Diff #123574)

Missing license?

aprantl added inline comments.Nov 28 2017, 12:42 PM
tools/dsymutil/CFBundle.cpp
119 ↗(On Diff #123574)

Capitalize according to LLVM coding guidelines? (This applies to the entire file)

tools/dsymutil/CFBundle.h
5 ↗(On Diff #123574)

does this only work when __APPLE__ is set? Otherwise, this would be a better fit for Support since it might be useful for other tools, too.

7 ↗(On Diff #123574)

Should this return a struct instead?

  • Use std::unique_ptr with customer deleter.
  • Add ASCII art for license.
  • Conform CF code to LLVM's coding standards.
JDevlieghere marked 5 inline comments as done.Nov 29 2017, 5:54 AM
JDevlieghere added inline comments.
tools/dsymutil/CFBundle.h
5 ↗(On Diff #123574)

On non __APPLE__ the function returns the default ("1" and "1.0"). The advantage of keeping this here is that we only have to link dsymutil against CoreFoundation. Do you think it's worth the trade-off?

aprantl accepted this revision.Nov 29 2017, 9:08 AM

Couple of stylistic comments, otherwise this looks good.

tools/dsymutil/CFBundle.cpp
54 ↗(On Diff #124731)

comment what the class is for?

64 ↗(On Diff #124731)

comment what this function is doing?

76 ↗(On Diff #124731)

It might make sense to move all these short and undocumented functions into the class declaration.

86 ↗(On Diff #124731)

move into declaration?

99 ↗(On Diff #124731)

comment what this function is doing?

182 ↗(On Diff #124731)

perhaps move into declaration?

188 ↗(On Diff #124731)

move into declaration?

193 ↗(On Diff #124731)

move into declaration?

238 ↗(On Diff #124731)

move into declaration?

244 ↗(On Diff #124731)

move into declaration?

266 ↗(On Diff #124731)

should this be the doxygen comment for the function?

tools/dsymutil/CFBundle.h
5 ↗(On Diff #123574)

The extra dependency is a pretty strong argument for keeping it in dsymutil, thanks!

This revision is now accepted and ready to land.Nov 29 2017, 9:08 AM
  • Feedback Adrian
  • Remove dead code
JDevlieghere marked 14 inline comments as done.Nov 29 2017, 10:32 AM
vsk accepted this revision.Nov 29 2017, 10:42 AM

Thanks, lgtm!

This revision was automatically updated to reflect the committed changes.