From acf6a3224955779724a35a383d63c48af2163171 Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Tue, 14 Mar 2023 13:27:30 +0000 Subject: [flang] add -flang-experimental-hlfir flag to flang-new This flag instructs flang-new to use the new HLFIR lowering. It is marked as experimental and not included in --help. This was added to make it more convenient to test the performance of code generated by the HLFIR lowering. Extra diffs are from running clang-format on CLOptions.inc (which was being forced by CI). Differential Revision: https://reviews.llvm.org/D146278 --- flang/lib/Frontend/CompilerInvocation.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 6e963e2..a4183a5 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -818,6 +818,11 @@ bool CompilerInvocation::createFromArgs( success = false; } + // -flang-experimental-hlfir + if (args.hasArg(clang::driver::options::OPT_flang_experimental_hlfir)) { + res.loweringOpts.setLowerToHighLevelFIR(true); + } + success &= parseFrontendArgs(res.getFrontendOpts(), args, diags); parseTargetArgs(res.getTargetOpts(), args); parsePreprocessorArgs(res.getPreprocessorOpts(), args); -- cgit v1.1