File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 13
13
#ifndef FORTRAN_TOOLS_CROSS_TOOL_HELPERS_H
14
14
#define FORTRAN_TOOLS_CROSS_TOOL_HELPERS_H
15
15
16
+ #include " flang/Frontend/CodeGenOptions.h"
16
17
#include " flang/Frontend/LangOptions.h"
17
18
#include < cstdint>
18
19
@@ -26,6 +27,15 @@ struct MLIRToLLVMPassPipelineConfig {
26
27
explicit MLIRToLLVMPassPipelineConfig (llvm::OptimizationLevel level) {
27
28
OptLevel = level;
28
29
}
30
+ explicit MLIRToLLVMPassPipelineConfig (llvm::OptimizationLevel level,
31
+ const Fortran::frontend::CodeGenOptions &opts) {
32
+ OptLevel = level;
33
+ StackArrays = opts.StackArrays ;
34
+ Underscoring = opts.Underscoring ;
35
+ LoopVersioning = opts.LoopVersioning ;
36
+ DebugInfo = opts.getDebugInfo ();
37
+ }
38
+
29
39
llvm::OptimizationLevel OptLevel; // /< optimisation level
30
40
bool StackArrays = false ; // /< convert memory allocations to alloca.
31
41
bool Underscoring = true ; // /< add underscores to function names.
Original file line number Diff line number Diff line change @@ -713,15 +713,7 @@ void CodeGenAction::generateLLVMIR() {
713
713
pm.addPass (std::make_unique<Fortran::lower::VerifierPass>());
714
714
pm.enableVerifier (/* verifyPasses=*/ true );
715
715
716
- const auto targetOpts = ci.getInvocation ().getTargetOpts ();
717
- const llvm::Triple triple (targetOpts.triple );
718
-
719
- MLIRToLLVMPassPipelineConfig config (level);
720
-
721
- config.StackArrays = opts.StackArrays ;
722
- config.Underscoring = opts.Underscoring ;
723
- config.LoopVersioning = opts.LoopVersioning ;
724
- config.DebugInfo = opts.getDebugInfo ();
716
+ MLIRToLLVMPassPipelineConfig config (level, opts);
725
717
726
718
// Create the pass pipeline
727
719
fir::createMLIRToLLVMPassPipeline (pm, config);
You can’t perform that action at this time.
0 commit comments