This is an archive of the discontinued LLVM Phabricator instance.

Add llvm-style RTTI to ObjectFile hierarchy
ClosedPublic

Authored by labath on Jul 30 2019, 7:41 AM.

Details

Summary

On the heels of D62934, this patch uses the same approach to introduce
llvm RTTI support to the ObjectFile hierarchy. It also replaces the
existing uses of GetPluginName doing run-time type checks with
llvm::dyn_cast and friends.

This formally introduces new dependencies from some other plugins to
ObjectFile plugins. However, I believe this is fine because:

  • these dependencies were already kind of there, and the only reason we could get away with not modeling them explicitly was because the code was relying on magically knowing what will GetPluginName() return for a particular kind of object files.
  • the dependencies themselves are logical (it makes sense for SymbolVendorELF to depend on ObjectFileELF), or at least don't actively get in the way (the JitLoaderGDB->MachO thing).
  • they don't introduce any new dependency loops as ObjectFile plugins don't depend on any other plugins

Event Timeline

labath created this revision.Jul 30 2019, 7:41 AM
JDevlieghere accepted this revision.Jul 30 2019, 9:08 AM
This revision is now accepted and ready to land.Jul 30 2019, 9:08 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2019, 4:59 AM