[flang-commits] [flang] [clang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Fri Nov 24 06:41:27 PST 2023


================
@@ -49,6 +49,26 @@ class CodeGenOptionsBase {
 class CodeGenOptions : public CodeGenOptionsBase {
 
 public:
+  /// The type of frame pointer used
+  enum class FramePointerKind {
+    None,    // Omit all frame pointers.
+    NonLeaf, // Keep non-leaf frame pointers.
+    All,     // Keep all frame pointers.
+  };
+
+  static llvm::StringRef getFramePointerKindName(FramePointerKind Kind) {
+    switch (Kind) {
+    case FramePointerKind::None:
+      return "none";
+    case FramePointerKind::NonLeaf:
+      return "non-leaf";
+    case FramePointerKind::All:
+      return "all";
+    }
+
+    llvm_unreachable("invalid FramePointerKind");
+  };
+
----------------
kiranchandramohan wrote:

Move this code and the same code in `clang/include/clang/Basic/CodeGenOptions.h` to llvm/include/llvm/Frontend/Driver.

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


More information about the flang-commits mailing list