[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:14:42 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:
This is a change suggested above by Kiran.
https://github.com/llvm/llvm-project/pull/74598#discussion_r1417479590
https://github.com/llvm/llvm-project/pull/74598
More information about the flang-commits
mailing list