Skip to content

Commit 5324d56

Browse files
committed
[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.
1 parent d54f601 commit 5324d56

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ bool ArgsToFrontendOptionsConverter::convert(
9797
Opts.IndexSystemModules |= Args.hasArg(OPT_index_system_modules);
9898
Opts.IndexIgnoreStdlib |= Args.hasArg(OPT_index_ignore_stdlib);
9999
Opts.IndexIncludeLocals |= Args.hasArg(OPT_index_include_locals);
100+
Opts.IndexStoreCompress |= Args.hasArg(OPT_index_store_compress);
100101
Opts.SerializeDebugInfoSIL |=
101102
Args.hasArg(OPT_experimental_serialize_debug_info);
102103

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
// REQUIRES: shell
2+
13
// RUN: rm -rf %t
24
// RUN: %target-swift-frontend -index-store-path %t/idx -index-store-compress -o %t.o -typecheck %s
35
// RUN: c-index-test core -print-record %t/idx | %FileCheck %s
46

7+
// Check that the unit file starts with CIDXR, indicating that the record is indeed compressed.
8+
// RUN: head -1 %t/idx/**/records/**/*index_compress.swift* | grep '^CIDXR'
9+
510
func foo() {}
611
// CHECK: [[@LINE-1]]:6 | function/Swift | s:4main3fooyyF | Def | rel: 0

0 commit comments

Comments
 (0)