From 30ff659175ca1c884509463b182dd4350e37c482 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Thu, 7 Aug 2014 03:14:34 +0000 Subject: [PATCH] Driver: Add -fno-profile-arcs to go with -fprofile-arcs This is a trivial gcc-compatible change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215051 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/Options.td | 1 + lib/Driver/ToolChains.cpp | 3 ++- lib/Driver/Tools.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 55f669b223..3e2d0277fc 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -822,6 +822,7 @@ def fno_pic : Flag<["-"], "fno-pic">, Group; def fpie : Flag<["-"], "fpie">, Group; def fno_pie : Flag<["-"], "fno-pie">, Group; def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group; +def fno_profile_arcs : Flag<["-"], "fno-profile-arcs">, Group; def fprofile_generate : Flag<["-"], "fprofile-generate">, Group; def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>; def frandom_seed_EQ : Joined<["-"], "frandom-seed=">, Group; diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 63ad2619d9..ad82504f3d 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -333,7 +333,8 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, } // If we are building profile support, link that library in. - if (Args.hasArg(options::OPT_fprofile_arcs) || + if (Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs, + false) || Args.hasArg(options::OPT_fprofile_generate) || Args.hasArg(options::OPT_fprofile_instr_generate) || Args.hasArg(options::OPT_fcreate_profile) || diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index c28283fdde..86a05cd28c 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2105,7 +2105,8 @@ static void addClangRTLinux( static void addProfileRT( const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs) { - if (!(Args.hasArg(options::OPT_fprofile_arcs) || + if (!(Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs, + false) || Args.hasArg(options::OPT_fprofile_generate) || Args.hasArg(options::OPT_fprofile_instr_generate) || Args.hasArg(options::OPT_fcreate_profile) || @@ -3226,7 +3227,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_ftest_coverage) || Args.hasArg(options::OPT_coverage)) CmdArgs.push_back("-femit-coverage-notes"); - if (Args.hasArg(options::OPT_fprofile_arcs) || + if (Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs, + false) || Args.hasArg(options::OPT_coverage)) CmdArgs.push_back("-femit-coverage-data"); -- 2.40.0