]> granicus.if.org Git - clang/commitdiff
Fix logic around determining use of frame pointer with -pg.
authorStephen Hines <srhines@google.com>
Tue, 18 Sep 2018 18:34:33 +0000 (18:34 +0000)
committerStephen Hines <srhines@google.com>
Tue, 18 Sep 2018 18:34:33 +0000 (18:34 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342501 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/Clang.cpp

index 0126287114309a2752d047be5218b2e1cdc60667..73fe99442ce6a6ce9cf7364dc20dcc84b098be87 100644 (file)
@@ -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);