File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,8 +56,10 @@ static std::string getFilename(swift::ModuleDecl& module, swift::SourceFile* pri
5656 }
5757 // PCM clang module
5858 if (module .isNonSwiftModule ()) {
59- // Several modules with different name might come from .pcm (clang module) files
59+ // Several modules with different names might come from .pcm (clang module) files
6060 // In this case we want to differentiate them
61+ // Moreover, pcm files may come from caches located in different directories, but are
62+ // unambiguously identified by the base file name, so we can discard the absolute directory
6163 std::string filename = " /pcms/" s + llvm::sys::path::filename (module .getModuleFilename ()).str ();
6264 filename += " -" ;
6365 filename += module .getName ().str ();
@@ -175,9 +177,8 @@ void codeql::extractSwiftFiles(const SwiftExtractorConfiguration& config,
175177 // extracted from source with more information. We do this by creating empty trap files.
176178 // TargetFile semantics will ensure any following run trying to extract that swiftmodule will just
177179 // skip doing it
178- auto outputModuleTrapSuffix = " -" + compiler.getMainModule ()->getName ().str ().str () + " .trap" ;
179180 for (const auto & output : config.outputSwiftModules ) {
180- TargetFile::create (output + outputModuleTrapSuffix , config.trapDir , config.getTempTrapDir ());
181+ TargetFile::create (output, config.trapDir , config.getTempTrapDir ());
181182 }
182183 for (auto & module : modules) {
183184 bool isFromSourceFile = false ;
You can’t perform that action at this time.
0 commit comments