From 2c32ddf5c3f46440aa7b7ec6a9bc935bf28c772d Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Tue, 18 Sep 2018 18:34:33 +0000 Subject: [PATCH] Fix logic around determining use of frame pointer with -pg. Summary: As part of r342165, I rewrote the logic to check whether -fno-omit-frame-pointer was passed after a -fomit-frame-pointer argument. This CL switches that logic to use the consolidated shouldUseFramePointer() function. This fixes a potential issue where -pg gets used with -fomit-frame-pointer on a platform that must always retain frame pointers. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52191 llvm-svn: 342501 --- clang/lib/Driver/ToolChains/Clang.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 0126287..73fe994 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -4956,8 +4956,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } if (Arg *A = Args.getLastArg(options::OPT_pg)) - if (Args.hasFlag(options::OPT_fomit_frame_pointer, - options::OPT_fno_omit_frame_pointer, /*default=*/false)) + if (shouldUseFramePointer(Args, Triple)) D.Diag(diag::err_drv_argument_not_allowed_with) << "-fomit-frame-pointer" << A->getAsString(Args); -- 2.7.4