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

Kiran Chandramohan via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 22 09:16:45 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");
----------------
kiranchandramohan wrote:

@banach-space the test is in func-attr.f90 https://github.com/llvm/llvm-project/pull/74598/files#diff-1d4cea32c615e677fc20e34ffd2f5c3e0f84b00f5af6a692d787747e17bd9e3d

```
! RUN: not %flang_fc1 -triple aarch64-none-none -mframe-pointer=wrongval -emit-llvm -o - %s 2>&1| FileCheck %s --check-prefix=CHECK-WRONGVALUEFP
```

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


More information about the cfe-commits mailing list