Skip to content

Commit 6dde338

Browse files
committed
[sil-opt] Actually pass down IRGenOptions to irgen::createIRGenModule().
Otherwise the options from our invocation that we specialized in sil-opt's main function will not take effect.
1 parent 86d4ba1 commit 6dde338

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

include/swift/IRGen/IRGenPublic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class IRGenModule;
3131
std::pair<IRGenerator *, IRGenModule *>
3232
createIRGenModule(SILModule *SILMod, StringRef OutputFilename,
3333
StringRef MainInputFilenameForDebugInfo,
34-
StringRef PrivateDiscriminator);
34+
StringRef PrivateDiscriminator, IRGenOptions &options);
3535

3636
/// Delete the IRGenModule and IRGenerator obtained by the above call.
3737
void deleteIRGenModule(std::pair<IRGenerator *, IRGenModule *> &Module);

lib/IRGen/IRGen.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -937,9 +937,8 @@ static void initLLVMModule(const IRGenModule &IGM, SILModule &SIL) {
937937
std::pair<IRGenerator *, IRGenModule *>
938938
swift::irgen::createIRGenModule(SILModule *SILMod, StringRef OutputFilename,
939939
StringRef MainInputFilenameForDebugInfo,
940-
StringRef PrivateDiscriminator) {
941-
942-
IRGenOptions Opts;
940+
StringRef PrivateDiscriminator,
941+
IRGenOptions &Opts) {
943942
IRGenerator *irgen = new IRGenerator(Opts, *SILMod);
944943
auto targetMachine = irgen->createTargetMachine();
945944
if (!targetMachine)

tools/sil-opt/SILOpt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,8 @@ int main(int argc, char **argv) {
784784
case OptGroup::Unknown: {
785785
auto T = irgen::createIRGenModule(
786786
SILMod.get(), Invocation.getOutputFilenameForAtMostOnePrimary(),
787-
Invocation.getMainInputFilenameForDebugInfoForAtMostOnePrimary(), "");
787+
Invocation.getMainInputFilenameForDebugInfoForAtMostOnePrimary(), "",
788+
IRGenOpts);
788789
runCommandLineSelectedPasses(SILMod.get(), T.second);
789790
irgen::deleteIRGenModule(T);
790791
break;

0 commit comments

Comments
 (0)