Skip to content

Commit 27643de

Browse files
committed
[Driver] Pass -emit-irgen thru to frontend.
Previously, it was computing that the command to pass through was -emit-ir based on the output file type.
1 parent 0fa07ba commit 27643de

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/Driver/ToolChains.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,9 @@ const char *ToolChain::JobContext::computeFrontendModeForCompile() const {
713713
case file_types::TY_SIB:
714714
return "-emit-sib";
715715
case file_types::TY_LLVM_IR:
716+
if (Args.getLastArg(options::OPT_emit_irgen)) {
717+
return "-emit-irgen";
718+
}
716719
return "-emit-ir";
717720
case file_types::TY_LLVM_BC:
718721
return "-emit-bc";

test/Driver/emit-irgen.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: %swiftc_driver -### -emit-irgen %s -o - | %FileCheck %s
2+
3+
// CHECK: -emit-irgen

0 commit comments

Comments
 (0)