[PATCH] D101016: [IR][sanitizer] Add module flag "frame-pointer" and set it for cc1 -mframe-pointer={non-leaf,all}

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 22 12:43:34 PDT 2021


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: llvm/lib/IR/Function.cpp:333
 
 Function *Function::createWithDefaultAttr(FunctionType *Ty,
                                           LinkageTypes Linkage,
----------------
nickdesaulniers wrote:
> we should call this from gcov too to solve https://github.com/ClangBuiltLinux/linux/issues/955.
Exactly:) Planned to do it after this patch https://github.com/ClangBuiltLinux/linux/issues/1238#issuecomment-824517092


================
Comment at: llvm/lib/IR/Function.cpp:346
+  case 1:
+    B.addAttribute("frame-pointer", "non-leaf");
+    break;
----------------
vitalybuka wrote:
> Should these be added into Attribute:: ?
The function attribute "frame-pointer" is already used, with a string value. A regular attribute cannot have a string value so it was created as the string form...

The documentation is long overdue, though. I have added a bit documentation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101016/new/

https://reviews.llvm.org/D101016



More information about the cfe-commits mailing list