From 5324d56e1d241a4c4fd6ec4e630ab90fbc5a2fd7 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Wed, 8 Oct 2025 10:39:08 +0200 Subject: [PATCH] [Index] Convert the `-index-store-compress` command line option to a `FrontendOption` When I added the `-index-store-compress` option, I forgot to translate it into the `FrontendOptions` struct, which rendered the command line option useless. Correctly set the value in `FrontendOptions` to fix this. --- lib/Frontend/ArgsToFrontendOptionsConverter.cpp | 1 + test/Index/Store/index_compress.swift | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/Frontend/ArgsToFrontendOptionsConverter.cpp b/lib/Frontend/ArgsToFrontendOptionsConverter.cpp index 8e20de012dea8..fe16bf7f9af15 100644 --- a/lib/Frontend/ArgsToFrontendOptionsConverter.cpp +++ b/lib/Frontend/ArgsToFrontendOptionsConverter.cpp @@ -97,6 +97,7 @@ bool ArgsToFrontendOptionsConverter::convert( Opts.IndexSystemModules |= Args.hasArg(OPT_index_system_modules); Opts.IndexIgnoreStdlib |= Args.hasArg(OPT_index_ignore_stdlib); Opts.IndexIncludeLocals |= Args.hasArg(OPT_index_include_locals); + Opts.IndexStoreCompress |= Args.hasArg(OPT_index_store_compress); Opts.SerializeDebugInfoSIL |= Args.hasArg(OPT_experimental_serialize_debug_info); diff --git a/test/Index/Store/index_compress.swift b/test/Index/Store/index_compress.swift index be5f6528a8068..165f3b8e680f5 100644 --- a/test/Index/Store/index_compress.swift +++ b/test/Index/Store/index_compress.swift @@ -1,6 +1,11 @@ +// REQUIRES: shell + // RUN: rm -rf %t // RUN: %target-swift-frontend -index-store-path %t/idx -index-store-compress -o %t.o -typecheck %s // RUN: c-index-test core -print-record %t/idx | %FileCheck %s +// Check that the unit file starts with CIDXR, indicating that the record is indeed compressed. +// RUN: head -1 %t/idx/**/records/**/*index_compress.swift* | grep '^CIDXR' + func foo() {} // CHECK: [[@LINE-1]]:6 | function/Swift | s:4main3fooyyF | Def | rel: 0