File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,10 @@ SerializationOptions CompilerInvocation::computeSerializationOptions(
208
208
} else {
209
209
serializationOpts.ExtraClangOptions = getClangImporterOptions ().ExtraArgs ;
210
210
}
211
+ if (LangOpts.ClangTarget ) {
212
+ serializationOpts.ExtraClangOptions .push_back (" -triple" );
213
+ serializationOpts.ExtraClangOptions .push_back (LangOpts.ClangTarget ->str ());
214
+ }
211
215
212
216
serializationOpts.PluginSearchOptions =
213
217
getSearchPathOptions ().PluginSearchOpts ;
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-frontend -emit-module -module-name ClangTargetModule -emit-module-path %t/has_clang_target.swiftmodule -parse-as-library -serialize-debugging-options -clang-target arm64e-apple-macos12.12 %s
3
+
4
+ // Check the serialized flags paths.
5
+ // RUN: llvm-bcanalyzer -dump %t/has_clang_target.swiftmodule > %t/has_clang_target.swiftmodule.txt
6
+ // RUN: %FileCheck %s < %t/has_clang_target.swiftmodule.txt
7
+
8
+ // CHECK-LABEL: <OPTIONS_BLOCK
9
+ // CHECK: <XCC abbrevid={{[0-9]+}}/> blob data = '-triple'
10
+ // CHECK-NEXT: <XCC abbrevid={{[0-9]+}}/> blob data = 'arm64e-apple-macos12.12'
11
+ // CHECK: </OPTIONS_BLOCK>
You can’t perform that action at this time.
0 commit comments