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

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

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

tools/dsymutil/CFBundle.h
1

Missing license?

aprantl added inline comments.Nov 28 2017, 12:42 PM
tools/dsymutil/CFBundle.cpp
119

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

tools/dsymutil/CFBundle.h
5

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

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 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
55

comment what the class is for?

65

comment what this function is doing?

77

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

87

move into declaration?

100

comment what this function is doing?

183

perhaps move into declaration?

189

move into declaration?

194

move into declaration?

239

move into declaration?

245

move into declaration?

267

should this be the doxygen comment for the function?

tools/dsymutil/CFBundle.h
5

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.