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

Radu Salavat via flang-commits flang-commits at lists.llvm.org
Mon Dec 11 03:28:22 PST 2023


================
@@ -248,13 +248,21 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts,
   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");
-    if (s == "none")
+    
+    if (!(s=="none" || s=="no-leaf" || s=="all")) {
+    const auto debugWarningId = diags.getCustomDiagID(
+        clang::DiagnosticsEngine::Warning, "Frame pointer: %0");
+    diags.Report(debugWarningId).AddString(a->getValue());
+    }
+
+    if (s == "none") {
       opts.setFramePointer(llvm::FramePointerKind::None);
-    else if (s == "non-leaf")
-      opts.setFramePointer(llvm::FramePointerKind::NonLeaf);
-    else
-      opts.setFramePointer(llvm::FramePointerKind::All);
+    } else {
+      if (s == "non-leaf")
+        opts.setFramePointer(llvm::FramePointerKind::NonLeaf);
+      else
+        opts.setFramePointer(llvm::FramePointerKind::All);
----------------
Radu2k wrote:

Ok, I will then update this in the following commit. 

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


More information about the flang-commits mailing list