r342165 - Support -fno-omit-frame-pointer with -pg.
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 17 13:00:29 PDT 2018
Seems like it might be problematic to have this separate implementation of
checking whether frame pointers are enabled compared to the canonical one
(the one actually used to enable/disable frame pointers) in the static
"shouldUseFramePointer" Function?
(eg: apparently on some targets (mustUseNonLeafFramePointerForTarget) frame
pointers are enabled regardless of the arguments - looks like in that case
this would still produce an error if you combined -fomit-frame-pointer with
-pg on such a platform, even though frame pointers would still be emitted?)
On Thu, Sep 13, 2018 at 12:51 PM Stephen Hines via cfe-commits <
cfe-commits at lists.llvm.org> wrote:
> Author: srhines
> Date: Thu Sep 13 12:50:02 2018
> New Revision: 342165
>
> URL: http://llvm.org/viewvc/llvm-project?rev=342165&view=rev
> Log:
> Support -fno-omit-frame-pointer with -pg.
>
> Summary:
> Previously, any instance of -fomit-frame-pointer would make it such that
> -pg was an invalid flag combination. If -fno-omit-frame-pointer is
> passed later on the command line (such that it actually takes effect),
> -pg should be allowed.
>
> Reviewers: nickdesaulniers
>
> Reviewed By: nickdesaulniers
>
> Subscribers: manojgupta, nickdesaulniers, cfe-commits, kongyi, chh, pirama
>
> Differential Revision: https://reviews.llvm.org/D51713
>
> Modified:
> cfe/trunk/lib/Driver/ToolChains/Clang.cpp
> cfe/trunk/test/Driver/clang_f_opts.c
>
> Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=342165&r1=342164&r2=342165&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)
> +++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Thu Sep 13 12:50:02 2018
> @@ -4910,7 +4910,8 @@ void Clang::ConstructJob(Compilation &C,
> }
>
> if (Arg *A = Args.getLastArg(options::OPT_pg))
> - if (Args.hasArg(options::OPT_fomit_frame_pointer))
> + if (Args.hasFlag(options::OPT_fomit_frame_pointer,
> + options::OPT_fno_omit_frame_pointer,
> /*default=*/false))
> D.Diag(diag::err_drv_argument_not_allowed_with) <<
> "-fomit-frame-pointer"
> <<
> A->getAsString(Args);
>
>
> Modified: cfe/trunk/test/Driver/clang_f_opts.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang_f_opts.c?rev=342165&r1=342164&r2=342165&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Driver/clang_f_opts.c (original)
> +++ cfe/trunk/test/Driver/clang_f_opts.c Thu Sep 13 12:50:02 2018
> @@ -531,3 +531,8 @@
> // RUN: %clang -### -S -fno-delete-null-pointer-checks
> -fdelete-null-pointer-checks %s 2>&1 | FileCheck
> -check-prefix=CHECK-NULL-POINTER-CHECKS %s
> // CHECK-NO-NULL-POINTER-CHECKS: "-fno-delete-null-pointer-checks"
> // CHECK-NULL-POINTER-CHECKS-NOT: "-fno-delete-null-pointer-checks"
> +
> +// RUN: %clang -### -S -fomit-frame-pointer -pg %s 2>&1 | FileCheck
> -check-prefix=CHECK-NO-MIX-OMIT-FP-PG %s
> +// RUN: %clang -### -S -fomit-frame-pointer -fno-omit-frame-pointer -pg
> %s 2>&1 | FileCheck -check-prefix=CHECK-MIX-NO-OMIT-FP-PG %s
> +// CHECK-NO-MIX-OMIT-FP-PG: '-fomit-frame-pointer' not allowed with '-pg'
> +// CHECK-MIX-NO-OMIT-FP-PG-NOT: '-fomit-frame-pointer' not allowed with
> '-pg'
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180917/ae21fb66/attachment.html>
More information about the cfe-commits
mailing list