[llvm] [clang-tools-extra] [clang] [flang] [flang] Pass to add frame pointer attribute (PR #74598)

Andrzej WarzyƄski via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 22 09:08:01 PST 2023


================
@@ -245,6 +245,24 @@ 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();
+
+    if (!(s == "none" || s == "non-leaf" || s == "all")) {
+      const auto debugWarningId = diags.getCustomDiagID(
+          clang::DiagnosticsEngine::Error, "Frame pointer: %0");
----------------
banach-space wrote:

An error will cause the compiler to crash - I can't see any `RUN` lines in [rame-pointer-forwarding.f90](https://github.com/llvm/llvm-project/pull/74598/files#diff-fad5151400801da3763ab30d3470d69a748b236f0793afc41a9a94f6432a7c78) that would cause the compiler to crash.

Also, please don't "resolve" threads that haven't been concluded yet - this makes reviewing harder.

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


More information about the cfe-commits mailing list