Move some logic to  ModuleLinker::shouldLinkFromSource. NFC.