File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ struct SwiftExtractorState {
2121 std::unordered_set<const swift::ModuleDecl*> encounteredModules;
2222
2323 std::vector<std::filesystem::path> sourceFiles;
24+
25+ // The path for the modules outputted by the underlying frontend run, ignoring path redirection
26+ std::vector<std::filesystem::path> originalOutputModules;
2427};
2528
2629} // namespace codeql
Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ static void lockOutputSwiftModuleTraps(codeql::SwiftExtractorState& state,
3535 }
3636}
3737
38- static void processFrontendOptions (swift::FrontendOptions& options) {
38+ static void processFrontendOptions (codeql::SwiftExtractorState& state,
39+ swift::FrontendOptions& options) {
3940 auto & inOuts = options.InputsAndOutputs ;
4041 std::vector<swift::InputFile> inputs;
4142 inOuts.forEachInput ([&](const swift::InputFile& input) {
@@ -53,6 +54,7 @@ static void processFrontendOptions(swift::FrontendOptions& options) {
5354 input.getPrimarySpecificPaths ().SupplementaryOutputs .ModuleOutputPath ;
5455 !module .empty ()) {
5556 psp.SupplementaryOutputs .ModuleOutputPath = codeql::redirect (module );
57+ state.originalOutputModules .push_back (module );
5658 }
5759 auto inputCopy = input;
5860 inputCopy.setPrimarySpecificPaths (std::move (psp));
@@ -77,7 +79,7 @@ class Observer : public swift::FrontendObserver {
7779 void parsedArgs (swift::CompilerInvocation& invocation) override {
7880 auto & options = invocation.getFrontendOptions ();
7981 lockOutputSwiftModuleTraps (state, options);
80- processFrontendOptions (options);
82+ processFrontendOptions (state, options);
8183 }
8284
8385 void configuredCompiler (swift::CompilerInstance& instance) override {
You can’t perform that action at this time.
0 commit comments