[flang-commits] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Thu Dec 7 08:32:00 PST 2023


================
@@ -245,6 +245,18 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts,
 
   opts.AliasAnalysis = opts.OptimizationLevel > 0;
 
+  if (const llvm::opt::Arg *a =
+          args.getLastArg(clang::driver::options::OPT_mframe_pointer_EQ)) {
+    llvm::StringRef s = a->getValue();
+    assert(s == "none" || s == "non-leaf" || s == "all");
----------------
tblah wrote:

I don't think this should be an assertion
1) Yes users shouldn't use `flang -fc1`, but it is still kind of a user interface. Crashing with a stack trace looks like a bug rather than a typo in the command line options.
2) Assertions are not enabled on all builds

It would be better to print an error or warning message

https://github.com/llvm/llvm-project/pull/74598


More information about the flang-commits mailing list