[PATCH] D74698: [CodeGen] -pg shouldn't unconditionally add "frame-pointer"="all" fn attr w/ -mfentry

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 18 13:49:29 PST 2020


MaskRay added inline comments.


================
Comment at: clang/test/Driver/mfentry.c:5
+// RUN: %clang -pg -mfentry -O0 -emit-llvm -S -o - %s | FileCheck -check-prefix=FP --implicit-check-not='"frame-pointer"="none"' %s
+// RUN: %clang -pg -mfentry -O2 -fno-omit-frame-pointer -emit-llvm -S -o - %s | FileCheck -check-prefix=FP --implicit-check-not='"frame-pointer"="none"' %s
+// RUN: %clang -pg -mfentry -O2 -emit-llvm -S -o - %s | FileCheck -check-prefix=NOFP --implicit-check-not='"frame-pointer"="all"' %s
----------------
Change `-emit-llvm` to `-###` and delete `--implicit-check-not`. And add `-target x86_64`, because some targets don't support `-mfentry`.

For IR output, there can be multiple `"frame-pointer"="all"` function attributes. `--implicit-check-not` helps detect undesired attributes.

For cc1 options, there can't be multiple "frame-pointer" options. So `--implicit-check-not` is not useful.


================
Comment at: clang/test/Driver/mfentry.c:14
+
+//FP: "frame-pointer"="all"
+//NOFP: "frame-pointer"="none"
----------------
`// FP`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74698





More information about the cfe-commits mailing list