This is an archive of the discontinued LLVM Phabricator instance.

Make ModuleDependencyCollector's method virtual (NFC)
ClosedPublic

Authored by JDevlieghere on Feb 11 2019, 1:19 PM.

Details

Summary

For reproducers in LLDB we want to hook up into the existing clang infrastructure. To make that happen we need to be able to override the ModuleDependencyCollector's methods.

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Feb 11 2019, 1:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2019, 1:19 PM
bruno added a comment.Feb 11 2019, 1:23 PM

How much of the ModuleDependencyCollector will be reused as is by LLDB? I wonder about the tradeoff versus inheriting from DependencyCollector directly.

How much of the ModuleDependencyCollector will be reused as is by LLDB? I wonder about the tradeoff versus inheriting from DependencyCollector directly.

We reuse the attachTo methods, which in turn use the ModuleDependencyListener, ModuleDependencyPPCallbacks and ModuleDependencyMMCallbacks. Do you think it's worth re-implementing those?

bruno added a comment.Feb 11 2019, 2:43 PM

Not really. Would making only the attachTo* methods virtual enough though?

Not really. Would making only the attachTo* methods virtual enough though?

You mean making them not virtual? They're the only ones I don't override.

I missed that the DependencyCollector already marks them virtual, you are just making it obvious here. I think you can omit the ones that are already virtual and only add to the ones that are on the intend of this patch.

Alright, I'll split this up in two patches

bruno accepted this revision.Feb 12 2019, 1:25 PM

LGTM!

This revision is now accepted and ready to land.Feb 12 2019, 1:25 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2019, 1:44 PM