Codegen: register i/o File instead of PSI for module mapping...
because there are no PSI files in FIR + LT, so missing mapping hurts IC
This commit is contained in:
@@ -241,19 +241,24 @@ public class ClassFileFactory implements OutputFileCollection {
|
||||
@NotNull
|
||||
public PackageCodegen forPackage(@NotNull FqName fqName, @NotNull Collection<KtFile> files) {
|
||||
assert !isDone : "Already done!";
|
||||
registerSourceFiles(files);
|
||||
sourceFiles.addAll(toIoFilesIgnoringNonPhysical(files));
|
||||
return new PackageCodegenImpl(state, files, fqName);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public MultifileClassCodegen forMultifileClass(@NotNull FqName facadeFqName, @NotNull Collection<KtFile> files) {
|
||||
assert !isDone : "Already done!";
|
||||
registerSourceFiles(files);
|
||||
sourceFiles.addAll(toIoFilesIgnoringNonPhysical(files));
|
||||
return new MultifileClassCodegenImpl(state, files, facadeFqName);
|
||||
}
|
||||
|
||||
public void registerSourceFiles(@NotNull Collection<KtFile> files) {
|
||||
sourceFiles.addAll(toIoFilesIgnoringNonPhysical(files));
|
||||
public void registerSourceFiles(@NotNull Collection<File> files) {
|
||||
for (File file : files) {
|
||||
// We ignore non-physical files here, because this code is needed to tell the make what inputs affect which outputs
|
||||
// a non-physical file cannot be processed by make
|
||||
if (file == null) continue;
|
||||
sourceFiles.add(file);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.backend.common.extensions.IrPluginContextImpl
|
||||
import org.jetbrains.kotlin.backend.common.phaser.*
|
||||
import org.jetbrains.kotlin.backend.common.serialization.DescriptorByIdSignatureFinderImpl
|
||||
import org.jetbrains.kotlin.backend.jvm.intrinsics.IrIntrinsicMethods
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.getIoFile
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.getKtFile
|
||||
import org.jetbrains.kotlin.backend.jvm.serialization.DisabledIdSignatureDescriptor
|
||||
import org.jetbrains.kotlin.backend.jvm.serialization.JvmIdSignatureDescriptor
|
||||
@@ -264,7 +265,7 @@ open class JvmIrCodegenFactory(
|
||||
/* JvmBackendContext creates new unbound symbols, have to resolve them. */
|
||||
ExternalDependenciesGenerator(symbolTable, irProviders).generateUnboundSymbolsAsDependencies()
|
||||
|
||||
context.state.factory.registerSourceFiles(irModuleFragment.files.map(IrFile::getKtFile))
|
||||
context.state.factory.registerSourceFiles(irModuleFragment.files.map(IrFile::getIoFile))
|
||||
|
||||
phases.invokeToplevel(phaseConfig, context, irModuleFragment)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user