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:
Ilya Chernikov
2021-12-24 14:59:07 +01:00
committed by teamcity
parent 275135a1b2
commit a8594e9ce8
2 changed files with 11 additions and 5 deletions
@@ -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